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

Member Description
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

Member Description
Vector3 Forward
Vector3 Right
Vector3 Up

Methods

Member Description
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