Skip to content

Euler

Represents 3D Euler angles with pitch, yaw, and roll components.

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.

cpp
Euler::Euler(const Matrix4& m);
ParameterDescription
mInput transformation matrix.

Euler() constexpr

Constructs an Euler object from pitch, yaw, and roll.

cpp
Euler::Euler(float pitch, float yaw, float roll);
ParameterDescription
pitchRotation around the X-axis in radians.
yawRotation around the Y-axis in radians.
rollRotation around the Z-axis in radians.

Properties

pitch float

Rotation around the X-axis in radians.

cpp
float pitch {0.0f};

roll float

Rotation around the Z-axis in radians.

cpp
float roll {0.0f};

yaw float

Rotation around the Y-axis in radians.

cpp
float yaw {0.0f};

Functions

GetMatrix() Matrix4

Converts the Euler angles into a 4×4 transformation matrix.

The resulting matrix is constructed using the YXZ rotation order.

cpp
Matrix4 Euler::GetMatrix() const;

IsEmpty() bool

Checks whether all angles are zero.

cpp
bool Euler::IsEmpty() const;

Released under the MIT License.