bullet: sync rigid body transform when node is reparented

Reparenting a node will change its net transform, so it should cause a transform sync.

Fixes #629
This commit is contained in:
rdb 2019-05-13 13:31:36 +02:00
parent e8fc76747a
commit f183d901cb
2 changed files with 15 additions and 0 deletions

View File

@ -359,6 +359,20 @@ do_transform_changed() {
}
}
/**
*
*/
void BulletRigidBodyNode::
parents_changed() {
if (_motion.sync_disabled()) return;
if (get_num_parents() > 0) {
LightMutexHolder holder(BulletWorld::get_global_lock());
do_transform_changed();
}
}
/**
*
*/

View File

@ -112,6 +112,7 @@ public:
void do_sync_b2p();
protected:
virtual void parents_changed();
virtual void transform_changed();
private: