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?
Angular Velocity from WorldTransform
-
- Posts: 10
- Joined: Wed Nov 24, 2010 9:29 pm
- Location: United States
- Contact:
Re: Angular Velocity from WorldTransform
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.
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.
-
- Posts: 10
- Joined: Wed Nov 24, 2010 9:29 pm
- Location: United States
- Contact:
Re: Angular Velocity from WorldTransform
Ah, cool. It sounds like EntityRotator may be just what I was looking for.