How to keep object stay straight vertically (Roly-poly toy)?
Posted: Fri May 06, 2016 5:57 pm
Greetings.
I need to prevent vehicles from flipping over and also keep human characters stay vertically. But it should be "soft" so objects can shake in about +/- 30-degree away from vertical gravity axis due to hitting bumps or get impacts from other objects or something so it will look naturally. Note that gravity can change in particular world zones.
Here is illustration:
I plan to measure tilt angle between object and gravity direction and apply opposite torque proportional to this angle. Angular damping should reduce permanent oscillating.
It's good idea? Or Bullet has some kind of built-in functionlity to do it simplier? Maybe you know better solution?
And second question. I haven't started implement character yet, but it looks that btCharacterControllerInterface it not designed for custom gravity vectors, it is correct? So, I plan use capsule for character body and point-to-point-joined sphere as a "wheel" so character can walk (roll) on surfaces. What do you think, will it work? Or you know better scheme?
I need to prevent vehicles from flipping over and also keep human characters stay vertically. But it should be "soft" so objects can shake in about +/- 30-degree away from vertical gravity axis due to hitting bumps or get impacts from other objects or something so it will look naturally. Note that gravity can change in particular world zones.
Here is illustration:
I plan to measure tilt angle between object and gravity direction and apply opposite torque proportional to this angle. Angular damping should reduce permanent oscillating.
It's good idea? Or Bullet has some kind of built-in functionlity to do it simplier? Maybe you know better solution?
And second question. I haven't started implement character yet, but it looks that btCharacterControllerInterface it not designed for custom gravity vectors, it is correct? So, I plan use capsule for character body and point-to-point-joined sphere as a "wheel" so character can walk (roll) on surfaces. What do you think, will it work? Or you know better scheme?