Browse Source

bounds should be computed around animated vertices

David Rose 19 years ago
parent
commit
54ed185526
1 changed files with 5 additions and 2 deletions
  1. 5 2
      panda/src/gobj/geom.cxx

+ 5 - 2
panda/src/gobj/geom.cxx

@@ -1017,12 +1017,15 @@ compute_internal_bounds(Thread *current_thread) const {
   PT(BoundingVolume) bound = new BoundingSphere;
   PT(BoundingVolume) bound = new BoundingSphere;
   GeometricBoundingVolume *gbv = DCAST(GeometricBoundingVolume, bound);
   GeometricBoundingVolume *gbv = DCAST(GeometricBoundingVolume, bound);
 
 
+  // Get the vertex data, after animation.
+  CPT(GeomVertexData) vertex_data = 
+    get_vertex_data(current_thread)->animate_vertices(current_thread);
+
   // Now actually compute the bounding volume.  We do this by using
   // Now actually compute the bounding volume.  We do this by using
   // calc_tight_bounds to determine our minmax first.
   // calc_tight_bounds to determine our minmax first.
   LPoint3f points[2];
   LPoint3f points[2];
   bool found_any = false;
   bool found_any = false;
-  do_calc_tight_bounds(points[0], points[1], found_any, 
-                       get_vertex_data(current_thread),
+  do_calc_tight_bounds(points[0], points[1], found_any, vertex_data,
 		       false, LMatrix4f::ident_mat(), current_thread);
 		       false, LMatrix4f::ident_mat(), current_thread);
   if (found_any) {
   if (found_any) {
     // Then we put the bounding volume around both of those points.
     // Then we put the bounding volume around both of those points.