Euler
[Euler](/reference/math/euler)
stores orientation using intrinsic Tait-Bryan angles in YXZ order, where:yaw is a rotation around the Y-axis,pitch is a rotation around the X-axis,roll is a rotation around the Z-axis.
This class supports construction from individual angles or a transformation matrix, and can convert back to a [Matrix4](/reference/math/matrix4)
representation for use in transformations.
Note: Gimbal lock may occur when pitch approaches ±90°, limiting the reliability of angle reconstruction.
Properties
pitch float
float pitch { 0.0f }
Rotation around the X-axis in radians.
roll float
float roll { 0.0f }
Rotation around the Z-axis in radians.
yaw float
float yaw { 0.0f }
Rotation around the Y-axis in radians.
Functions
Euler() constexpr
vglx::Euler::Euler(const Matrix4 &m)
Parameter | Description |
---|---|
m | Input transformation matrix. |
Constructs an Euler angles object from a transformation matrix. This constructor extracts pitch, yaw, and roll from a given matrix. If gimbal lock is detected (when cos(pitch) is near zero), yaw is set to 0, and roll is computed using an alternate strategy.
Euler() constexpr
vglx::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). |
Constructs an Euler angles object from pitch, yaw, and roll.