Hello.
I want to make a character using a capsule.
I can make the capsule but it always falls over.
Is there anyway to prevent a body from rotating?
Thanks in advance, Jesse.
Btw nice physics engine. Good to see one for C#
Prevent Rotation
Re: Prevent Rotation
You can restrict the rotation of a body around a given axis by setting the corresponding row in the local inertia tensor inverse to zero. For example if you set the first row to 0's, the object will no longer rotate around the local x axis. If you set the entire local inverse inertia tensor to zeroes, it will no longer rotate. This can be set by using the (Entity).localInertiaTensorInverse field.
Another option is to use the UprightConstraint, which is a little more 'wobbly.' There's also a RotationalAxisConstraint.
Thanks for trying it out!
Another option is to use the UprightConstraint, which is a little more 'wobbly.' There's also a RotationalAxisConstraint.
Thanks for trying it out!