Skip to content
This repository was archived by the owner on Dec 13, 2025. It is now read-only.

VRageMath.Quaternion

Malware edited this page May 4, 2019 · 54 revisions

IndexNamespace Index

Quaternion Struct

public struct Quaternion: IEquatable<VRageMath.Quaternion>

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: VRageMath
Assembly: VRage.Math.dll

Implements:

Fields

Member Description
X Specifies the x-value of the vector component of the quaternion.
Y Specifies the y-value of the vector component of the quaternion.
Z Specifies the z-value of the vector component of the quaternion.
W Specifies the rotation component of the quaternion.
Identity
Zero

Properties

Member Description
Forward
Right
Up

Constructors

Member Description
Quaternion(float, float, float, float)
Quaternion(Vector3, float)

Methods

Member Description
ToString() Retireves a string representation of the current object.
ToString(string)
ToStringAxisAngle(string)
Equals(Quaternion) Determines whether the specified Object is equal to the Quaternion.
Equals(Quaternion, float)
Equals(object) Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode() Get the hash code of this object.
LengthSquared() Calculates the length squared of a Quaternion.
Length() Calculates the length of a Quaternion.
Normalize() Divides each component of the quaternion by the length of the quaternion.
GetAxisAngle(ref Vector3, ref float)
Normalize(Quaternion) Divides each component of the quaternion by the length of the quaternion.
Normalize(ref Quaternion, ref Quaternion) Divides each component of the quaternion by the length of the quaternion.
Conjugate() Transforms this Quaternion into its conjugate.
Conjugate(Quaternion) Returns the conjugate of a specified Quaternion.
Conjugate(ref Quaternion, ref Quaternion) Returns the conjugate of a specified Quaternion.
Inverse(Quaternion) Returns the inverse of a Quaternion.
Inverse(ref Quaternion, ref Quaternion) Returns the inverse of a Quaternion.
CreateFromAxisAngle(Vector3, float) Creates a Quaternion from a vector and an angle to rotate about the vector.
CreateFromAxisAngle(ref Vector3, float, ref Quaternion) Creates a Quaternion from a vector and an angle to rotate about the vector.
CreateFromYawPitchRoll(float, float, float) Creates a new Quaternion from specified yaw, pitch, and roll angles.
CreateFromYawPitchRoll(float, float, float, ref Quaternion) Creates a new Quaternion from specified yaw, pitch, and roll angles.
CreateFromForwardUp(Vector3, Vector3) Works for normalized vectors only
CreateFromRotationMatrix(MatrixD)
CreateFromRotationMatrix(Matrix) Creates a Quaternion from a rotation Matrix.
CreateFromRotationMatrix(ref MatrixD, ref Quaternion)
CreateFromTwoVectors(ref Vector3, ref Vector3, ref Quaternion)
CreateFromTwoVectors(Vector3, Vector3)
CreateFromRotationMatrix(ref Matrix, ref Quaternion) Creates a Quaternion from a rotation Matrix.
CreateFromRotationMatrix(ref Matrix3x3, ref Quaternion) Creates a Quaternion from a rotation Matrix.
Dot(Quaternion, Quaternion) Calculates the dot product of two Quaternions.
Dot(ref Quaternion, ref Quaternion, ref float) Calculates the dot product of two Quaternions.
Slerp(Quaternion, Quaternion, float) Interpolates between two quaternions, using spherical linear interpolation.
Slerp(ref Quaternion, ref Quaternion, float, ref Quaternion) Interpolates between two quaternions, using spherical linear interpolation.
Lerp(Quaternion, Quaternion, float) Linearly interpolates between two quaternions.
Lerp(ref Quaternion, ref Quaternion, float, ref Quaternion) Linearly interpolates between two quaternions.
Concatenate(Quaternion, Quaternion) Concatenates two Quaternions; the result represents the value1 rotation followed by the value2 rotation.
Concatenate(ref Quaternion, ref Quaternion, ref Quaternion) Concatenates two Quaternions; the result represents the value1 rotation followed by the value2 rotation.
Negate(Quaternion) Flips the sign of each component of the quaternion.
Negate(ref Quaternion, ref Quaternion) Flips the sign of each component of the quaternion.
Add(Quaternion, Quaternion) Adds two Quaternions.
Add(ref Quaternion, ref Quaternion, ref Quaternion) Adds two Quaternions.
Subtract(Quaternion, Quaternion) Subtracts a quaternion from another quaternion.
Subtract(ref Quaternion, ref Quaternion, ref Quaternion) Subtracts a quaternion from another quaternion.
Multiply(Quaternion, Quaternion) Multiplies two quaternions.
Multiply(ref Quaternion, ref Quaternion, ref Quaternion) Multiplies two quaternions.
Multiply(Quaternion, float) Multiplies a quaternion by a scalar value.
Multiply(ref Quaternion, float, ref Quaternion) Multiplies a quaternion by a scalar value.
Divide(Quaternion, Quaternion) Divides a Quaternion by another Quaternion.
Divide(ref Quaternion, ref Quaternion, ref Quaternion) Divides a Quaternion by another Quaternion.
FromVector4(Vector4)
ToVector4()
IsZero(Quaternion)
IsZero(Quaternion, float)
GetForward(ref Quaternion, ref Vector3) Gets forward vector (0,0,-1) transformed by quaternion.
GetRight(ref Quaternion, ref Vector3) Gets right vector (1,0,0) transformed by quaternion.
GetUp(ref Quaternion, ref Vector3) Gets up vector (0,1,0) transformed by quaternion.
GetComponent(int)
SetComponent(int, float)
FindLargestIndex()

Clone this wiki locally