From ca103005a5fbca47adf59dbdf0949f50b1607aca Mon Sep 17 00:00:00 2001 From: enn0x Date: Wed, 22 May 2013 21:37:29 +0000 Subject: [PATCH] Added method to enforce calling the transform_changed hook on bullet nodes. --- panda/src/bullet/bulletBodyNode.cxx | 15 +++++++++++++++ panda/src/bullet/bulletBodyNode.h | 3 +++ 2 files changed, 18 insertions(+) diff --git a/panda/src/bullet/bulletBodyNode.cxx b/panda/src/bullet/bulletBodyNode.cxx index 3dba3ff2b1..ca7beb7dc4 100644 --- a/panda/src/bullet/bulletBodyNode.cxx +++ b/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(); +} + diff --git a/panda/src/bullet/bulletBodyNode.h b/panda/src/bullet/bulletBodyNode.h index 63f359022f..7d2c6134e9 100644 --- a/panda/src/bullet/bulletBodyNode.h +++ b/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;