Browse Source

Added method to enforce calling the transform_changed hook on bullet nodes.

enn0x 12 years ago
parent
commit
ca103005a5
2 changed files with 18 additions and 0 deletions
  1. 15 0
      panda/src/bullet/bulletBodyNode.cxx
  2. 3 0
      panda/src/bullet/bulletBodyNode.h

+ 15 - 0
panda/src/bullet/bulletBodyNode.cxx

@@ -655,3 +655,18 @@ add_shapes_from_collision_solids(CollisionNode *cnode) {
   }
 }
 
+////////////////////////////////////////////////////////////////////
+//     Function: BulletBodyNode::set_transform_dirty
+//       Access: Published
+//  Description: This method enforces an update of the Bullet
+//               transform, that is copies the scene graph transform
+//               to the Bullet transform.
+//               This is achieved by alling the protected PandaNode 
+//               hook 'transform_changed'. 
+////////////////////////////////////////////////////////////////////
+void BulletBodyNode::
+set_transform_dirty() {
+
+  transform_changed();
+}
+

+ 3 - 0
panda/src/bullet/bulletBodyNode.h

@@ -109,6 +109,9 @@ PUBLISHED:
   void set_ccd_swept_sphere_radius(PN_stdfloat radius);
   void set_ccd_motion_threshold(PN_stdfloat threshold);
 
+  // Special
+  void set_transform_dirty();
+
 public:
   virtual btCollisionObject *get_object() const = 0;