Template Struct tQuat#

Struct Documentation#

template<typename T>
struct tQuat#

Public Types

using value_type = T#
using pointer = T*#
using const_pointer = const T*#
using reference = T&#
using const_reference = const T&#
using size_type = u32#
using difference_type = isize#

Public Functions

constexpr tQuat(tQuat&&) noexcept = default#

Move constructor.

constexpr ~tQuat() = default#

Destructor.

constexpr tQuat<T> &operator=(tQuat&&) noexcept = default#

Move assignment operator.

constexpr tQuat() noexcept = default#

Constructor.

constexpr tQuat(const tQuat &q) noexcept = default#

Copy constructor.

constexpr tQuat(T s, const Vec<3, T> &v) noexcept#

Explicit basic constructor.

constexpr tQuat(T w_, T x_, T y_, T z_) noexcept#

Explicit basic constructor.

template<typename U>
explicit constexpr tQuat(const tQuat<U> &q) noexcept#

Explicit conversion constructor.

constexpr tQuat(const Vec<3, T> &u, const Vec<3, T> &v)#

Create a quaternion from two normalized axis.

explicit constexpr tQuat(const Vec<3, T> &eulerAnglesInRadians)#

Build a quaternion from euler angles (pitch, yaw, roll).

Parameters:

eulerAnglesInRadians – Euler angles (pitch, yaw, roll).

explicit constexpr tQuat(const Mat<3, 3, T> &m)#

Build a quaternion from a 3x3 matrix.

explicit constexpr tQuat(const Mat<4, 4, T> &m)#

Build a quaternion from a 4x4 matrix.

constexpr tQuat<T> &operator=(const tQuat<T> &q) noexcept = default#
template<typename U>
constexpr tQuat<T> &operator=(const tQuat<U> &q) noexcept#
template<typename U>
constexpr tQuat<T> &operator+=(const tQuat<U> &q) noexcept#
template<typename U>
constexpr tQuat<T> &operator-=(const tQuat<U> &q) noexcept#
template<typename U>
constexpr tQuat<T> &operator*=(const tQuat<U> &r) noexcept#
template<typename U>
constexpr tQuat<T> &operator*=(U s) noexcept#
template<typename U>
constexpr tQuat<T> &operator/=(U s) noexcept#
constexpr T &w() noexcept#

Retrieve the w component of the quaternion.

Returns:

w component.

constexpr const T &w() const noexcept#

Retrieve the w component of the quaternion.

Returns:

w component.

constexpr T &x() noexcept#

Retrieve the x component of the quaternion.

Returns:

x component.

constexpr const T &x() const noexcept#

Retrieve the x component of the quaternion.

Returns:

x component.

constexpr T &y() noexcept#

Retrieve the y component of the quaternion.

Returns:

y component.

constexpr const T &y() const noexcept#

Retrieve the y component of the quaternion.

Returns:

y component.

constexpr T &z() noexcept#

Retrieve the z component of the quaternion.

Returns:

z component.

constexpr const T &z() const noexcept#

Retrieve the z component of the quaternion.

Returns:

z component.

constexpr T &operator[](usize i)#

Returns a reference to the element at specified location i.

Note

No bounds checking is performed.

Parameters:

i – Position of the element to return.

Returns:

Reference to the requested element.

constexpr const T &operator[](usize i) const#

Returns a constant reference to the element at specified location i.

Note

No bounds checking is performed.

Parameters:

i – Position of the element to return.

Returns:

Constant reference to the requested element.

constexpr T &at(usize i)#

Returns a reference to the element at specified location i, with bounds checking via asserts.

Parameters:

i – Position of the element to return.

Returns:

Reference to the requested element.

constexpr const T &at(usize i) const#

Returns a constant reference to the element at specified location i, with bounds checking via asserts.

Parameters:

i – Position of the element to return.

Returns:

Constant reference to the requested element.

consteval auto operator<=>(const tQuat<T> &rhs) const noexcept = delete#
inline constexpr void Swap(tQuat<T> &other) noexcept(std::is_nothrow_move_constructible_v<tQuat<T>> && std::is_nothrow_move_assignable_v<tQuat<T>>)#
template<typename U>
constexpr TRAP::Math::tQuat<T> &operator=(const tQuat<U> &q) noexcept#
template<typename U>
constexpr TRAP::Math::tQuat<T> &operator+=(const tQuat<U> &q) noexcept#
template<typename U>
constexpr TRAP::Math::tQuat<T> &operator-=(const tQuat<U> &q) noexcept#
template<typename U>
constexpr TRAP::Math::tQuat<T> &operator*=(const tQuat<U> &r) noexcept#
template<typename U>
constexpr TRAP::Math::tQuat<T> &operator*=(const U s) noexcept#
template<typename U>
constexpr TRAP::Math::tQuat<T> &operator/=(const U s) noexcept#

Public Static Functions

static constexpr usize Length() noexcept#

Retrieve the count of components of a quaternion.

Returns:

Count.