added synchronizeSingleMotionState, thanks Chunky.
This commit is contained in:
@@ -250,18 +250,11 @@ void btDiscreteDynamicsWorld::applyGravity()
|
||||
}
|
||||
|
||||
|
||||
void btDiscreteDynamicsWorld::synchronizeSingleMotionState(btRigidBody* body)
|
||||
{
|
||||
btAssert(body);
|
||||
|
||||
void btDiscreteDynamicsWorld::synchronizeMotionStates()
|
||||
{
|
||||
BT_PROFILE("synchronizeMotionStates");
|
||||
{
|
||||
//todo: iterate over awake simulation islands!
|
||||
for ( int i=0;i<m_activeObjects.size();i++)
|
||||
{
|
||||
btCollisionObject* colObj = m_activeObjects[i];
|
||||
|
||||
btRigidBody* body = btRigidBody::upcast(colObj);
|
||||
if (body && body->getMotionState() && !body->isStaticOrKinematicObject())
|
||||
if (body->getMotionState() && !body->isStaticOrKinematicObject())
|
||||
{
|
||||
//we need to call the update at least once, even for sleeping objects
|
||||
//otherwise the 'graphics' transform never updates properly
|
||||
@@ -275,6 +268,21 @@ void btDiscreteDynamicsWorld::synchronizeMotionStates()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void btDiscreteDynamicsWorld::synchronizeMotionStates()
|
||||
{
|
||||
BT_PROFILE("synchronizeMotionStates");
|
||||
{
|
||||
//todo: iterate over awake simulation islands!
|
||||
for ( int i=0;i<m_activeObjects.size();i++)
|
||||
{
|
||||
btCollisionObject* colObj = m_activeObjects[i];
|
||||
|
||||
btRigidBody* body = btRigidBody::upcast(colObj);
|
||||
if (body)
|
||||
synchronizeSingleMotionState(body);
|
||||
}
|
||||
}
|
||||
|
||||
if (getDebugDrawer() && getDebugDrawer()->getDebugMode() & btIDebugDraw::DBG_DrawWireframe)
|
||||
|
||||
@@ -92,6 +92,9 @@ public:
|
||||
|
||||
virtual void synchronizeMotionStates();
|
||||
|
||||
///this can be useful to synchronize a single rigid body -> graphics object
|
||||
void synchronizeSingleMotionState(btRigidBody* body);
|
||||
|
||||
void addConstraint(btTypedConstraint* constraint, bool disableCollisionsBetweenLinkedBodies=false);
|
||||
|
||||
void removeConstraint(btTypedConstraint* constraint);
|
||||
|
||||
Reference in New Issue
Block a user