template <typename Scalar>
muu::axis_angle struct

An axis-angle rotation.

Template parameters
Scalar The scalar component type of the data members.

Public types

using axis_type = vector<scalar_type, 3>
The three-dimensional muu::vector with the same scalar_type as this axis-angle.
using scalar_type = Scalar
The scalar type of the axis and angle.

Public static functions

static auto infinity_or_nan(const axis_angle& aa) -> bool constexpr noexcept
Returns true if any of the scalars in an axis-angle are infinity or NaN.

Constructors, destructors, conversion operators

axis_angle() defaulted noexcept
Default constructor. Values are not initialized.
axis_angle(const axis_angle&) defaulted constexpr noexcept
Copy constructor.
axis_angle(const axis_type& axis, scalar_type angle) constexpr noexcept
Initializes from an axis and an angle.
axis_angle(const axis_type& axis) explicit constexpr noexcept
Initializes from an axis, setting angle to zero.
axis_angle(const vector<scalar_type, 4>& v) explicit constexpr noexcept
Initializes from a vec4, where x, y and z are the axis, and w is the angle.
template <typename T>
axis_angle(const axis_angle<T>& other) explicit constexpr noexcept
Converting constructor.
template <typename T>
axis_angle(const T& obj) constexpr noexcept
Constructs an axis-angle from an implicitly bit-castable type.
operator const axis_type&() const explicit constexpr noexcept
Returns a reference to the axis component.
operator vector<scalar_type, 4>() const explicit constexpr noexcept
Converts this axis-angle to a vec4, where x, y and z are the axis, and w is the angle.

Public functions

auto infinity_or_nan() const -> bool constexpr noexcept
Returns true if any of the scalars in the axis-angle are infinity or NaN.
auto operator=(const axis_angle&) -> axis_angle& defaulted constexpr noexcept
Copy-assigment operator.

Public variables

vector_type axis
The axis being rotated around.
scalar_type angle
The angle of rotation (in radians).

Friends

template <typename Char, typename Traits>
auto operator<<(std::basic_ostream<Char, Traits>& os, const axis_angle& rot) -> std::basic_ostream<Char, Traits>&
Writes an axis-angle rotation out to a text stream.

Function documentation

template <typename Scalar>
template <typename T>
muu::axis_angle::axis_angle(const T& obj) constexpr noexcept

Constructs an axis-angle from an implicitly bit-castable type.

Template parameters
T A bit-castable type.