Revision: 47221
          http://brlcad.svn.sourceforge.net/brlcad/?rev=47221&view=rev
Author:   abhi2011
Date:     2011-10-13 11:43:47 +0000 (Thu, 13 Oct 2011)
Log Message:
-----------
Rayshot results structure corrected to be initialized for every manifold now, 
instead of for every ray

Modified Paths:
--------------
    brlcad/trunk/src/libged/simulate/simrt.c
    brlcad/trunk/src/libged/simulate/simrt.h

Modified: brlcad/trunk/src/libged/simulate/simrt.c
===================================================================
--- brlcad/trunk/src/libged/simulate/simrt.c    2011-10-13 11:03:51 UTC (rev 
47220)
+++ brlcad/trunk/src/libged/simulate/simrt.c    2011-10-13 11:43:47 UTC (rev 
47221)
@@ -405,6 +405,19 @@
 }
 
 
+int
+init_rayshot_results(void)
+{
+        /* Initialize the result structure */
+       rt_result.xr_min_y = MAX_FASTF;
+       rt_result.xr_max_y = -MAX_FASTF;
+       rt_result.xr_min_x_x  = MAX_FASTF;
+       rt_result.xr_max_x_x  = -MAX_FASTF;
+
+       return GED_OK;
+}
+
+
 /**
  * Traverse the hit list and overlap list, drawing the ray segments
  */
@@ -424,11 +437,6 @@
      */
     if (overlap_list.forw != &overlap_list) {
 
-       /* Initialize the result structure : todo move to separate function*/
-       rt_result.xr_min_y = MAX_FASTF;
-       rt_result.xr_max_y = -MAX_FASTF;
-       rt_result.xr_min_x_x  = MAX_FASTF;
-       rt_result.xr_max_x_x  = -MAX_FASTF;
 
        ovp = overlap_list.forw;
        while (ovp != &overlap_list) {
@@ -641,6 +649,9 @@
            /* Add the region to the result of the sim so it will be drawn too 
*/
            add_to_comb(gedp, sim_params->sim_comb_name, 
bu_vls_addr(&overlap_name));
 
+           /* Initialize the rayshot results structure, has to be done for 
each manifold  */
+           init_rayshot_results();
+
            /* Shoot rays right here as the pair of rigid_body ptrs are known,
             * todo: ignore volumes already shot
             */

Modified: brlcad/trunk/src/libged/simulate/simrt.h
===================================================================
--- brlcad/trunk/src/libged/simulate/simrt.h    2011-10-13 11:03:51 UTC (rev 
47220)
+++ brlcad/trunk/src/libged/simulate/simrt.h    2011-10-13 11:43:47 UTC (rev 
47221)
@@ -197,6 +197,14 @@
 init_raytrace(struct simulation_params *sim_params, struct rt_i *rtip);
 
 
+/**
+ * Initializes the rayshot results structure, called before analyzing
+ * each manifold through rays shot in x, y & z directions
+ */
+int
+init_rayshot_results(void);
+
+
 #endif /* SIMRT_H_ */
 
 /*

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct
_______________________________________________
BRL-CAD Source Commits mailing list
brlcad-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to