I have a problem in rotation a rigid body.
There is a Ogre::sceneNode and a rigidBody.
Ogre object is a sphere and rigidBody is jast a sphere too, created in the same position.
Everything is ok, but now I need to apply Ogre::SceneNode rotation to bullet rigidBody, because without it applyCentralImpulse makes sphere fly in one direction.
I found a solution - make btQuaternion, set rotation of the transform and set the center of mass transform of the rigid body.
But I can't connect Ogre Quaternion and btQuaternion

I tried this:
Code: Select all
btTransform;
tr.setIdentity();
btQuaternion quat;
const btScalar yaw = (sceneNode->getOrientation()).getYaw().valueRadians();
const btScalar pitch = (sceneNode->getOrientation()).getPitch().valueRadians();
const btScalar roll = (sceneNode->getOrientation()).getRoll().valueRadians();
quat.setEuler(yaw,pitch,roll);
tr.setRotation(quat);
rigidBody->setCenterOfMassTransform(tr);
My question - how can I rotate rigid body due to rotation sceneNode?
Any help will be appreciated.