From 6142bdca0a02c0c7a4edc8047308c21ba8b85c8c Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Thu, 16 Jan 2014 18:47:03 -0800 Subject: [PATCH] brDefaultMotionState::getWorldTransform was wrong, in case of a non-identity centerOfMassOffset. Thanks to Mathias for the report/fix. --- src/LinearMath/btDefaultMotionState.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/LinearMath/btDefaultMotionState.h b/src/LinearMath/btDefaultMotionState.h index c90b74923..01c5f8d93 100644 --- a/src/LinearMath/btDefaultMotionState.h +++ b/src/LinearMath/btDefaultMotionState.h @@ -25,14 +25,14 @@ ATTRIBUTE_ALIGNED16(struct) btDefaultMotionState : public btMotionState ///synchronizes world transform from user to physics virtual void getWorldTransform(btTransform& centerOfMassWorldTrans ) const { - centerOfMassWorldTrans = m_centerOfMassOffset.inverse() * m_graphicsWorldTrans ; + centerOfMassWorldTrans = m_graphicsWorldTrans * m_centerOfMassOffset.inverse() ; } ///synchronizes world transform from physics to user ///Bullet only calls the update of worldtransform for active objects virtual void setWorldTransform(const btTransform& centerOfMassWorldTrans) { - m_graphicsWorldTrans = centerOfMassWorldTrans * m_centerOfMassOffset ; + m_graphicsWorldTrans = centerOfMassWorldTrans * m_centerOfMassOffset; }