Quaternion

struct Quaternion : System.ValueType, System.IEquatable<Quaternion>

An efficient mathematical representation for three dimensional rotations.

float X

The x coordinate of this T:Microsoft.Xna.Framework.Quaternion.

float Y

The y coordinate of this T:Microsoft.Xna.Framework.Quaternion.

float Z

The z coordinate of this T:Microsoft.Xna.Framework.Quaternion.

float W

The rotation component of this T:Microsoft.Xna.Framework.Quaternion.

readonly Quaternion Identity

Returns a quaternion representing no rotation.

string get_DebugDisplayString()
Quaternion Add(Quaternion quaternion1, Quaternion quaternion2)

Creates a new T:Microsoft.Xna.Framework.Quaternion that contains the sum of two quaternions.

Parameters:
  • quaternion1 (Microsoft.Xna.Framework.Quaternion) – Source T:Microsoft.Xna.Framework.Quaternion.
  • quaternion2 (Microsoft.Xna.Framework.Quaternion) – Source T:Microsoft.Xna.Framework.Quaternion.
Returns:

The result of the quaternion addition.

void Add(ref Quaternion quaternion1, ref Quaternion quaternion2, ref Quaternion result)
Parameters:
  • (ref) quaternion1 (Microsoft.Xna.Framework.Quaternion) –
  • (ref) quaternion2 (Microsoft.Xna.Framework.Quaternion) –
  • (ref) result (Microsoft.Xna.Framework.Quaternion) –
Quaternion Concatenate(Quaternion value1, Quaternion value2)

Creates a new T:Microsoft.Xna.Framework.Quaternion that contains concatenation between two quaternion.

Parameters:
  • value1 (Microsoft.Xna.Framework.Quaternion) – The first T:Microsoft.Xna.Framework.Quaternion to concatenate.
  • value2 (Microsoft.Xna.Framework.Quaternion) – The second T:Microsoft.Xna.Framework.Quaternion to concatenate.
Returns:

The result of rotation of followed by rotation.

void Concatenate(ref Quaternion value1, ref Quaternion value2, ref Quaternion result)
Parameters:
  • (ref) value1 (Microsoft.Xna.Framework.Quaternion) –
  • (ref) value2 (Microsoft.Xna.Framework.Quaternion) –
  • (ref) result (Microsoft.Xna.Framework.Quaternion) –
void Conjugate()

Transforms this quaternion into its conjugated version.

Quaternion Conjugate(Quaternion value)

Creates a new T:Microsoft.Xna.Framework.Quaternion that contains conjugated version of the specified quaternion.

Parameters:
  • value (Microsoft.Xna.Framework.Quaternion) – The quaternion which values will be used to create the conjugated version.
Returns:

The conjugate version of the specified quaternion.

void Conjugate(ref Quaternion value, ref Quaternion result)
Parameters:
  • (ref) value (Microsoft.Xna.Framework.Quaternion) –
  • (ref) result (Microsoft.Xna.Framework.Quaternion) –
Quaternion CreateFromAxisAngle(Vector3 axis, float angle)

Creates a new T:Microsoft.Xna.Framework.Quaternion from the specified axis and angle.

Parameters:
  • axis (Microsoft.Xna.Framework.Vector3) – The axis of rotation.
  • angle (float) – The angle in radians.
Returns:

The new quaternion builded from axis and angle.

void CreateFromAxisAngle(ref Vector3 axis, float angle, ref Quaternion result)
Parameters:
  • (ref) axis (Microsoft.Xna.Framework.Vector3) –
  • angle (float) –
  • (ref) result (Microsoft.Xna.Framework.Quaternion) –
Quaternion CreateFromRotationMatrix(Matrix matrix)

Creates a new T:Microsoft.Xna.Framework.Quaternion from the specified T:Microsoft.Xna.Framework.Matrix.

Parameters:
  • matrix (Microsoft.Xna.Framework.Matrix) – The rotation matrix.
Returns:

A quaternion composed from the rotation part of the matrix.

void CreateFromRotationMatrix(ref Matrix matrix, ref Quaternion result)
Parameters:
  • (ref) matrix (Microsoft.Xna.Framework.Matrix) –
  • (ref) result (Microsoft.Xna.Framework.Quaternion) –
Quaternion CreateFromYawPitchRoll(float yaw, float pitch, float roll)

Creates a new T:Microsoft.Xna.Framework.Quaternion from the specified yaw, pitch and roll angles.

Parameters:
  • yaw (float) – Yaw around the y axis in radians.
  • pitch (float) – Pitch around the x axis in radians.
  • roll (float) – Roll around the z axis in radians.
