Beispiel #1
0
        /// <summary>
        /// Build a rotation matrix from a quaternion.
        /// </summary>
        /// <param name="rotation">A quaternion representation of the rotation.</param>
        /// <returns>A rotation matrix.</returns>
        public static Matrix4 Rotate(Quaternion rotation)
        {
            Vector4 axisangle = rotation.ToAxisAngle();

            return(CreateFromAxisAngle(new Vector3(axisangle.X, axisangle.Y, axisangle.Z), rotation.W));
        }
Beispiel #2
0
        /// <summary>
        /// Build a rotation matrix from a quaternion
        /// </summary>
        /// <param name="rotation">A quaternion representation of the rotation.</param>
        /// <returns>A rotation matrix</returns>
        public static Matrix4 Rotate(Quaternion rotation)
        {
            Vector4 axisangle = rotation.ToAxisAngle();

            return(CreateFromAxisAngle(axisangle.Xyz, rotation.w));
        }