|
utility 2026.1.9
A comprehensive C++ utilities library tailored for the development of modern desktop and extended reality (XR) applications.
|
Quaternion class inheriting from glm::qua. More...
#include <headers/utility/math/quaternion.hpp>


Public Member Functions | |
| Quaternion () | |
| Default constructor (identity quaternion). | |
| Quaternion (QuaternionComponentType x, QuaternionComponentType y, QuaternionComponentType z, QuaternionComponentType w) | |
| Construct from explicit components in (x, y, z, w) order. | |
| Quaternion (const glm::qua< QuaternionComponentType > &q) | |
| Construct from a GLM quaternion. | |
| Quaternion (const Quaternion &other)=default | |
| Copy constructor. | |
| Quaternion (Quaternion &&other) noexcept=default | |
| Move constructor. | |
| ~Quaternion ()=default | |
| Default destructor for Quaternion. | |
| Quaternion & | operator= (const Quaternion &other)=default |
| Copy assignment operator. | |
| Quaternion & | operator= (Quaternion &&other) noexcept=default |
| Move assignment operator. | |
| Quaternion | operator+ (const Quaternion &rhs) const noexcept |
| Quaternion addition. | |
| Quaternion & | operator+= (const Quaternion &rhs) noexcept |
| Quaternion addition assignment. | |
| Quaternion | operator- (const Quaternion &rhs) const noexcept |
| Quaternion subtraction. | |
| Quaternion & | operator-= (const Quaternion &rhs) noexcept |
| Quaternion subtraction assignment. | |
| Quaternion | operator* (const Quaternion &rhs) const noexcept |
| Quaternion multiplication (Hamilton product). | |
| Quaternion & | operator*= (const Quaternion &rhs) noexcept |
| Quaternion multiplication assignment (Hamilton product). | |
| Quaternion | operator* (QuaternionComponentType scalar) const noexcept |
| Scalar multiplication. | |
| Quaternion & | operator*= (QuaternionComponentType scalar) noexcept |
| Scalar multiplication assignment. | |
| bool | operator== (const Quaternion &rhs) const noexcept |
| Equality comparison. | |
| bool | equalsEpsilon (const Quaternion &rhs, QuaternionComponentType epsilon=QuaternionComponentType { 1e-5 }) const |
| Approximate equality using an epsilon threshold. | |
| bool | operator!= (const Quaternion &rhs) const noexcept |
| Inequality comparison. | |
| Quaternion | operator- (void) const noexcept |
| Unary negation. | |
Friends | |
| Quaternion | operator* (QuaternionComponentType scalar, const Quaternion &q) |
| Friend function for scalar multiplication with scalar on the left. | |
Quaternion class inheriting from glm::qua.
| QuaternionComponentType | Floating-point type for quaternion components. |
Definition at line 65 of file quaternion.hpp.
|
inline |
Default constructor (identity quaternion).
Definition at line 72 of file quaternion.hpp.

|
inline |
Construct from explicit components in (x, y, z, w) order.
Note: this library exposes the parameter order (x, y, z, w) with the scalar component (w) last. This deliberately differs from GLM's glm::qua(w, x, y, z) constructor, which places the scalar component first. The arguments are remapped internally; pass (x, y, z, w).
| x | X component. |
| y | Y component. |
| z | Z component. |
| w | W component. |
Definition at line 92 of file quaternion.hpp.
|
inlineexplicit |
Construct from a GLM quaternion.
| q | Source quaternion. |
Definition at line 102 of file quaternion.hpp.
|
default |
Copy constructor.
| other | The Quaternion object to copy from. |
|
defaultnoexcept |
Move constructor.
| other | The Quaternion object to move from. |
|
inline |
Approximate equality using an epsilon threshold.
Returns true if each component is within epsilon of its counterpart in rhs.
| rhs | The quaternion to compare with. |
| epsilon | The maximum allowed difference per component. |
Definition at line 257 of file quaternion.hpp.
|
inlinenoexcept |
Inequality comparison.
| rhs | The quaternion to compare with. |
Definition at line 272 of file quaternion.hpp.
|
inlinenoexcept |
Quaternion multiplication (Hamilton product).
| rhs | The quaternion to multiply with. |
Definition at line 191 of file quaternion.hpp.

|
inlinenoexcept |
Scalar multiplication.
| scalar | The scalar value to multiply with. |
Definition at line 216 of file quaternion.hpp.

|
inlinenoexcept |
Quaternion multiplication assignment (Hamilton product).
| rhs | The quaternion to multiply with. |
Definition at line 203 of file quaternion.hpp.
|
inlinenoexcept |
Scalar multiplication assignment.
| scalar | The scalar value to multiply with. |
Definition at line 228 of file quaternion.hpp.
|
inlinenoexcept |
Quaternion addition.
| rhs | The quaternion to add. |
Definition at line 143 of file quaternion.hpp.

|
inlinenoexcept |
Quaternion addition assignment.
| rhs | The quaternion to add. |
Definition at line 155 of file quaternion.hpp.
|
inlinenoexcept |
Quaternion subtraction.
| rhs | The quaternion to subtract. |
Definition at line 167 of file quaternion.hpp.

|
inlinenoexcept |
Unary negation.
Definition at line 281 of file quaternion.hpp.

|
inlinenoexcept |
Quaternion subtraction assignment.
| rhs | The quaternion to subtract. |
Definition at line 179 of file quaternion.hpp.
|
default |
Copy assignment operator.
| other | The Quaternion object to copy from. |
|
defaultnoexcept |
Move assignment operator.
| other | The Quaternion object to move from. |
|
inlinenoexcept |
Equality comparison.
Uses exact component-wise equality. For floating-point types prefer equalsEpsilon to tolerate rounding error.
| rhs | The quaternion to compare with. |
Definition at line 242 of file quaternion.hpp.
|
friend |
Friend function for scalar multiplication with scalar on the left.
| scalar | The scalar value to multiply with. |
| q | The quaternion to multiply. |
Definition at line 294 of file quaternion.hpp.