as you can unserstand from topic, I have a sphere ball and I apply torque to this ball, so the ball rotates and moves. I have a mesh in Irrlicht and how can I rotate this mesh, even apply world transform matrix..
To be more clear: I initiate Bullet physics and add a sphere rigid body. And I got World Transform in each frame, and I would like to apply this transform (rotation and position) to my irrlicht mesh... Bullet uses Quaternions for rotation.. How do you deal with this?
I tried smt like:
Code: Select all
btTransform transformTop = rigidBodyTop->getWorldTransform();
btVector3 posTop = transformTop.getOrigin();
nodeTop->setPosition(core::vector3df(posTop.x(), posTop.y(), posTop.z()));
btQuaternion rotTop = transformTop.getRotation();
core::vector3df rotEulerTop;
nodeTop->setRotation(QuaternionToEuler(rotTop, rotEulerTop));
Thank you...