Limiting Rigid Body Rotation around an axis #304
-
Hey, all I'm currently working on a personal project which includes vehicles which can collide with each other. This all works fine, except that I would like to restrict the amount of rotation they can experience along a given axis. For example, I would like to prevent either vehicle from flipping over. I saw that there's a flag which can be used to prevent rotation around an axis (specifically, the PxRigidDynamicLockFlag), but that prevents ALL movement along said axis, where I would like to limit it (e.g. to a maximum of 20 degrees along the x-axis). I'm also aware of the existence of joints, but that feels a bit like an awkward solution, so I wanted to see whether any other mechanism exists for achieving my goal. Thank you for any help! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @TheWandererSage |
Beta Was this translation helpful? Give feedback.
Hi @TheWandererSage
As I understand it, this PxRigidDynamicLockFlag is rather for making a kind of 2D simulation by locking the extra linear and angular DOFs.
To implement some soft limits for your vehicle position and orientation, you'll use joints or apply some force/torque to the vehicle body manually. Both approaches are fine.