Quaternion Structure

Defines a four-dimensional vector (x,y,z,w), which is used to efficiently rotate an object about the (x, y, z) vector by the angle theta, where w = cos(theta/2).

Namespace:  Microsoft.Xna.Framework
Assembly:  Microsoft.Xna.Framework.Math (in Microsoft.Xna.Framework.Math.dll)

public struct Quaternion

The Quaternion type exposes the following members.

  NameDescription
Public methodQuaternion(Vector3, Single)Initializes a new instance of Quaternion.
Public methodQuaternion(Single, Single, Single, Single)Initializes a new instance of Quaternion.
Top

  NameDescription
Public propertyStatic memberIdentityReturns a Quaternion representing no rotation.
Top

  NameDescription
Public methodStatic memberAdd(Quaternion, Quaternion)Adds two Quaternion instances.
Public methodStatic memberAdd(Quaternion, Quaternion, Quaternion)Adds two Quaternion instances.
Public methodStatic memberConcatenate(Quaternion, Quaternion)Concatenates two Quaternion instances; the result represents the value1 rotation followed by the value2 rotation.
Public methodStatic memberConcatenate(Quaternion, Quaternion, Quaternion)Concatenates two Quaternion instances; the result represents the value1 rotation followed by the value2 rotation.
Public methodConjugate()Transforms this Quaternion into its conjugate.
Public methodStatic memberConjugate(Quaternion)Returns the conjugate of a specified Quaternion.
Public methodStatic memberConjugate(Quaternion, Quaternion)Returns the conjugate of a specified Quaternion.
Public methodStatic memberCreateFromAxisAngle(Vector3, Single)Creates a Quaternion from a vector and an angle to rotate about the vector.
Public methodStatic memberCreateFromAxisAngle(Vector3, Single, Quaternion)Creates a Quaternion from a vector and an angle to rotate about the vector.
Public methodStatic memberCreateFromRotationMatrix(Matrix)Creates a Quaternion from a rotation Matrix.
Public methodStatic memberCreateFromRotationMatrix(Matrix, Quaternion)Creates a Quaternion from a rotation Matrix.
Public methodStatic memberCreateFromYawPitchRoll(Single, Single, Single)Creates a new Quaternion from specified yaw, pitch, and roll angles.
Public methodStatic memberCreateFromYawPitchRoll(Single, Single, Single, Quaternion)Creates a new Quaternion from specified yaw, pitch, and roll angles.
Public methodStatic memberDivide(Quaternion, Quaternion)Divides a Quaternion by another Quaternion.
Public methodStatic memberDivide(Quaternion, Quaternion, Quaternion)Divides a Quaternion by another Quaternion.
Public methodStatic memberDot(Quaternion, Quaternion)Calculates the dot product of two Quaternion instances.
Public methodStatic memberDot(Quaternion, Quaternion, Single)Calculates the dot product of two Quaternion instances.
Public methodEquals(Object)Returns a value that indicates whether the current instance is equal to a specified object. (Overrides ValueType.Equals(Object).)
Public methodEquals(Quaternion)Determines whether the specified Object is equal to the Quaternion.
Public methodGetHashCodeGet the hash code of this object. (Overrides ValueType.GetHashCode().)
Public methodStatic memberInverse(Quaternion)Returns the inverse of a Quaternion.
Public methodStatic memberInverse(Quaternion, Quaternion)Returns the inverse of a Quaternion.
Public methodLengthCalculates the length of a Quaternion.
Public methodLengthSquaredCalculates the length squared of a Quaternion.
Public methodStatic memberLerp(Quaternion, Quaternion, Single)Linearly interpolates between two Quaternion instances.
Public methodStatic memberLerp(Quaternion, Quaternion, Single, Quaternion)Linearly interpolates between two Quaternion instances.
Public methodStatic memberMultiply(Quaternion, Quaternion)Multiplies two Quaternion instances.
Public methodStatic memberMultiply(Quaternion, Single)Multiplies a Quaternion by a scalar value.
Public methodStatic memberMultiply(Quaternion, Quaternion, Quaternion)Multiplies two Quaternion instances.
Public methodStatic memberMultiply(Quaternion, Single, Quaternion)Multiplies a Quaternion by a scalar value.
Public methodStatic memberNegate(Quaternion)Flips the sign of each component of the Quaternion.
Public methodStatic memberNegate(Quaternion, Quaternion)Flips the sign of each component of the Quaternion.
Public methodNormalize()Divides each component of a Quaternion by the length of the Quaternion.
Public methodStatic memberNormalize(Quaternion)Divides each component of a Quaternion by the length of the Quaternion.
Public methodStatic memberNormalize(Quaternion, Quaternion)Divides each component of a Quaternion by the length of the Quaternion.
Public methodStatic memberSlerp(Quaternion, Quaternion, Single)Interpolates between two Quaternion instances, using spherical linear interpolation.
Public methodStatic memberSlerp(Quaternion, Quaternion, Single, Quaternion)Interpolates between two Quaternion instances, using spherical linear interpolation.
Public methodStatic memberSubtract(Quaternion, Quaternion)Subtracts a Quaternion from another Quaternion.
Public methodStatic memberSubtract(Quaternion, Quaternion, Quaternion)Subtracts a Quaternion from another Quaternion.
Public methodToStringRetrieves a string representation of the current object. (Overrides ValueType.ToString().)
Top

  NameDescription
Public operatorStatic memberAdditionAdds two Quaternion instances.
Public operatorStatic memberDivisionDivides a Quaternion by another Quaternion.
Public operatorStatic memberEqualityCompares two Quaternion instances for equality.
Public operatorStatic memberInequalityCompare two Quaternion instances for inequality.
Public operatorStatic memberMultiply(Quaternion, Quaternion)Multiplies two Quaternion instances.
Public operatorStatic memberMultiply(Quaternion, Single)Multiplies a Quaternion by a scalar value.
Public operatorStatic memberSubtractionSubtracts a Quaternion from another Quaternion.
Public operatorStatic memberUnaryNegationFlips the sign of each component of the Quaternion.
Top

  NameDescription
Public fieldWSpecifies the rotation component of the Quaternion.
Public fieldXSpecifies the x-value of the vector component of the Quaternion.
Public fieldYSpecifies the y-value of the vector component of the Quaternion.
Public fieldZSpecifies the z-value of the vector component of the Quaternion.
Top

Quaternion instances represent a rotation. Typically, they are used for smooth interpolation between two angles, and for avoiding the gimbal lock problem that can occur with euler angles.

Silverlight

Supported in: 5

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Community Additions

ADD
Show: