BEPUphysics.Paths.PathFollowing.EntityRotator.GetAngularVelocity C# (CSharp) Метод

GetAngularVelocity() публичный статический Метод

Gets the angular velocity necessary to change an entity's orientation from the starting quaternion to the ending quaternion over time dt.
public static GetAngularVelocity ( Microsoft.Xna.Framework.Quaternion start, Microsoft.Xna.Framework.Quaternion end, float dt ) : Vector3
start Microsoft.Xna.Framework.Quaternion Initial orientation.
end Microsoft.Xna.Framework.Quaternion Final orientation.
dt float Time over which the angular velocity is to be applied.
Результат Vector3
        public static Vector3 GetAngularVelocity(Quaternion start, Quaternion end, float dt)
        {
            //Compute the relative orientation R' between R and the target relative orientation.
            Quaternion errorOrientation;
            Quaternion.Conjugate(ref start, out errorOrientation);
            Quaternion.Multiply(ref end, ref errorOrientation, out errorOrientation);

            Vector3 axis;
            float angle;
            //Turn this into an axis-angle representation.
            Toolbox.GetAxisAngleFromQuaternion(ref errorOrientation, out axis, out angle);
            Vector3.Multiply(ref axis, angle / dt, out axis);
            return axis;
        }