Space Engineers
|
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). More...
Public Member Functions | |
Quaternion (float x, float y, float z, float w) | |
Initializes a new instance of Quaternion. More... | |
Quaternion (Vector3 vectorPart, float scalarPart) | |
Initializes a new instance of Quaternion. More... | |
override string | ToString () |
Retireves a string representation of the current object. More... | |
string | ToStringAxisAngle (string format="G") |
bool | Equals (Quaternion other) |
Determines whether the specified Object is equal to the Quaternion. More... | |
bool | Equals (Quaternion value, float epsilon) |
override bool | Equals (object obj) |
Returns a value that indicates whether the current instance is equal to a specified object. More... | |
override int | GetHashCode () |
Get the hash code of this object. More... | |
float | LengthSquared () |
Calculates the length squared of a Quaternion. More... | |
float | Length () |
Calculates the length of a Quaternion. More... | |
void | Normalize () |
Divides each component of the quaternion by the length of the quaternion. More... | |
void | GetAxisAngle (out Vector3 axis, out float angle) |
void | Conjugate () |
Transforms this Quaternion into its conjugate. More... | |
Vector4 | ToVector4 () |
float | GetComponent (int index) |
void | SetComponent (int index, float value) |
int | FindLargestIndex () |
Static Public Member Functions | |
static | Quaternion () |
static Quaternion | operator- (Quaternion quaternion) |
Flips the sign of each component of the quaternion. More... | |
static bool | operator== (Quaternion quaternion1, Quaternion quaternion2) |
Compares two Quaternions for equality. More... | |
static bool | operator!= (Quaternion quaternion1, Quaternion quaternion2) |
Compare two Quaternions for inequality. More... | |
static Quaternion | operator+ (Quaternion quaternion1, Quaternion quaternion2) |
Adds two Quaternions. More... | |
static Quaternion | operator- (Quaternion quaternion1, Quaternion quaternion2) |
Subtracts a quaternion from another quaternion. More... | |
static Quaternion | operator* (Quaternion quaternion1, Quaternion quaternion2) |
Multiplies two quaternions. More... | |
static Quaternion | operator* (Quaternion quaternion1, float scaleFactor) |
Multiplies a quaternion by a scalar value. More... | |
static Quaternion | operator/ (Quaternion quaternion1, Quaternion quaternion2) |
Divides a Quaternion by another Quaternion. More... | |
static Quaternion | Normalize (Quaternion quaternion) |
Divides each component of the quaternion by the length of the quaternion. More... | |
static void | Normalize (ref Quaternion quaternion, out Quaternion result) |
Divides each component of the quaternion by the length of the quaternion. More... | |
static Quaternion | Conjugate (Quaternion value) |
Returns the conjugate of a specified Quaternion. More... | |
static void | Conjugate (ref Quaternion value, out Quaternion result) |
Returns the conjugate of a specified Quaternion. More... | |
static Quaternion | Inverse (Quaternion quaternion) |
Returns the inverse of a Quaternion. More... | |
static void | Inverse (ref Quaternion quaternion, out Quaternion result) |
Returns the inverse of a Quaternion. More... | |
static Quaternion | CreateFromAxisAngle (Vector3 axis, float angle) |
Creates a Quaternion from a vector and an angle to rotate about the vector. More... | |
static void | CreateFromAxisAngle (ref Vector3 axis, float angle, out Quaternion result) |
Creates a Quaternion from a vector and an angle to rotate about the vector. More... | |
static Quaternion | CreateFromYawPitchRoll (float yaw, float pitch, float roll) |
Creates a new Quaternion from specified yaw, pitch, and roll angles. More... | |
static void | CreateFromYawPitchRoll (float yaw, float pitch, float roll, out Quaternion result) |
Creates a new Quaternion from specified yaw, pitch, and roll angles. More... | |
static Quaternion | CreateFromForwardUp (Vector3 forward, Vector3 up) |
Works for normalized vectors only More... | |
static Quaternion | CreateFromRotationMatrix (MatrixD matrix) |
static Quaternion | CreateFromRotationMatrix (Matrix matrix) |
Creates a Quaternion from a rotation Matrix. More... | |
static void | CreateFromRotationMatrix (ref MatrixD matrix, out Quaternion result) |
static void | CreateFromTwoVectors (ref Vector3 firstVector, ref Vector3 secondVector, out Quaternion result) |
static Quaternion | CreateFromTwoVectors (Vector3 firstVector, Vector3 secondVector) |
static void | CreateFromRotationMatrix (ref Matrix matrix, out Quaternion result) |
Creates a Quaternion from a rotation Matrix. More... | |
static float | Dot (Quaternion quaternion1, Quaternion quaternion2) |
Calculates the dot product of two Quaternions. More... | |
static void | Dot (ref Quaternion quaternion1, ref Quaternion quaternion2, out float result) |
Calculates the dot product of two Quaternions. More... | |
static Quaternion | Slerp (Quaternion quaternion1, Quaternion quaternion2, float amount) |
Interpolates between two quaternions, using spherical linear interpolation. More... | |
static void | Slerp (ref Quaternion quaternion1, ref Quaternion quaternion2, float amount, out Quaternion result) |
Interpolates between two quaternions, using spherical linear interpolation. More... | |
static Quaternion | Lerp (Quaternion quaternion1, Quaternion quaternion2, float amount) |
Linearly interpolates between two quaternions. More... | |
static void | Lerp (ref Quaternion quaternion1, ref Quaternion quaternion2, float amount, out Quaternion result) |
Linearly interpolates between two quaternions. More... | |
static Quaternion | Concatenate (Quaternion value1, Quaternion value2) |
Concatenates two Quaternions; the result represents the value1 rotation followed by the value2 rotation. More... | |
static void | Concatenate (ref Quaternion value1, ref Quaternion value2, out Quaternion result) |
Concatenates two Quaternions; the result represents the value1 rotation followed by the value2 rotation. More... | |
static Quaternion | Negate (Quaternion quaternion) |
Flips the sign of each component of the quaternion. More... | |
static void | Negate (ref Quaternion quaternion, out Quaternion result) |
Flips the sign of each component of the quaternion. More... | |
static Quaternion | Add (Quaternion quaternion1, Quaternion quaternion2) |
Adds two Quaternions. More... | |
static void | Add (ref Quaternion quaternion1, ref Quaternion quaternion2, out Quaternion result) |
Adds two Quaternions. More... | |
static Quaternion | Subtract (Quaternion quaternion1, Quaternion quaternion2) |
Subtracts a quaternion from another quaternion. More... | |
static void | Subtract (ref Quaternion quaternion1, ref Quaternion quaternion2, out Quaternion result) |
Subtracts a quaternion from another quaternion. More... | |
static Quaternion | Multiply (Quaternion quaternion1, Quaternion quaternion2) |
Multiplies two quaternions. More... | |
static void | Multiply (ref Quaternion quaternion1, ref Quaternion quaternion2, out Quaternion result) |
Multiplies two quaternions. More... | |
static Quaternion | Multiply (Quaternion quaternion1, float scaleFactor) |
Multiplies a quaternion by a scalar value. More... | |
static void | Multiply (ref Quaternion quaternion1, float scaleFactor, out Quaternion result) |
Multiplies a quaternion by a scalar value. More... | |
static Quaternion | Divide (Quaternion quaternion1, Quaternion quaternion2) |
Divides a Quaternion by another Quaternion. More... | |
static void | Divide (ref Quaternion quaternion1, ref Quaternion quaternion2, out Quaternion result) |
Divides a Quaternion by another Quaternion. More... | |
static Quaternion | FromVector4 (Vector4 v) |
static bool | IsZero (Quaternion value) |
static bool | IsZero (Quaternion value, float epsilon) |
static void | GetForward (ref Quaternion q, out Vector3 result) |
Gets forward vector (0,0,-1) transformed by quaternion. More... | |
static void | GetRight (ref Quaternion q, out Vector3 result) |
Gets right vector (1,0,0) transformed by quaternion. More... | |
static void | GetUp (ref Quaternion q, out Vector3 result) |
Gets up vector (0,1,0) transformed by quaternion. More... | |
Public Attributes | |
float | X |
Specifies the x-value of the vector component of the quaternion. More... | |
float | Y |
Specifies the y-value of the vector component of the quaternion. More... | |
float | Z |
Specifies the z-value of the vector component of the quaternion. More... | |
float | W |
Specifies the rotation component of the quaternion. More... | |
Static Public Attributes | |
static Quaternion | Identity = new Quaternion(0.0f, 0.0f, 0.0f, 1f) |
static Quaternion | Zero = new Quaternion(0.0f, 0.0f, 0.0f, 0.0f) |
Properties | |
Vector3 | Forward [get] |
Vector3 | Right [get] |
Vector3 | Up [get] |
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).
Definition at line 11 of file Quaternion.cs.
|
inlinestatic |
Definition at line 66 of file Quaternion.cs.
|
inline |
Initializes a new instance of Quaternion.
x | The x-value of the quaternion. |
y | The y-value of the quaternion. |
z | The z-value of the quaternion. |
w | The w-value of the quaternion. |
Definition at line 74 of file Quaternion.cs.
|
inline |
Initializes a new instance of Quaternion.
vectorPart | The vector component of the quaternion. |
scalarPart | The rotation component of the quaternion. |
Definition at line 86 of file Quaternion.cs.
|
inlinestatic |
Adds two Quaternions.
quaternion1 | Quaternion to add. |
quaternion2 | Quaternion to add. |
Definition at line 898 of file Quaternion.cs.
|
inlinestatic |
Adds two Quaternions.
quaternion1 | Quaternion to add. |
quaternion2 | Quaternion to add. |
result | [OutAttribute] Result of adding the Quaternions. |
Definition at line 912 of file Quaternion.cs.
|
inlinestatic |
Concatenates two Quaternions; the result represents the value1 rotation followed by the value2 rotation.
value1 | The first Quaternion rotation in the series. |
value2 | The second Quaternion rotation in the series. |
Definition at line 822 of file Quaternion.cs.
|
inlinestatic |
Concatenates two Quaternions; the result represents the value1 rotation followed by the value2 rotation.
value1 | The first Quaternion rotation in the series. |
value2 | The second Quaternion rotation in the series. |
result | [OutAttribute] The Quaternion rotation representing the concatenation of value1 followed by value2. |
Definition at line 848 of file Quaternion.cs.
|
inline |
Transforms this Quaternion into its conjugate.
Definition at line 356 of file Quaternion.cs.
|
inlinestatic |
Returns the conjugate of a specified Quaternion.
value | The Quaternion of which to return the conjugate. |
Definition at line 367 of file Quaternion.cs.
|
inlinestatic |
Returns the conjugate of a specified Quaternion.
value | The Quaternion of which to return the conjugate. |
result | [OutAttribute] An existing Quaternion filled in to be the conjugate of the specified one. |
Definition at line 381 of file Quaternion.cs.
|
inlinestatic |
Creates a Quaternion from a vector and an angle to rotate about the vector.
axis | The vector to rotate around. |
angle | The angle to rotate around the vector. |
Definition at line 421 of file Quaternion.cs.
|
inlinestatic |
Creates a Quaternion from a vector and an angle to rotate about the vector.
axis | The vector to rotate around. |
angle | The angle to rotate around the vector. |
result | [OutAttribute] The created Quaternion. |
Definition at line 438 of file Quaternion.cs.
|
inlinestatic |
Works for normalized vectors only
Definition at line 496 of file Quaternion.cs.
|
inlinestatic |
Definition at line 552 of file Quaternion.cs.
|
inlinestatic |
Creates a Quaternion from a rotation Matrix.
matrix | The rotation Matrix to create the Quaternion from. |
Definition at line 560 of file Quaternion.cs.
|
inlinestatic |
Definition at line 603 of file Quaternion.cs.
|
inlinestatic |
Creates a Quaternion from a rotation Matrix.
matrix | The rotation Matrix to create the Quaternion from. |
result | [OutAttribute] The created Quaternion. |
Definition at line 629 of file Quaternion.cs.
|
inlinestatic |
Definition at line 609 of file Quaternion.cs.
|
inlinestatic |
Definition at line 618 of file Quaternion.cs.
|
inlinestatic |
Creates a new Quaternion from specified yaw, pitch, and roll angles.
yaw | The yaw angle, in radians, around the y-axis. |
pitch | The pitch angle, in radians, around the x-axis. |
roll | The roll angle, in radians, around the z-axis. |
Definition at line 453 of file Quaternion.cs.
|
inlinestatic |
Creates a new Quaternion from specified yaw, pitch, and roll angles.
yaw | The yaw angle, in radians, around the y-axis. |
pitch | The pitch angle, in radians, around the x-axis. |
roll | The roll angle, in radians, around the z-axis. |
result | [OutAttribute] An existing Quaternion filled in to express the specified yaw, pitch, and roll angles. |
Definition at line 476 of file Quaternion.cs.
|
inlinestatic |
Divides a Quaternion by another Quaternion.
quaternion1 | Source Quaternion. |
quaternion2 | The divisor. |
Definition at line 1026 of file Quaternion.cs.
|
inlinestatic |
Divides a Quaternion by another Quaternion.
quaternion1 | Source Quaternion. |
quaternion2 | The divisor. |
result | [OutAttribute] Result of the division. |
Definition at line 1053 of file Quaternion.cs.
|
inlinestatic |
Calculates the dot product of two Quaternions.
quaternion1 | Source Quaternion. |
quaternion2 | Source Quaternion. |
Definition at line 674 of file Quaternion.cs.
|
inlinestatic |
Calculates the dot product of two Quaternions.
quaternion1 | Source Quaternion. |
quaternion2 | Source Quaternion. |
result | [OutAttribute] Dot product of the Quaternions. |
Definition at line 683 of file Quaternion.cs.
|
inline |
Determines whether the specified Object is equal to the Quaternion.
other | The Quaternion to compare with the current Quaternion. |
Definition at line 248 of file Quaternion.cs.
|
inline |
Definition at line 255 of file Quaternion.cs.
|
inline |
Returns a value that indicates whether the current instance is equal to a specified object.
obj | Object to make the comparison with. |
Definition at line 265 of file Quaternion.cs.
|
inline |
Definition at line 1185 of file Quaternion.cs.
|
inlinestatic |
Definition at line 1074 of file Quaternion.cs.
|
inline |
Definition at line 309 of file Quaternion.cs.
|
inline |
Definition at line 1152 of file Quaternion.cs.
|
inlinestatic |
Gets forward vector (0,0,-1) transformed by quaternion.
Definition at line 1098 of file Quaternion.cs.
|
inline |
Get the hash code of this object.
Definition at line 276 of file Quaternion.cs.
|
inlinestatic |
Gets right vector (1,0,0) transformed by quaternion.
Definition at line 1117 of file Quaternion.cs.
|
inlinestatic |
Gets up vector (0,1,0) transformed by quaternion.
Definition at line 1136 of file Quaternion.cs.
|
inlinestatic |
Returns the inverse of a Quaternion.
quaternion | Source Quaternion. |
Definition at line 393 of file Quaternion.cs.
|
inlinestatic |
Returns the inverse of a Quaternion.
quaternion | Source Quaternion. |
result | [OutAttribute] The inverse of the Quaternion. |
Definition at line 408 of file Quaternion.cs.
|
inlinestatic |
Definition at line 1084 of file Quaternion.cs.
|
inlinestatic |
Definition at line 1090 of file Quaternion.cs.
|
inline |
Calculates the length of a Quaternion.
Definition at line 292 of file Quaternion.cs.
|
inline |
Calculates the length squared of a Quaternion.
Definition at line 284 of file Quaternion.cs.
|
inlinestatic |
Linearly interpolates between two quaternions.
quaternion1 | Source quaternion. |
quaternion2 | Source quaternion. |
amount | Value indicating how far to interpolate between the quaternions. |
Definition at line 762 of file Quaternion.cs.
|
inlinestatic |
Linearly interpolates between two quaternions.
quaternion1 | Source quaternion. |
quaternion2 | Source quaternion. |
amount | Value indicating how far to interpolate between the quaternions. |
result | [OutAttribute] The resulting quaternion. |
Definition at line 793 of file Quaternion.cs.
|
inlinestatic |
Multiplies two quaternions.
quaternion1 | The quaternion on the left of the multiplication. |
quaternion2 | The quaternion on the right of the multiplication. |
Definition at line 950 of file Quaternion.cs.
|
inlinestatic |
Multiplies two quaternions.
quaternion1 | The quaternion on the left of the multiplication. |
quaternion2 | The quaternion on the right of the multiplication. |
result | [OutAttribute] The result of the multiplication. |
Definition at line 976 of file Quaternion.cs.
|
inlinestatic |
Multiplies a quaternion by a scalar value.
quaternion1 | Source quaternion. |
scaleFactor | Scalar value. |
Definition at line 1000 of file Quaternion.cs.
|
inlinestatic |
Multiplies a quaternion by a scalar value.
quaternion1 | Source quaternion. |
scaleFactor | Scalar value. |
result | [OutAttribute] The result of the multiplication. |
Definition at line 1014 of file Quaternion.cs.
|
inlinestatic |
Flips the sign of each component of the quaternion.
quaternion | Source quaternion. |
Definition at line 872 of file Quaternion.cs.
|
inlinestatic |
Flips the sign of each component of the quaternion.
quaternion | Source quaternion. |
result | [OutAttribute] Negated quaternion. |
Definition at line 886 of file Quaternion.cs.
|
inline |
Divides each component of the quaternion by the length of the quaternion.
Definition at line 300 of file Quaternion.cs.
|
inlinestatic |
Divides each component of the quaternion by the length of the quaternion.
quaternion | Source quaternion. |
Definition at line 329 of file Quaternion.cs.
|
inlinestatic |
Divides each component of the quaternion by the length of the quaternion.
quaternion | Source quaternion. |
result | [OutAttribute] Normalized quaternion. |
Definition at line 344 of file Quaternion.cs.
|
inlinestatic |
Compare two Quaternions for inequality.
quaternion1 | Source Quaternion. |
quaternion2 | Source Quaternion. |
Definition at line 124 of file Quaternion.cs.
|
inlinestatic |
Multiplies two quaternions.
quaternion1 | Source quaternion. |
quaternion2 | Source quaternion. |
Definition at line 164 of file Quaternion.cs.
|
inlinestatic |
Multiplies a quaternion by a scalar value.
quaternion1 | Source quaternion. |
scaleFactor | Scalar value. |
Definition at line 190 of file Quaternion.cs.
|
inlinestatic |
Adds two Quaternions.
quaternion1 | Quaternion to add. |
quaternion2 | Quaternion to add. |
Definition at line 136 of file Quaternion.cs.
|
inlinestatic |
Flips the sign of each component of the quaternion.
quaternion | Source quaternion. |
Definition at line 98 of file Quaternion.cs.
|
inlinestatic |
Subtracts a quaternion from another quaternion.
quaternion1 | Source quaternion. |
quaternion2 | Source quaternion. |
Definition at line 150 of file Quaternion.cs.
|
inlinestatic |
Divides a Quaternion by another Quaternion.
quaternion1 | Source Quaternion. |
quaternion2 | The divisor. |
Definition at line 204 of file Quaternion.cs.
|
inlinestatic |
Compares two Quaternions for equality.
quaternion1 | Source Quaternion. |
quaternion2 | Source Quaternion. |
Definition at line 112 of file Quaternion.cs.
|
inline |
Definition at line 1169 of file Quaternion.cs.
|
inlinestatic |
Interpolates between two quaternions, using spherical linear interpolation.
quaternion1 | Source quaternion. |
quaternion2 | Source quaternion. |
amount | Value that indicates how far to interpolate between the quaternions. |
Definition at line 692 of file Quaternion.cs.
|
inlinestatic |
Interpolates between two quaternions, using spherical linear interpolation.
quaternion1 | Source quaternion. |
quaternion2 | Source quaternion. |
amount | Value that indicates how far to interpolate between the quaternions. |
result | [OutAttribute] Result of the interpolation. |
Definition at line 728 of file Quaternion.cs.
|
inlinestatic |
Subtracts a quaternion from another quaternion.
quaternion1 | Source quaternion. |
quaternion2 | Source quaternion. |
Definition at line 924 of file Quaternion.cs.
|
inlinestatic |
Subtracts a quaternion from another quaternion.
quaternion1 | Source quaternion. |
quaternion2 | Source quaternion. |
result | [OutAttribute] Result of the subtraction. |
Definition at line 938 of file Quaternion.cs.
|
inline |
Retireves a string representation of the current object.
Definition at line 230 of file Quaternion.cs.
|
inline |
Definition at line 235 of file Quaternion.cs.
|
inline |
Definition at line 1079 of file Quaternion.cs.
|
static |
Definition at line 13 of file Quaternion.cs.
float VRageMath.Quaternion.W |
Specifies the rotation component of the quaternion.
Definition at line 34 of file Quaternion.cs.
float VRageMath.Quaternion.X |
Specifies the x-value of the vector component of the quaternion.
Definition at line 19 of file Quaternion.cs.
float VRageMath.Quaternion.Y |
Specifies the y-value of the vector component of the quaternion.
Definition at line 24 of file Quaternion.cs.
float VRageMath.Quaternion.Z |
Specifies the z-value of the vector component of the quaternion.
Definition at line 29 of file Quaternion.cs.
|
static |
Definition at line 14 of file Quaternion.cs.
|
get |
Definition at line 37 of file Quaternion.cs.
|
get |
Definition at line 47 of file Quaternion.cs.
|
get |
Definition at line 57 of file Quaternion.cs.