From bf59e880c6c999ccb59bce26dd325bc109a054ed Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 9 Dec 2020 16:25:29 +0100 Subject: [PATCH] bullet: Fix compilation error with Bullet 2.90+ --- panda/src/bullet/bulletSoftBodyNode.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/panda/src/bullet/bulletSoftBodyNode.cxx b/panda/src/bullet/bulletSoftBodyNode.cxx index f4ae8d2120..ea07728954 100644 --- a/panda/src/bullet/bulletSoftBodyNode.cxx +++ b/panda/src/bullet/bulletSoftBodyNode.cxx @@ -187,14 +187,22 @@ transform_changed() { // Offset between current approx center and current initial transform btVector3 pos = LVecBase3_to_btVector3(this->do_get_aabb().get_approx_center()); +#if BT_BULLET_VERSION >= 290 + btVector3 origin = _soft->getWorldTransform().getOrigin(); +#else btVector3 origin = _soft->m_initialWorldTransform.getOrigin(); +#endif btVector3 offset = pos - origin; // Subtract offset to get new transform for the body trans.setOrigin(trans.getOrigin() - offset); // Now apply the new transform +#if BT_BULLET_VERSION >= 290 + _soft->transform(_soft->getWorldTransform().inverse()); +#else _soft->transform(_soft->m_initialWorldTransform.inverse()); +#endif _soft->transform(trans); if (ts->has_scale()) {