#include <muu/euler_angles.h>
template <typename Scalar>
euler_angles struct
A set of euler angles used for rotation.
Template parameters | |
---|---|
Scalar | The scalar component type of the data members. |
This type models a specific form of Euler angles relating to the Aircraft Principal Axes, and observes the following conventions:
Yaw |
|
Pitch |
|
Roll |
|
The angles are always in radians.
Public types
- using scalar_type = Scalar
- The scalar type of the rotation's angles.
Public static functions
-
static auto infinity_or_nan(const euler_
angles& rot) -> bool constexpr noexcept - Returns true if any of the angles in a set of euler angles are infinity or NaN.
Constructors, destructors, conversion operators
- euler_angles() defaulted noexcept
- Default constructor. Values are not initialized.
-
euler_angles(const euler_
angles&) defaulted constexpr noexcept - Copy constructor.
-
euler_angles(scalar_
type yaw, scalar_ type pitch, scalar_ type roll = scalar_ type{}) constexpr noexcept - Initializes from three separate euler angles.
-
euler_angles(const vector<scalar_
type, 3>& v) explicit constexpr noexcept - Initializes from a vec3, where x, y and z are yaw, pitch and roll, respectively.
-
template <typename T>euler_angles(const euler_
angles<T>& other) explicit constexpr noexcept - Converting constructor.
-
template <typename T>euler_angles(const T& obj) constexpr noexcept
- Constructs a set of euler angles from an implicitly bit-castable type.
- operator vector<scalar_type, 3>() const explicit constexpr noexcept
- Converts the euler angles to a vec3, where x, y and z are yaw, pitch and roll, respectively.
Public functions
- auto infinity_or_nan() const -> bool constexpr noexcept
- Returns true if any of the angles are infinity or NaN.
-
auto operator*=(scalar_
type rhs) -> euler_ angles& constexpr noexcept - Scales the euler angles.
-
auto operator=(const euler_
angles&) -> euler_ angles& defaulted constexpr noexcept - Copy-assigment operator.
Public variables
-
scalar_
type yaw - The rotation around the local up axis (in radians).
-
scalar_
type pitch - The rotation around the local right axis (in radians).
-
scalar_
type roll - The rotation around the local forward axis (in radians).
Friends
-
auto operator*(const euler_
angles& lhs, scalar_ type rhs) -> euler_ angles constexpr noexcept - Scales a set of euler angles.
-
auto operator*(scalar_
type lhs, const euler_ angles& rhs) -> euler_ angles constexpr noexcept - Scales a set of euler angles.
-
template <typename Char, typename Traits>auto operator<<(std::
basic_ostream<Char, Traits>& os, const euler_ angles& rot) -> std:: basic_ostream<Char, Traits>& - Writes a set of euler angles out to a text stream.
Function documentation
template <typename Scalar>
template <typename T>
muu::euler_angles::euler_angles(const T& obj) constexpr noexcept
template <typename T>
Constructs a set of euler angles from an implicitly bit-castable type.
Template parameters | |
---|---|
T | A bit-castable type. |
Variable documentation
template <typename Scalar>
scalar_ type muu::euler_angles::yaw
The rotation around the local up axis (in radians).
template <typename Scalar>
scalar_ type muu::euler_angles::pitch
The rotation around the local right axis (in radians).
template <typename Scalar>
scalar_ type muu::euler_angles::roll
The rotation around the local forward axis (in radians).