Class QuaternionMathExtensions
Inheritance
System.Object
QuaternionMathExtensions
Namespace: OpenMod.Extensions.Games.Abstractions.Transforms
Assembly: OpenMod.Extensions.Games.Abstractions.dll
Syntax
public static class QuaternionMathExtensions : object
Methods
| Improve this Doc View SourceRotate(Vector3, Quaternion)
Rotates this point by the given rotation.
Declaration
public static Vector3 Rotate(this Vector3 point, Quaternion rotation)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | point | The point to rotate. |
Quaternion | rotation | The rotation to apply. |
Returns
Type | Description |
---|---|
Vector3 | The rotated point. |
ToEulerAngles(Quaternion)
Converts a quaternion to its euler angles where X is pitch, Y is yaw, and Z is roll.
Declaration
public static Vector3 ToEulerAngles(this Quaternion quaternion)
Parameters
Type | Name | Description |
---|---|---|
Quaternion | quaternion | The quaternion to convert. |
Returns
Type | Description |
---|---|
Vector3 | Euler angles of the quaternion. |
ToQuaternion(Vector3)
Converts euler angles to its quaternion where where X is pitch, Y is yaw, and Z is roll.
Declaration
public static Quaternion ToQuaternion(this Vector3 eulerAngles)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | eulerAngles |
Returns
Type | Description |
---|---|
Quaternion |