Firstly i'd like to tell you that I'm not english so please excuse me for the language mistakes I'll surely make and I'm also new to bullet so sorry if those questions look stupid to you...
I'm doing a maze like that http://www.clubic.com/telecharger-fiche ... -lite.html
For the playing field I've made many btBoxShape that are Kinematics (I've checked it) .
At the begining the ball falls on the plate without any problems (it even bounces a little). But when I want to move my field it happens to different things:
- when I use btRigidBody::proceedTransform(btTransform)
the ball just fall whatever the angle of rotation is... and the rendered scene (openGL) doesn't refresh at all...
- when I use btRigidBody::getMotionState()->setWorldTransform(btTransform)
the rendered scene updates perfectly but the ball doesn't move at all...
I think I didn't understand everything about the difference between proceedTransform and setWorldTransform... Could you please explain it to me?
Here are the two functions that may interest you:
Code: Select all
void Objet::addMatrix(const btScalar* _m)// function called when we add a new transform
{
btTransform tmp;
tmp.setFromOpenGLMatrix(_m);
//we get the current matrix
m_RigidBody->getMotionState()->getWorldTransform(*m_Transfo);
//add the new transform
(*m_Transfo)*=tmp;
//update bullet with this new transform
m_RigidBody->getMotionState()->setWorldTransform(*m_Transfo);
//m_RigidBody->proceedToTransform(*m_Transfo);
//m_RigidBody->activate(true);
}
void Objet::getMatrix(btScalar* _m) const// function called to get the transform matrix for drawing the scene
{
m_RigidBody->getMotionState()->getWorldTransform(*m_Transfo);
m_Transfo->getOpenGLMatrix(_m);
}
Thank you