I have a very simple question about integrating Bullet into my software. I have inhereted the btMotionState class and added my necessary data. My question is, what is the best way to translate Bullet's position and orientation data into my graphics sub-system?
I noticed that the btTransform class (m_graphicsWorldTrans in the btMotionState class) has a getOpenGLMatrix() function, which is nice, but doesn't help me as I am not using OpenGL directly for gfx rendering. Can I simply use m_graphicsWorldTrans.getRotation() and m_graphicsWorldTrans.getOrigin()?
Will something like this work?
Code: Select all
btVector3 origin = m_graphicsWorldTrans.getOrigin();
btQuaternion rot = m_graphicsWorldTrans.getRotation();
node->setPosition( origin.x(), origin.y(), origin.z() );
node->setOrientation( rot.w(), rot.x(), rot.y(), rot.z() );