Class QuaternionExtensions
Provides extension methods for the Quaternion struct.
Inheritance
Inherited Members
Namespace: AssetRipper.Numerics
Assembly: AssetRipper.Numerics.dll
Syntax
public static class QuaternionExtensions
Methods
| Improve this Doc View SourceDot(Quaternion, Quaternion)
Returns the dot product of two Quaternions.
Declaration
public static double Dot(this Quaternion a, Quaternion b)
Parameters
Type | Name | Description |
---|---|---|
Quaternion | a | The first Quaternion. |
Quaternion | b | The second Quaternion. |
Returns
Type | Description |
---|---|
System.Double | The dot product of two Quaternions. |
EqualsByDot(Quaternion, Quaternion)
Returns a value indicating if this Quaternion is nearly equal to another using dot product.
Declaration
public static bool EqualsByDot(this Quaternion a, Quaternion b)
Parameters
Type | Name | Description |
---|---|---|
Quaternion | a | The first Quaternion. |
Quaternion | b | The second Quaternion. |
Returns
Type | Description |
---|---|
System.Boolean | True if they are nearly equal. |
FlipSignAt(ref Quaternion, Int32)
Flips the sign of the value of the specified index of the Quaternion.
Declaration
public static void FlipSignAt(this ref Quaternion quaternion, int index)
Parameters
Type | Name | Description |
---|---|---|
Quaternion | quaternion | The Quaternion instance. |
System.Int32 | index | The index of the Quaternion. |
GetAt(Quaternion, Int32)
Returns the value of the specified index of the Quaternion.
Declaration
public static float GetAt(this Quaternion quaternion, int index)
Parameters
Type | Name | Description |
---|---|---|
Quaternion | quaternion | The Quaternion instance. |
System.Int32 | index | The index of the Quaternion. |
Returns
Type | Description |
---|---|
System.Single | The value of the specified index of the Quaternion. |
IsUnitQuaternion(Quaternion)
Returns a value indicating if this Quaternion is an unit quaternion.
Declaration
public static bool IsUnitQuaternion(this Quaternion a)
Parameters
Type | Name | Description |
---|---|---|
Quaternion | a | The Quaternion instance. |
Returns
Type | Description |
---|---|
System.Boolean | True if this Quaternion is an unit quaternion. |
IsZero(Quaternion)
Returns a value indicating if this Quaternion is the zero Quaternion.
Declaration
public static bool IsZero(this Quaternion a)
Parameters
Type | Name | Description |
---|---|---|
Quaternion | a | The Quaternion instance. |
Returns
Type | Description |
---|---|
System.Boolean | True if this Quaternion is the zero Quaternion. |
SetAt(ref Quaternion, Int32, Single)
Sets the value of the specified index of the Quaternion.
Declaration
public static void SetAt(this ref Quaternion quaternion, int index, float value)
Parameters
Type | Name | Description |
---|---|---|
Quaternion | quaternion | The Quaternion instance. |
System.Int32 | index | The index of the Quaternion. |
System.Single | value | The value to be set. |
ToEulerAngle(Quaternion, Boolean)
Converts a quaternion to Euler angles.
Declaration
public static Vector3 ToEulerAngle(this Quaternion quaternion, bool asDegrees)
Parameters
Type | Name | Description |
---|---|---|
Quaternion | quaternion | The Quaternion instance. |
System.Boolean | asDegrees | If true, the Euler angles will be in degrees. If false, radians are used. |
Returns
Type | Description |
---|---|
Vector3 | A Vector3 containing the Euler angles of the Quaternion. |