Bladeren bron

fix crashes loading bam files

David Rose 20 jaren geleden
bovenliggende
commit
0a675eae03
2 gewijzigde bestanden met toevoegingen van 7 en 3 verwijderingen
  1. 4 1
      panda/src/collide/collisionNode.cxx
  2. 3 2
      panda/src/collide/collisionSolid.cxx

+ 4 - 1
panda/src/collide/collisionNode.cxx

@@ -364,10 +364,13 @@ compute_internal_bounds(int pipeline_stage) const {
   // Now actually compute the bounding volume by putting it around all
   // Now actually compute the bounding volume by putting it around all
   // of our solids' bounding volumes.
   // of our solids' bounding volumes.
   pvector<const BoundingVolume *> child_volumes;
   pvector<const BoundingVolume *> child_volumes;
+  pvector<CPT(BoundingVolume) > cpt_volumes;
 
 
   Solids::const_iterator gi;
   Solids::const_iterator gi;
   for (gi = _solids.begin(); gi != _solids.end(); ++gi) {
   for (gi = _solids.begin(); gi != _solids.end(); ++gi) {
-    child_volumes.push_back((*gi)->get_bounds());
+    CPT(BoundingVolume) volume = (*gi)->get_bounds();
+    cpt_volumes.push_back(volume);
+    child_volumes.push_back(volume);
   }
   }
 
 
   const BoundingVolume **child_begin = &child_volumes[0];
   const BoundingVolume **child_begin = &child_volumes[0];

+ 3 - 2
panda/src/collide/collisionSolid.cxx

@@ -331,8 +331,9 @@ fillin(DatagramIterator &scan, BamReader *manager) {
     _effective_normal.read_datagram(scan);
     _effective_normal.read_datagram(scan);
   }
   }
 
 
-  // The viz is always stale after reading from a bam file.
-  _flags |= F_viz_geom_stale;
+  // The viz is always stale after reading from a bam file.  So is the
+  // bounding volume.
+  _flags |= F_viz_geom_stale | F_internal_bounds_stale;
 }
 }