brDefaultMotionState::getWorldTransform was wrong, in case of a non-identity centerOfMassOffset.
Thanks to Mathias for the report/fix.
This commit is contained in:
@@ -25,14 +25,14 @@ ATTRIBUTE_ALIGNED16(struct) btDefaultMotionState : public btMotionState
|
|||||||
///synchronizes world transform from user to physics
|
///synchronizes world transform from user to physics
|
||||||
virtual void getWorldTransform(btTransform& centerOfMassWorldTrans ) const
|
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
|
///synchronizes world transform from physics to user
|
||||||
///Bullet only calls the update of worldtransform for active objects
|
///Bullet only calls the update of worldtransform for active objects
|
||||||
virtual void setWorldTransform(const btTransform& centerOfMassWorldTrans)
|
virtual void setWorldTransform(const btTransform& centerOfMassWorldTrans)
|
||||||
{
|
{
|
||||||
m_graphicsWorldTrans = centerOfMassWorldTrans * m_centerOfMassOffset ;
|
m_graphicsWorldTrans = centerOfMassWorldTrans * m_centerOfMassOffset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user