Force Reinitialize dynamic body

wh1sp3r
Posts: 4
Joined: Fri Sep 16, 2011 9:04 pm

Force Reinitialize dynamic body

Post by wh1sp3r »

Hello,

I successfully integrated physics into my project.
I am using MotionState to update visual objects in the scene as it's on bullet wiki webpage.

When rigid body is created, getWorldTransform is called and take my transformation matrix.
Every update ,setWorldTransform is called to update my visual objects.

My question is. Is there a way, how to tell to the rigid body to call getWorldTransform again?
Thank you
wh1sp3r
Posts: 4
Joined: Fri Sep 16, 2011 9:04 pm

Re: Force Reinitialize dynamic body

Post by wh1sp3r »

It seems, there is no such a function, i just search everywhere so i did own function.

I added to btRidigBody.h

Code: Select all

	
void    UpdateMotionState()
{
	if (m_optionalMotionState) m_optionalMotionState->getWorldTransform(m_worldTransform);
}
and it's simple and clean :)