Angular Velocity from WorldTransform

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
ntd master
Posts: 10
Joined: Wed Nov 24, 2010 9:29 pm
Location: United States
Contact:

Angular Velocity from WorldTransform

Post 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?
Follow on Twitter: Vulture Games
Official Website: Vulture Games Studio, LLC
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Angular Velocity from WorldTransform

Post 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.
ntd master
Posts: 10
Joined: Wed Nov 24, 2010 9:29 pm
Location: United States
Contact:

Re: Angular Velocity from WorldTransform

Post by ntd master »

Ah, cool. It sounds like EntityRotator may be just what I was looking for.
Follow on Twitter: Vulture Games
Official Website: Vulture Games Studio, LLC
Post Reply