Anglesclass
Euler angles. Unlike a Rotation, Euler angles can represent multiple revolutions (rotations) around an axis, but suffer from issues like gimbal lock and lack of a defined "up" vector. Use Rotation for most cases.
Constructors4
Showing 4 constructors
No results match this filter.
Methods17
Showing 17 methods
public static Vector3 AngleVector(Angles ang)
Converts an angle to a forward vector.
| Parameter | Type | Description |
|---|---|---|
| ang | Angles | — |
public static float ClampAngle(float v)
Clamps the angle to range of [0, 360)
| Parameter | Type | Description |
|---|---|---|
| v | float | — |
float—public Angles Clamped()
Returns clamped version of this object, meaning the angle on each axis is transformed to range of [0,360).
public bool IsNearlyZero(double tolerance = 1E-06)
Returns true if this angles object's components are all nearly zero with given tolerance.
| Parameter | Type | Description |
|---|---|---|
| tolerance = 1E-06 | double | — |
bool—public static Angles Lerp(Angles source, Angles target, float frac)
Performs linear interpolation on the two given angle objects.
| Parameter | Type | Description |
|---|---|---|
| source | Angles | Angle A |
| target | Angles | Angle B |
| frac | float | Fraction in range [0,1] between the 2 angle objects to use for interpolation. |
public Angles LerpTo(Angles target, float frac)
Performs linear interpolation on the two given angle objects.
| Parameter | Type | Description |
|---|---|---|
| target | Angles | Angle B |
| frac | float | Fraction in range [0,1] between the 2 angle objects to use for interpolation. |
public static float NormalizeAngle(float v)
Normalizes the angle to range of (-180, 180]
| Parameter | Type | Description |
|---|---|---|
| v | float | — |
float—public Angles SnapToGrid(float gridSize, bool sx = True, bool sy = True, bool sz = True)
Snap to grid
| Parameter | Type | Description |
|---|---|---|
| gridSize | float | — |
| sx = True | bool | — |
| sy = True | bool | — |
| sz = True | bool | — |
public Rotation ToRotation()
Converts these Euler angles to a rotation. The angles will be normalized.
public Angles WithPitch(float pitch)
Returns this angles object with given pitch component.
| Parameter | Type | Description |
|---|---|---|
| pitch | float | — |
public Angles WithRoll(float roll)
Returns this angles object with given roll component.
| Parameter | Type | Description |
|---|---|---|
| roll | float | — |
No results match this filter.
Properties3
Showing 3 properties
No results match this filter.