Browse Source

Prevent assertion when calculating bounds for geom without vertices

rdb 8 years ago
parent
commit
e15cfd74e8
1 changed files with 3 additions and 3 deletions
  1. 3 3
      panda/src/gobj/geom.cxx

+ 3 - 3
panda/src/gobj/geom.cxx

@@ -1257,15 +1257,15 @@ compute_internal_bounds(Geom::CData *cdata, Thread *current_thread) const {
                        InternalName::get_vertex(),
                        InternalName::get_vertex(),
                        cdata, current_thread);
                        cdata, current_thread);
 
 
-  nassertv(!pmin.is_nan());
-  nassertv(!pmax.is_nan());
-
   BoundingVolume::BoundsType btype = cdata->_bounds_type;
   BoundingVolume::BoundsType btype = cdata->_bounds_type;
   if (btype == BoundingVolume::BT_default) {
   if (btype == BoundingVolume::BT_default) {
     btype = bounds_type;
     btype = bounds_type;
   }
   }
 
 
   if (found_any) {
   if (found_any) {
+    nassertv(!pmin.is_nan());
+    nassertv(!pmax.is_nan());
+
     // Then we put the bounding volume around both of those points.
     // Then we put the bounding volume around both of those points.
     PN_stdfloat avg_box_area;
     PN_stdfloat avg_box_area;
     switch (btype) {
     switch (btype) {