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 Dec 21, 2018 · 54 revisions

Index

Quaternion Struct

Namespace: VRageMath
Assembly: VRage.Math.dll

Summary

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).

Fields

_float X_ Specifies the x-value of the vector component of the quaternion.
_float Y_ Specifies the y-value of the vector component of the quaternion.
_float Z_ Specifies the z-value of the vector component of the quaternion.
_float W_ Specifies the rotation component of the quaternion.
static _Quaternion Identity_
static _Quaternion Zero_
### Properties
_Vector3 Forward_
_Vector3 Right_
_Vector3 Up_
### Methods
_string ToString()_ Retireves a string representation of the current object.
_string ToString(string format)_
_string ToStringAxisAngle(string format)_
_bool Equals(Quaternion other)_ Determines whether the specified Object is equal to the Quaternion.
_bool Equals(Quaternion value, float epsilon)_
_bool Equals(Object obj)_ Returns a value that indicates whether the current instance is equal to a specified object.
_int GetHashCode()_ Get the hash code of this object.
_float LengthSquared()_ Calculates the length squared of a Quaternion.
_float Length()_ Calculates the length of a Quaternion.
_void Normalize()_ Divides each component of the quaternion by the length of the quaternion.
_void GetAxisAngle(ref Vector3 axis, ref float angle)_
static _Quaternion Normalize(Quaternion quaternion)_ Divides each component of the quaternion by the length of the quaternion.
static _void Normalize(ref Quaternion quaternion, ref Quaternion result)_ Divides each component of the quaternion by the length of the quaternion.
_void Conjugate()_ Transforms this Quaternion into its conjugate.
static _Quaternion Conjugate(Quaternion value)_ Returns the conjugate of a specified Quaternion.
static _void Conjugate(ref Quaternion value, ref Quaternion result)_ Returns the conjugate of a specified Quaternion.
static _Quaternion Inverse(Quaternion quaternion)_ Returns the inverse of a Quaternion.
static _void Inverse(ref Quaternion quaternion, ref Quaternion result)_ Returns the inverse of a Quaternion.
static _Quaternion CreateFromAxisAngle(Vector3 axis, float angle)_ Creates a Quaternion from a vector and an angle to rotate about the vector.
static _void CreateFromAxisAngle(ref Vector3 axis, float angle, ref Quaternion result)_ Creates a Quaternion from a vector and an angle to rotate about the vector.
static _Quaternion CreateFromYawPitchRoll(float yaw, float pitch, float roll)_ Creates a new Quaternion from specified yaw, pitch, and roll angles.
static _void CreateFromYawPitchRoll(float yaw, float pitch, float roll, ref Quaternion result)_ Creates a new Quaternion from specified yaw, pitch, and roll angles.
static _Quaternion CreateFromForwardUp(Vector3 forward, Vector3 up)_ Works for normalized vectors only
static _Quaternion CreateFromRotationMatrix(MatrixD matrix)_
static _Quaternion CreateFromRotationMatrix(Matrix matrix)_ Creates a Quaternion from a rotation Matrix.
static _void CreateFromRotationMatrix(ref MatrixD matrix, ref Quaternion result)_
static _void CreateFromTwoVectors(ref Vector3 firstVector, ref Vector3 secondVector, ref Quaternion result)_
static _Quaternion CreateFromTwoVectors(Vector3 firstVector, Vector3 secondVector)_
static _void CreateFromRotationMatrix(ref Matrix matrix, ref Quaternion result)_ Creates a Quaternion from a rotation Matrix.
static _void CreateFromRotationMatrix(ref Matrix3x3 matrix, ref Quaternion result)_ Creates a Quaternion from a rotation Matrix.
static _float Dot(Quaternion quaternion1, Quaternion quaternion2)_ Calculates the dot product of two Quaternions.
static _void Dot(ref Quaternion quaternion1, ref Quaternion quaternion2, ref float result)_ Calculates the dot product of two Quaternions.
static _Quaternion Slerp(Quaternion quaternion1, Quaternion quaternion2, float amount)_ Interpolates between two quaternions, using spherical linear interpolation.
static _void Slerp(ref Quaternion quaternion1, ref Quaternion quaternion2, float amount, ref Quaternion result)_ Interpolates between two quaternions, using spherical linear interpolation.
static _Quaternion Lerp(Quaternion quaternion1, Quaternion quaternion2, float amount)_ Linearly interpolates between two quaternions.
static _void Lerp(ref Quaternion quaternion1, ref Quaternion quaternion2, float amount, ref Quaternion result)_ Linearly interpolates between two quaternions.
static _Quaternion Concatenate(Quaternion value1, Quaternion value2)_ Concatenates two Quaternions; the result represents the value1 rotation followed by the value2 rotation.
static _void Concatenate(ref Quaternion value1, ref Quaternion value2, ref Quaternion result)_ Concatenates two Quaternions; the result represents the value1 rotation followed by the value2 rotation.
static _Quaternion Negate(Quaternion quaternion)_ Flips the sign of each component of the quaternion.
static _void Negate(ref Quaternion quaternion, ref Quaternion result)_ Flips the sign of each component of the quaternion.
static _Quaternion Add(Quaternion quaternion1, Quaternion quaternion2)_ Adds two Quaternions.
static _void Add(ref Quaternion quaternion1, ref Quaternion quaternion2, ref Quaternion result)_ Adds two Quaternions.
static _Quaternion Subtract(Quaternion quaternion1, Quaternion quaternion2)_ Subtracts a quaternion from another quaternion.
static _void Subtract(ref Quaternion quaternion1, ref Quaternion quaternion2, ref Quaternion result)_ Subtracts a quaternion from another quaternion.
static _Quaternion Multiply(Quaternion quaternion1, Quaternion quaternion2)_ Multiplies two quaternions.
static _void Multiply(ref Quaternion quaternion1, ref Quaternion quaternion2, ref Quaternion result)_ Multiplies two quaternions.
static _Quaternion Multiply(Quaternion quaternion1, float scaleFactor)_ Multiplies a quaternion by a scalar value.
static _void Multiply(ref Quaternion quaternion1, float scaleFactor, ref Quaternion result)_ Multiplies a quaternion by a scalar value.
static _Quaternion Divide(Quaternion quaternion1, Quaternion quaternion2)_ Divides a Quaternion by another Quaternion.
static _void Divide(ref Quaternion quaternion1, ref Quaternion quaternion2, ref Quaternion result)_ Divides a Quaternion by another Quaternion.
static _Quaternion FromVector4(Vector4 v)_
_Vector4 ToVector4()_
static _bool IsZero(Quaternion value)_
static _bool IsZero(Quaternion value, float epsilon)_
static _void GetForward(ref Quaternion q, ref Vector3 result)_ Gets forward vector (0,0,-1) transformed by quaternion.
static _void GetRight(ref Quaternion q, ref Vector3 result)_ Gets right vector (1,0,0) transformed by quaternion.
static _void GetUp(ref Quaternion q, ref Vector3 result)_ Gets up vector (0,1,0) transformed by quaternion.
_float GetComponent(int index)_
_void SetComponent(int index, float value)_
_int FindLargestIndex()_

Clone this wiki locally