20 #ifndef ANTKEEPER_MATH_TRANSFORM_HPP
21 #define ANTKEEPER_MATH_TRANSFORM_HPP
64 [[nodiscard]] constexpr
explicit operator matrix_type() const noexcept
101 [[nodiscard]]
inline constexpr
explicit operator transform<U>() const noexcept
119 [[nodiscard]] transform<T>
inverse(
const transform<T>& t) noexcept;
130 [[nodiscard]] transform<T>
mul(
const transform<T>& x,
const transform<T>& y);
141 [[nodiscard]] constexpr vector<T, 3>
mul(
const transform<T>& t,
const vector<T, 3>& v) noexcept;
152 [[nodiscard]] constexpr vector<T, 3>
mul(
const vector<T, 3>& v,
const transform<T>& t) noexcept;
157 return {-t.translation * t.rotation,
conjugate(t.rotation), T{1} / t.scale};
165 mul(x, y.translation),
174 return t.translation + t.rotation * (t.scale * v);
183 namespace operators {
constexpr matrix< T, P, M > operator*(const matrix< T, N, M > &a, const matrix< T, P, N > &b) noexcept
Multiplies two matrices.
constexpr matrix< T, N, N > & operator*=(matrix< T, N, N > &a, const matrix< T, N, N > &b) noexcept
Multiplies two values and stores the result in the first value.
Mathematical functions and data types.
constexpr matrix< T, P, M > mul(const matrix< T, N, M > &a, const matrix< T, P, N > &b) noexcept
Multiplies two matrices.
quaternion< T > normalize(const quaternion< T > &q)
Normalizes a quaternion.
constexpr quaternion< T > conjugate(const quaternion< T > &q) noexcept
Calculates the conjugate of a quaternion.
constexpr matrix< T, N, N > inverse(const matrix< T, N, N > &m) noexcept
Calculates the inverse of a square matrix.
n by m column-major matrix.
Quaternion composed of a real scalar part and imaginary vector part.
static constexpr quaternion identity() noexcept
Returns a rotation identity quaternion.
static constexpr vector zero() noexcept
Returns a zero vector, where every element is equal to zero.
static constexpr vector one() noexcept
Returns a vector of ones, where every element is equal to one.