This repository was archived by the owner on Dec 13, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 123
VRageMath.Quaternion
Morten Aune Lyrstad edited this page Mar 20, 2020
·
54 revisions
← Index ← Namespace Index
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:
| 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 |
| Member | Description |
|---|---|
| Forward { get; } | |
| Right { get; } | |
| Up { get; } |
| Member | Description |
|---|---|
| Quaternion(float, float, float, float) | |
| Quaternion(Vector3, float) |
| 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(out Vector3, out float) | |
| Normalize(Quaternion) | Divides each component of the quaternion by the length of the quaternion. |
| Normalize(ref Quaternion, out 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, out Quaternion) | Returns the conjugate of a specified Quaternion. |
| Inverse(Quaternion) | Returns the inverse of a Quaternion. |
| Inverse(ref Quaternion, out 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, out 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, out Quaternion) | Creates a new Quaternion from specified yaw, pitch, and roll angles. |
| CreateFromForwardUp(Vector3, Vector3) | Works for normalized vectors only |
| CreateFromRotationMatrix(ref MatrixD) | |
| CreateFromRotationMatrix(Matrix) | Creates a Quaternion from a rotation Matrix. |
| CreateFromRotationMatrix(ref MatrixD, out Quaternion) | |
| CreateFromTwoVectors(ref Vector3, ref Vector3, out Quaternion) | |
| CreateFromTwoVectors(Vector3, Vector3) | |
| CreateFromRotationMatrix(ref Matrix, out Quaternion) | Creates a Quaternion from a rotation Matrix. |
| CreateFromRotationMatrix(ref Matrix3x3, out Quaternion) | Creates a Quaternion from a rotation Matrix. |
| Dot(Quaternion, Quaternion) | Calculates the dot product of two Quaternions. |
| Dot(ref Quaternion, ref Quaternion, out 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, out Quaternion) | Interpolates between two quaternions, using spherical linear interpolation. |
| Lerp(Quaternion, Quaternion, float) | Linearly interpolates between two quaternions. |
| Lerp(ref Quaternion, ref Quaternion, float, out 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, out 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, out Quaternion) | Flips the sign of each component of the quaternion. |
| Add(Quaternion, Quaternion) | Adds two Quaternions. |
| Add(ref Quaternion, ref Quaternion, out Quaternion) | Adds two Quaternions. |
| Subtract(Quaternion, Quaternion) | Subtracts a quaternion from another quaternion. |
| Subtract(ref Quaternion, ref Quaternion, out Quaternion) | Subtracts a quaternion from another quaternion. |
| Multiply(Quaternion, Quaternion) | Multiplies two quaternions. |
| Multiply(ref Quaternion, ref Quaternion, out Quaternion) | Multiplies two quaternions. |
| Multiply(Quaternion, float) | Multiplies a quaternion by a scalar value. |
| Multiply(ref Quaternion, float, out Quaternion) | Multiplies a quaternion by a scalar value. |
| Divide(Quaternion, Quaternion) | Divides a Quaternion by another Quaternion. |
| Divide(ref Quaternion, ref Quaternion, out Quaternion) | Divides a Quaternion by another Quaternion. |
| FromVector4(Vector4) | |
| ToVector4() | |
| IsZero(Quaternion) | |
| IsZero(Quaternion, float) | |
| GetForward(ref Quaternion, out Vector3) | Gets forward vector (0,0,-1) transformed by quaternion. |
| GetRight(ref Quaternion, out Vector3) | Gets right vector (1,0,0) transformed by quaternion. |
| GetUp(ref Quaternion, out Vector3) | Gets up vector (0,1,0) transformed by quaternion. |
| GetComponent(int) | |
| SetComponent(int, float) | |
| FindLargestIndex() |
Do you have questions, comments, suggestions for improvements? Is there something I can do better? Did I make a mistake? Please add an issue here, and prefix your issue title with Wiki. Thank you, your help will be very appreciated!