Euler
Euler stores orientation using intrinsic Tait–Bryan angles in YXZ order: yaw is a rotation around the Y-axis, pitch is a rotation around the X-axis, and roll is a rotation around the Z-axis. All angles are specified in radians.
Instances can be constructed from individual angles or extracted from a transformation matrix, and converted back to a Matrix4 for use in transforms. Gimbal lock can occur when pitch approaches , which limits the reliability of angle reconstruction from matrices.
Construction
Constructors
Euler() constexpr
Constructs an Euler object from a transformation matrix.
Extracts pitch, yaw, and roll from the given matrix using the YXZ rotation order. When cos(pitch) is close to zero (gimbal lock), yaw is set to zero and roll is computed using an alternate path.
Euler::Euler(const Matrix4& m);| Parameter | Description |
|---|---|
| m | Input transformation matrix. |
Euler() constexpr
Constructs an Euler object from pitch, yaw, and roll.
Euler::Euler(float pitch, float yaw, float roll);| Parameter | Description |
|---|---|
| pitch | Rotation around the X-axis in radians. |
| yaw | Rotation around the Y-axis in radians. |
| roll | Rotation around the Z-axis in radians. |
Properties
pitch float
Rotation around the X-axis in radians.
float pitch {0.0f};roll float
Rotation around the Z-axis in radians.
float roll {0.0f};yaw float
Rotation around the Y-axis in radians.
float yaw {0.0f};Functions
Converts the Euler angles into a 4×4 transformation matrix.
The resulting matrix is constructed using the YXZ rotation order.
Matrix4 Euler::GetMatrix() const;IsEmpty() bool
Checks whether all angles are zero.
bool Euler::IsEmpty() const;