Antkeeper
0.0.1
|
Quaternion composed of a real scalar part and imaginary vector part. More...
#include <quaternion.hpp>
Public Types | |
using | scalar_type = T |
Scalar type. More... | |
using | vector_type = vec3< T > |
Vector type. More... | |
using | matrix_type = mat3< T > |
Rotation matrix type. More... | |
Public Member Functions | |
template<class U > | |
constexpr | operator quaternion< U > () const noexcept |
Type-casts the quaternion scalars using static_cast . More... | |
constexpr | operator vec4< T > () const noexcept |
Casts the quaternion to a 4-element vector, with the real part as the first element and the imaginary part as the following three elements. More... | |
constexpr scalar_type & | w () noexcept |
Returns a reference to the quaternion real part. More... | |
constexpr const scalar_type & | w () const noexcept |
Returns a reference to the quaternion real part. More... | |
constexpr scalar_type & | x () noexcept |
Returns a reference to the first element of the quaternion imaginary part. More... | |
constexpr const scalar_type & | x () const noexcept |
Returns a reference to the first element of the quaternion imaginary part. More... | |
constexpr scalar_type & | y () noexcept |
Returns a reference to the second element of the quaternion imaginary part. More... | |
constexpr const scalar_type & | y () const noexcept |
Returns a reference to the second element of the quaternion imaginary part. More... | |
constexpr scalar_type & | z () noexcept |
Returns a reference to the third element of the quaternion imaginary part. More... | |
constexpr const scalar_type & | z () const noexcept |
Returns a reference to the third element of the quaternion imaginary part. More... | |
constexpr | operator matrix_type () const noexcept |
Constructs a matrix representing the rotation described by the quaternion. More... | |
constexpr matrix_type | matrix () const noexcept |
Constructs a matrix representing the rotation described by the quaternion. More... | |
Static Public Member Functions | |
static quaternion | rotate_x (scalar_type angle) |
Returns a quaternion representing a rotation about the x-axis. More... | |
static quaternion | rotate_y (scalar_type angle) |
Returns a quaternion representing a rotation about the y-axis. More... | |
static quaternion | rotate_z (scalar_type angle) |
Returns a quaternion representing a rotation about the z-axis. More... | |
static constexpr quaternion | zero () noexcept |
Returns a zero quaternion, where every scalar is equal to zero. More... | |
static constexpr quaternion | identity () noexcept |
Returns a rotation identity quaternion. More... | |
Public Attributes | |
scalar_type | r |
Quaternion real part. More... | |
vector_type | i |
Quaternion imaginary part. More... | |
Quaternion composed of a real scalar part and imaginary vector part.
T | Scalar type. |
Definition at line 38 of file quaternion.hpp.
using math::quaternion< T >::matrix_type = mat3<T> |
Rotation matrix type.
Definition at line 47 of file quaternion.hpp.
using math::quaternion< T >::scalar_type = T |
Scalar type.
Definition at line 41 of file quaternion.hpp.
using math::quaternion< T >::vector_type = vec3<T> |
Vector type.
Definition at line 44 of file quaternion.hpp.
|
inlinestaticconstexprnoexcept |
Returns a rotation identity quaternion.
Definition at line 200 of file quaternion.hpp.
|
inlineconstexprnoexcept |
Constructs a matrix representing the rotation described by the quaternion.
Definition at line 177 of file quaternion.hpp.
|
inlineexplicitconstexprnoexcept |
Constructs a matrix representing the rotation described by the quaternion.
Definition at line 157 of file quaternion.hpp.
|
inlineexplicitconstexprnoexcept |
Type-casts the quaternion scalars using static_cast
.
U | Target scalar type. |
Definition at line 146 of file quaternion.hpp.
|
inlineexplicitconstexprnoexcept |
Casts the quaternion to a 4-element vector, with the real part as the first element and the imaginary part as the following three elements.
Definition at line 188 of file quaternion.hpp.
|
inlinestatic |
Returns a quaternion representing a rotation about the x-axis.
angle | Angle of rotation, in radians. |
Definition at line 110 of file quaternion.hpp.
|
inlinestatic |
Returns a quaternion representing a rotation about the y-axis.
angle | Angle of rotation, in radians. |
Definition at line 122 of file quaternion.hpp.
|
inlinestatic |
Returns a quaternion representing a rotation about the z-axis.
angle | Angle of rotation, in radians. |
Definition at line 133 of file quaternion.hpp.
|
inlineconstexprnoexcept |
Returns a reference to the quaternion real part.
Definition at line 61 of file quaternion.hpp.
|
inlineconstexprnoexcept |
Returns a reference to the quaternion real part.
Definition at line 57 of file quaternion.hpp.
|
inlineconstexprnoexcept |
Returns a reference to the first element of the quaternion imaginary part.
Definition at line 73 of file quaternion.hpp.
|
inlineconstexprnoexcept |
Returns a reference to the first element of the quaternion imaginary part.
Definition at line 69 of file quaternion.hpp.
|
inlineconstexprnoexcept |
Returns a reference to the second element of the quaternion imaginary part.
Definition at line 85 of file quaternion.hpp.
|
inlineconstexprnoexcept |
Returns a reference to the second element of the quaternion imaginary part.
Definition at line 81 of file quaternion.hpp.
|
inlineconstexprnoexcept |
Returns a reference to the third element of the quaternion imaginary part.
Definition at line 97 of file quaternion.hpp.
|
inlineconstexprnoexcept |
Returns a reference to the third element of the quaternion imaginary part.
Definition at line 93 of file quaternion.hpp.
|
inlinestaticconstexprnoexcept |
Returns a zero quaternion, where every scalar is equal to zero.
Definition at line 194 of file quaternion.hpp.
vector_type math::quaternion< T >::i |
Quaternion imaginary part.
Definition at line 53 of file quaternion.hpp.
scalar_type math::quaternion< T >::r |
Quaternion real part.
Definition at line 50 of file quaternion.hpp.