Returns:

A new quaternion from the concatenated yaw, pitch, and roll angles.

void CreateFromYawPitchRoll(float yaw, float pitch, float roll, ref Quaternion result)
Parameters:
  • yaw (float) –
  • pitch (float) –
  • roll (float) –
  • (ref) result (Microsoft.Xna.Framework.Quaternion) –
Quaternion Divide(Quaternion quaternion1, Quaternion quaternion2)

Divides a T:Microsoft.Xna.Framework.Quaternion by the other T:Microsoft.Xna.Framework.Quaternion.

Parameters:
  • quaternion1 (Microsoft.Xna.Framework.Quaternion) – Source T:Microsoft.Xna.Framework.Quaternion.
  • quaternion2 (Microsoft.Xna.Framework.Quaternion) – Divisor T:Microsoft.Xna.Framework.Quaternion.
Returns:

The result of dividing the quaternions.

void Divide(ref Quaternion quaternion1, ref Quaternion quaternion2, ref Quaternion result)
Parameters:
  • (ref) quaternion1 (Microsoft.Xna.Framework.Quaternion) –
  • (ref) quaternion2 (Microsoft.Xna.Framework.Quaternion) –
  • (ref) result (Microsoft.Xna.Framework.Quaternion) –
float Dot(Quaternion quaternion1, Quaternion quaternion2)

Returns a dot product of two quaternions.

Parameters:
  • quaternion1 (Microsoft.Xna.Framework.Quaternion) – The first quaternion.
  • quaternion2 (Microsoft.Xna.Framework.Quaternion) – The second quaternion.
Returns:

The dot product of two quaternions.

void Dot(ref Quaternion quaternion1, ref Quaternion quaternion2, ref float result)
Parameters:
  • (ref) quaternion1 (Microsoft.Xna.Framework.Quaternion) –
  • (ref) quaternion2 (Microsoft.Xna.Framework.Quaternion) –
  • (ref) result (float) –
bool Equals(System.Object obj)

Compares whether current instance is equal to specified T:System.Object.

Parameters:
  • obj (System.Object) – The T:System.Object to compare.
Returns:

true if the instances are equal; false otherwise.

bool Equals(Quaternion other)

Compares whether current instance is equal to specified T:Microsoft.Xna.Framework.Quaternion.

Parameters:
  • other (Microsoft.Xna.Framework.Quaternion) – The T:Microsoft.Xna.Framework.Quaternion to compare.
Returns:

true if the instances are equal; false otherwise.

int GetHashCode()

Gets the hash code of this T:Microsoft.Xna.Framework.Quaternion.

Returns:Hash code of this T:Microsoft.Xna.Framework.Quaternion.
Quaternion Inverse(Quaternion quaternion)

Returns the inverse quaternion which represents the opposite rotation.

Parameters:
  • quaternion (Microsoft.Xna.Framework.Quaternion) – Source T:Microsoft.Xna.Framework.Quaternion.
Returns:

The inverse quaternion.

void Inverse(ref Quaternion quaternion, ref Quaternion result)
Parameters:
  • (ref) quaternion (Microsoft.Xna.Framework.Quaternion) –
  • (ref) result (Microsoft.Xna.Framework.Quaternion) –
float Length()

Returns the magnitude of the quaternion components.

Returns:The magnitude of the quaternion components.
float LengthSquared()

Returns the squared magnitude of the quaternion components.

Returns:The squared magnitude of the quaternion components.
Quaternion Lerp(Quaternion quaternion1, Quaternion quaternion2, float amount)

Performs a linear blend between two quaternions.

Parameters:
  • quaternion1 (Microsoft.Xna.Framework.Quaternion) – Source T:Microsoft.Xna.Framework.Quaternion.
  • quaternion2 (Microsoft.Xna.Framework.Quaternion) – Source T:Microsoft.Xna.Framework.Quaternion.
  • amount (float) – The blend amount where 0 returns and 1 .
Returns:

The result of linear blending between two quaternions.

void Lerp(ref Quaternion quaternion1, ref Quaternion quaternion2, float amount, ref Quaternion result)
Parameters:
  • (ref) quaternion1 (Microsoft.Xna.Framework.Quaternion) –
  • (ref) quaternion2 (Microsoft.Xna.Framework.Quaternion) –
  • amount (float) –
  • (ref) result (Microsoft.Xna.Framework.Quaternion) –
Quaternion Slerp(Quaternion quaternion1, Quaternion quaternion2, float amount)

Performs a spherical linear blend between two quaternions.

