11 template <
typename T =
double>
34 constexpr T
length()
const;
42 #define DEFINE_QUATERNION_ACCESS(name, rows) \ 43 const T& name() const { \ 44 return (*this)[rows]; \ 48 return (*this)[rows]; \ 63 #undef DEFINE_QUATERNION_ACCESS 67 static Quaternion<T>
fromAxes(
const Vector<3, T>& xAxis,
const Vector<3, T>& yAxis,
const Vector<3, T>& zAxis);
75 using Quatf = Quaternion<float>;
78 using Quatd = Quaternion<double>;
103 template <
typename T>
106 template <
typename T>
109 template <
typename T>
112 template <
typename T>
115 template <
typename T>
118 template <
typename T>
121 template <
typename T>
122 std::ostream& operator<<(std::ostream& os, const Quaternion<T>& quaternion);
bool operator!=(const Matrix< Rows, Columns, T > &lhs, const Matrix< Rows, Columns, T > &rhs)
bool operator==(const Matrix< Rows, Columns, T > &lhs, const Matrix< Rows, Columns, T > &rhs)
T & operator[](std::size_t idx)
static Quaternion< T > fromAxes(const Vector< 3, T > &xAxis, const Vector< 3, T > &yAxis, const Vector< 3, T > &zAxis)
Matrix< Rows, Columns, T > operator-(const Matrix< Rows, Columns, T > &lhs)
Quaternion< T > & operator=(const Quaternion< T > &)=default
static Quaternion< T > identity()
Vector< 3, T > getAxis() const
Mat4x4< T > transform() const
Quaternion< T > directionTo(const Vector< 3, T > &original, const Vector< 3, T > &expected)
#define DEFINE_QUATERNION_ACCESS(name, rows)
constexpr T length() const
Matrix< Rows, Columns, T > operator+(const Matrix< Rows, Columns, T > &lhs, T rhs)
Matrix< Rows, Columns, T > operator/(const Matrix< Rows, Columns, T > &lhs, T rhs)
Matrix< Rows, Columns, T > operator*(const Matrix< Rows, Columns, T > &lhs, T rhs)
T dot(const Quaternion< T > &lhs, const Quaternion< T > &rhs)
constexpr T squaredLength() const
Quaternion< float > Quatf
static Quaternion< T > fromRotationMatrix(const Matrix< 4, 4, T > &rotMatrix)