Page 1 of 1

Angular Velocity from WorldTransform

Posted: Mon Oct 24, 2011 9:51 pm
by ntd master
Hey Guys,

Is there a good way to extract rotation data from a WorldTransform, so that I could apply it to an entity's angular velocity?

Re: Angular Velocity from WorldTransform

Posted: Mon Oct 24, 2011 11:37 pm
by Norbo
The upper left 3x3 component of an entity's WorldTransform is the same value as in the entity's OrientationMatrix, which is in turn the matrix format of the entity's Orientation quaternion. You can indeed compute a rotation between two orientations and convert that to an angular velocity given some time.

The built-in convenience class EntityRotator uses this approach to follow orientation goals. The static method EntityRotator.GetAngularVelocity can be used directly.

The EntityRotator computes velocities using that method when operating on kinematic entities, and uses a SingleEntityAngularMotor for dynamic entities.

Re: Angular Velocity from WorldTransform

Posted: Tue Oct 25, 2011 12:08 am
by ntd master
Ah, cool. It sounds like EntityRotator may be just what I was looking for.