RotationalAxisConstraint equivalent
-
- Posts: 6
- Joined: Thu Dec 10, 2009 4:08 pm
RotationalAxisConstraint equivalent
I just updated to a newer version of BEPU Physics, looks like alot has changed since the last project. Is there equivalent to the RotationalAxisConstraint? I don't see that constraint anywhere anymore.
Re: RotationalAxisConstraint equivalent
I actually can't quite remember what that constraint did. If that was the one which restricted an entity's angular motion around a given axis, then a RevoluteMotor would do the trick. The RevoluteMotor is a two-body constraint, but you can pass in null for one of the connections and it will attach to the 'world' entity.
If you want to prevent an entity from rotating at all around one or more of its angular axes, setting the LocalInertiaTensorInverse's corresponding rows to zeroes is easiest. The first row is the local X axis, the second row is the local Y axis, and the third row is the local Z axis. You can set all of them to zero if you want.
There's also a SingleEntityAngularMotor which controls all three angular degrees of freedom.
If you want to prevent an entity from rotating at all around one or more of its angular axes, setting the LocalInertiaTensorInverse's corresponding rows to zeroes is easiest. The first row is the local X axis, the second row is the local Y axis, and the third row is the local Z axis. You can set all of them to zero if you want.
There's also a SingleEntityAngularMotor which controls all three angular degrees of freedom.