[SOLVED] Prevent rotation for a single object

Hieran_Del8
Posts: 11
Joined: Mon Nov 12, 2012 3:20 pm

[SOLVED] Prevent rotation for a single object

Post by Hieran_Del8 »

I'm trying to get an object to resist rotating at all, unless I specify a rotation in the world transform. Would I use the btRigidBody::setAngularFactor(), or set the inverse inertial tensor to 0, or something else? I tried using setAngularFactor(), but that didn't seem to affect the object at all (I think it would have had an undesirable appearance anyway). I didn't want to effect the inertial tensor, thinking that'd affect linear accelerations, but maybe it'd be ok...

Any pointers would be appreciated.

EDIT 11/21/12:
Solved by the second post, due to overloading derpiness.
Last edited by Hieran_Del8 on Wed Nov 21, 2012 4:09 pm, edited 1 time in total.
Hieran_Del8
Posts: 11
Joined: Mon Nov 12, 2012 3:20 pm

Re: Prevent rotation for a single object

Post by Hieran_Del8 »

Crikey! I overloaded a creation function and was calling the wrong one to test it....

I liked the way the object reacted with an inverted inertial tensor vector of zero and updating the inertial tensor, better than the setAngularFactor. Obviously, a physical object will not react that way, but it's easier to steer a ship when it's pointing exactly where you remember it pointing.