|
|
constexpr | Quat () noexcept=default |
| | Default constructor; initializes to the identity rotation (1, 0, 0, 0).
|
| |
| constexpr | Quat (Mat< 3, 3, T > const &m) noexcept |
| | Constructs a quaternion from a row-major 3×3 rotation matrix.
|
| |
| constexpr | Quat (Mat< 4, 4, T > const &m) noexcept |
| | Constructs a quaternion from the upper-left 3×3 block of a 4×4 matrix.
|
| |
|
constexpr | Quat (Quat const &) noexcept=default |
| | Copy constructor.
|
| |
| constexpr | Quat (T w, T x, T y, T z) noexcept |
| | Constructs a quaternion from explicit (w, x, y, z) components.
|
| |
| | Quat (Vec< 3, T > const &euler_angles) |
| | Constructs a quaternion from Euler angles (pitch, yaw, roll) in radians.
|
| |
| | Quat (Vec< 3, T > const &u, Vec< 3, T > const &v) |
| | Constructs the shortest-arc rotation quaternion from u to v.
|
| |
| template<std::floating_point U> |
| constexpr | explicit (!std::is_same_v< T, U >) Quat(Quat< U > const &q) noexcept |
| | Converting constructor from a quaternion with a different scalar type.
|
| |
| constexpr | operator Mat< 3, 3, T > () const noexcept |
| | Converts to a row-major 3×3 rotation matrix.
|
| |
| constexpr | operator Mat< 4, 4, T > () const noexcept |
| | Converts to a row-major 4×4 homogeneous rotation matrix.
|
| |
| constexpr Quat & | operator*= (Quat const &q) noexcept |
| | Hamilton (quaternion) product in place.
|
| |
| constexpr Quat & | operator*= (T s) noexcept |
| | Scales all components by scalar s.
|
| |
| constexpr Quat & | operator+= (Quat const &q) noexcept |
| | Component-wise addition.
|
| |
| constexpr Quat & | operator-= (Quat const &q) noexcept |
| | Component-wise subtraction.
|
| |
| constexpr Quat & | operator/= (T s) noexcept |
| | Divides all components by scalar s.
|
| |
| constexpr Quat & | operator= (Quat const &) noexcept=default |
| | Copy assignment operator.
|
| |
| template<std::floating_point U> |
| constexpr Quat & | operator= (Quat< U > const &rhs) noexcept |
| | Converting assignment from a quaternion with a different scalar type.
|
| |
| constexpr bool | operator== (Quat const &) const noexcept=default |
| | Component-wise equality comparison.
|
| |
| constexpr auto & | operator[] (this auto &self, size_type pos) noexcept |
| | Component access by index: 0->w, 1->x, 2->y, 3->z.
|
| |
| void | swap (Quat &other) noexcept |
| | Swaps all components with other.
|
| |
template<std::floating_point T = float>
struct ufo::Quat< T >
Unit quaternion representing an orientation or rotation in 3-D space.
- Template Parameters
-
| T | Floating-point scalar type (default: float). |
Stored as (w, x, y, z) with the convention that the identity quaternion has w = 1 and x = y = z = 0. All rotation operations assume the quaternion is unit-length; use normalize() when in doubt.
Definition at line 76 of file quat.hpp.