Parameters:
  • quaternion1 (Microsoft.Xna.Framework.Quaternion) – Source T:Microsoft.Xna.Framework.Quaternion.
  • quaternion2 (Microsoft.Xna.Framework.Quaternion) – Source T:Microsoft.Xna.Framework.Quaternion.
  • amount (float) – The blend amount where 0 returns and 1 .
Returns:

The result of spherical linear blending between two quaternions.

void Slerp(ref Quaternion quaternion1, ref Quaternion quaternion2, float amount, ref Quaternion result)
Parameters:
  • (ref) quaternion1 (Microsoft.Xna.Framework.Quaternion) –
  • (ref) quaternion2 (Microsoft.Xna.Framework.Quaternion) –
  • amount (float) –
  • (ref) result (Microsoft.Xna.Framework.Quaternion) –
Quaternion Subtract(Quaternion quaternion1, Quaternion quaternion2)

Creates a new T:Microsoft.Xna.Framework.Quaternion that contains subtraction of one T:Microsoft.Xna.Framework.Quaternion from another.

Parameters:
  • quaternion1 (Microsoft.Xna.Framework.Quaternion) – Source T:Microsoft.Xna.Framework.Quaternion.
  • quaternion2 (Microsoft.Xna.Framework.Quaternion) – Source T:Microsoft.Xna.Framework.Quaternion.
Returns:

The result of the quaternion subtraction.

void Subtract(ref Quaternion quaternion1, ref Quaternion quaternion2, ref Quaternion result)
Parameters:
  • (ref) quaternion1 (Microsoft.Xna.Framework.Quaternion) –
  • (ref) quaternion2 (Microsoft.Xna.Framework.Quaternion) –
  • (ref) result (Microsoft.Xna.Framework.Quaternion) –
Quaternion Multiply(Quaternion quaternion1, Quaternion quaternion2)

Creates a new T:Microsoft.Xna.Framework.Quaternion that contains a multiplication of two quaternions.

Parameters:
  • quaternion1 (Microsoft.Xna.Framework.Quaternion) – Source T:Microsoft.Xna.Framework.Quaternion.
  • quaternion2 (Microsoft.Xna.Framework.Quaternion) – Source T:Microsoft.Xna.Framework.Quaternion.
Returns:

The result of the quaternion multiplication.

Quaternion Multiply(Quaternion quaternion1, float scaleFactor)

Creates a new T:Microsoft.Xna.Framework.Quaternion that contains a multiplication of T:Microsoft.Xna.Framework.Quaternion and a scalar.

Parameters:
  • quaternion1 (Microsoft.Xna.Framework.Quaternion) – Source T:Microsoft.Xna.Framework.Quaternion.
  • scaleFactor (float) – Scalar value.
Returns:

The result of the quaternion multiplication with a scalar.

void Multiply(ref Quaternion quaternion1, float scaleFactor, ref Quaternion result)
Parameters:
  • (ref) quaternion1 (Microsoft.Xna.Framework.Quaternion) –
  • scaleFactor (float) –
  • (ref) result (Microsoft.Xna.Framework.Quaternion) –
void Multiply(ref Quaternion quaternion1, ref Quaternion quaternion2, ref Quaternion result)
Parameters:
  • (ref) quaternion1 (Microsoft.Xna.Framework.Quaternion) –
  • (ref) quaternion2 (Microsoft.Xna.Framework.Quaternion) –
  • (ref) result (Microsoft.Xna.Framework.Quaternion) –
Quaternion Negate(Quaternion quaternion)

Flips the sign of the all the quaternion components.

Parameters:
  • quaternion (Microsoft.Xna.Framework.Quaternion) – Source T:Microsoft.Xna.Framework.Quaternion.
Returns:

The result of the quaternion negation.

void Negate(ref Quaternion quaternion, ref Quaternion result)
Parameters:
  • (ref) quaternion (Microsoft.Xna.Framework.Quaternion) –
  • (ref) result (Microsoft.Xna.Framework.Quaternion) –
void Normalize()

Scales the quaternion magnitude to unit length.

Quaternion Normalize(Quaternion quaternion)

Scales the quaternion magnitude to unit length.

Parameters:
  • quaternion (Microsoft.Xna.Framework.Quaternion) – Source T:Microsoft.Xna.Framework.Quaternion.
Returns:

The unit length quaternion.

void Normalize(ref Quaternion quaternion, ref Quaternion result)
Parameters:
  • (ref) quaternion (Microsoft.Xna.Framework.Quaternion) –
  • (ref) result (Microsoft.Xna.Framework.Quaternion) –
string ToString()

