1#ifndef TOPAZ_CORE_QUATERNION_HPP
2#define TOPAZ_CORE_QUATERNION_HPP
3#include "tz/core/vector.hpp"
4#include "tz/core/matrix.hpp"
17 return {
tz::v4f{0.0f, 0.0f, 0.0f, 1.0f}};
40 quat operator*(
const quat& rhs)
const{
auto cpy = *
this;
return cpy *= rhs;}
Represents the generic matrix.
Definition matrix.hpp:16
Quaternion. Represents a rotation in 3D space.
Definition quaternion.hpp:13
quat slerp(const quat &rhs, float factor) const
Retrieve a quaternion that represents a spherical interpolation between this quaternion and another,...
tz::v3f rotate(tz::v3f pos) const
Rotate a 3D position by this quaternion.
quat(tz::v4f vec)
Create a quaternion directly from xyzw components.
tz::m4f matrix() const
Create a rotation matrix that transforms identically to the quaternion.
static quat iden()
Retrieve the identity quaternion, that is - represents no transformation.
Definition quaternion.hpp:15
static quat from_axis_angle(tz::v3f axis, float angle)
Create a quaternion that represents a rotation about a certain axis.
static quat from_euler_angles(tz::v3f euler_angles)
Create a quaternion that represents a rotation equivalent to the provided euler angles.
quat normalise() const
Retrieve a normalised copy of the quaternion.
quat inverse() const
Create a quaternion that causes the inverse transformation. Such that the product of this and the res...
quat combine(const quat &rhs) const
Combine one quaternion with another, producing a result equal to applying both rotations.