How to rotate an object?

FireSoul

04-07-2006 03:18:03

Hi, I would like to know how you can rotate an object in OgreNewt, I have tried a few methods but they turned out to be wrong, so could someone explain to me how to rotate an object (or just tell me the function).

Thanks for any replies.

Ryan.

Buckcherry

04-07-2006 08:09:14

mBody->setPositionOrientation(pos, quat);

Being pos the actual position of the body and quat the Quaternion which defines your rotation.

OvermindDL1

05-07-2006 17:43:55

That will set it directly, which you should never really do unless you are *just* setting it up. I apply a local force at a 90 degree angle set some odd distance from the center of the object to rotate it, works like a charm.

walaber

05-07-2006 19:37:09

the "best" way is to add Torque to the object in the ForceandTorqueCalblack.

another way is to use setOmega() to set the rotational velocity directly.