Returns a T:System.String representation of this T:Microsoft.Xna.Framework.Quaternion in the format: {X:[F:Microsoft.Xna.Framework.Quaternion.X] Y:[F:Microsoft.Xna.Framework.Quaternion.Y] Z:[F:Microsoft.Xna.Framework.Quaternion.Z] W:[F:Microsoft.Xna.Framework.Quaternion.W]}

Returns:A T:System.String representation of this T:Microsoft.Xna.Framework.Quaternion.
Vector4 ToVector4()

Gets a T:Microsoft.Xna.Framework.Vector4 representation for this object.

Returns:A T:Microsoft.Xna.Framework.Vector4 representation for this object.
Quaternion op_Addition(Quaternion quaternion1, Quaternion quaternion2)

Adds two quaternions.

Parameters:
  • quaternion1 (Microsoft.Xna.Framework.Quaternion) – Source T:Microsoft.Xna.Framework.Quaternion on the left of the add sign.
  • quaternion2 (Microsoft.Xna.Framework.Quaternion) – Source T:Microsoft.Xna.Framework.Quaternion on the right of the add sign.
Returns:

Sum of the vectors.

Quaternion op_Division(Quaternion quaternion1, Quaternion quaternion2)

Divides a T:Microsoft.Xna.Framework.Quaternion by the other T:Microsoft.Xna.Framework.Quaternion.

Parameters:
  • quaternion1 (Microsoft.Xna.Framework.Quaternion) – Source T:Microsoft.Xna.Framework.Quaternion on the left of the div sign.
  • quaternion2 (Microsoft.Xna.Framework.Quaternion) – Divisor T:Microsoft.Xna.Framework.Quaternion on the right of the div sign.
Returns:

The result of dividing the quaternions.

bool op_Equality(Quaternion quaternion1, Quaternion quaternion2)

Compares whether two T:Microsoft.Xna.Framework.Quaternion instances are equal.

Parameters:
  • quaternion1 (Microsoft.Xna.Framework.Quaternion) – T:Microsoft.Xna.Framework.Quaternion instance on the left of the equal sign.
  • quaternion2 (Microsoft.Xna.Framework.Quaternion) – T:Microsoft.Xna.Framework.Quaternion instance on the right of the equal sign.
Returns:

true if the instances are equal; false otherwise.

bool op_Inequality(Quaternion quaternion1, Quaternion quaternion2)

Compares whether two T:Microsoft.Xna.Framework.Quaternion instances are not equal.

Parameters:
  • quaternion1 (Microsoft.Xna.Framework.Quaternion) – T:Microsoft.Xna.Framework.Quaternion instance on the left of the not equal sign.
  • quaternion2 (Microsoft.Xna.Framework.Quaternion) – T:Microsoft.Xna.Framework.Quaternion instance on the right of the not equal sign.
Returns:

true if the instances are not equal; false otherwise.

Quaternion op_Multiply(Quaternion quaternion1, Quaternion quaternion2)

Multiplies two quaternions.

Parameters:
  • quaternion1 (Microsoft.Xna.Framework.Quaternion) – Source T:Microsoft.Xna.Framework.Quaternion on the left of the mul sign.
  • quaternion2 (Microsoft.Xna.Framework.Quaternion) – Source T:Microsoft.Xna.Framework.Quaternion on the right of the mul sign.
Returns:

Result of the quaternions multiplication.

Quaternion op_Multiply(Quaternion quaternion1, float scaleFactor)

Multiplies the components of quaternion by a scalar.

Parameters:
  • quaternion1 (Microsoft.Xna.Framework.Quaternion) – Source T:Microsoft.Xna.Framework.Vector3 on the left of the mul sign.
  • scaleFactor (float) – Scalar value on the right of the mul sign.
Returns:

Result of the quaternion multiplication with a scalar.

Quaternion op_Subtraction(Quaternion quaternion1, Quaternion quaternion2)

Subtracts a T:Microsoft.Xna.Framework.Quaternion from a T:Microsoft.Xna.Framework.Quaternion.

Parameters:
  • quaternion1 (Microsoft.Xna.Framework.Quaternion) – Source T:Microsoft.Xna.Framework.Vector3 on the left of the sub sign.
  • quaternion2 (Microsoft.Xna.Framework.Quaternion) – Source T:Microsoft.Xna.Framework.Vector3 on the right of the sub sign.
Returns:

Result of the quaternion subtraction.

Quaternion op_UnaryNegation(Quaternion quaternion)

Flips the sign of the all the quaternion components.

Parameters:
  • quaternion (Microsoft.Xna.Framework.Quaternion) – Source T:Microsoft.Xna.Framework.Quaternion on the right of the sub sign.
Returns:

The result of the quaternion negation.