Skip to content

Euler

Represents 3D [Euler](/reference/math/euler) angles with pitch, yaw, and roll components.

[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

cpp
float pitch { 0.0f }

Rotation around the X-axis in radians.

roll float

cpp
float roll { 0.0f }

Rotation around the Z-axis in radians.

yaw float

cpp
float yaw { 0.0f }

Rotation around the Y-axis in radians.

Functions

Euler() constexpr

cpp
vglx::Euler::Euler(const Matrix4 &m)
ParameterDescription
mInput 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

cpp
vglx::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).

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

GetMatrix() auto

cpp
auto vglx::Euler::GetMatrix() const

Converts the Euler angles into a 4×4 transformation matrix. The resulting matrix is constructed using the default YXZ rotation order.

IsEmpty() auto

cpp
auto vglx::Euler::IsEmpty() const

Checks whether all angles are zero.

Released under the MIT License.