Limits on rotation; revert orientation when falling

ciphr
Posts: 15
Joined: Mon Mar 28, 2011 9:11 am

Limits on rotation; revert orientation when falling

Post by ciphr »

Hello,
I have a cartoon-like rat (btRigidBody/btCompoundShape), and I want to limit orientation by X to some range. Rotation along Y is applied with setAngularVelocity().
Q1: What is the easiest way to do this? If answer is use a constraint, then do I need the dummy rb, and how is best to update dummy's translation - manually or using another (the same?) constraint?
When the rat is falling (I already can approximately detect falling), I want to reset orientation by X to 0, like cats do, landing on legs :)
Q2: Is there a way to smoothly reset orientation?
Thanks in advance, Igor