Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[MANTA] r1493 - trunk/Model/Groups


Chronological Thread 
  • From: thiago@sci.utah.edu
  • To: manta@sci.utah.edu
  • Subject: [MANTA] r1493 - trunk/Model/Groups
  • Date: Tue, 17 Jul 2007 23:10:18 -0600 (MDT)

Author: thiago
Date: Tue Jul 17 23:10:17 2007
New Revision: 1493

Modified:
   trunk/Model/Groups/DynBVH.cc
Log:
fix divide by 0 that was causing seg faults.

Modified: trunk/Model/Groups/DynBVH.cc
==============================================================================
--- trunk/Model/Groups/DynBVH.cc        (original)
+++ trunk/Model/Groups/DynBVH.cc        Tue Jul 17 23:10:17 2007
@@ -637,8 +637,11 @@
       int which_bin = static_cast<int>
         (num_samples * (obj_centroid[axis] - min_point[axis])/width[axis]);
 
-      if (which_bin >= num_samples)
+      if (width[axis] == 0)
+        which_bin = 0;
+      else if (which_bin >= num_samples)
         which_bin = num_samples - 1;
+
       bins[axis][which_bin].count++;
       bins[axis][which_bin].bounds.extendByBox(obj_box);
     }




  • [MANTA] r1493 - trunk/Model/Groups, thiago, 07/18/2007

Archive powered by MHonArc 2.6.16.

Top of page