45 static inline const constexpr TFacing<T> facingConvention{
79 Math::decompose(matrix, scale, rotation, position, skew,
perspective);
91 : position(position), rotation(rotation), scale(scale) {}
104 return translationMatrix * rotationMatrix * scaleMatrix;
114 [[nodiscard]]
constexpr explicit operator TMatrix4<T>() const noexcept {
return getMatrix(); }
135 return normalize(rotationMatrix[2]);
144 facing.
front = rotationMatrix[2];
147 facing.
up = rotationMatrix[1];
150 facing.
right = rotationMatrix[0];
159 return normalize(rotationMatrix[2]);
168 return normalize(rotationMatrix[1]);
177 return normalize(rotationMatrix[0]);
192 return TTransform(position, quaternion * rotation, scale);
197 return rotating(angleAxis(
angle.raw, axis));
223 return TTransform(lhs.getMatrix() * rhs.getMatrix());
240 using O = CeresEngine::Math::TTransform<T>;
241 size_t operator()(
const O& transform)
const {
243 return hash(transform.position.x, transform.position.y, transform.position.z, transform.rotation.x, transform.rotation.y, transform.rotation.z,
244 transform.rotation.w, transform.scale.x, transform.scale.y, transform.scale.z);
Definition Application.hpp:19
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25
TMatrix4< double > Matrix4
A 4x4 matrix matrix. Data is internally represented as double.
Definition Matrix.hpp:58
glm::qua< T, glm::highp > TQuaternion
A quaternion type that uses a internal representation of type T
Definition Quaternion.hpp:23
TVector3< double > Vector3
A three dimensional vector with (x, y, z) coordinates.
Definition Vector.hpp:84
TMatrix< 3, 3, T > TMatrix3
A 3x3 type that uses a internal representation of type T
Definition Matrix.hpp:41
TMatrix< 4, 4, T > TMatrix4
A 4x4 type that uses a internal representation of type T
Definition Matrix.hpp:54
T angle(const TVector2< T > &v1, const TVector2< T > &v2)
Definition Math.hpp:670
TVector< 4, T > TVector4
A four dimensional vector type that uses a internal representation of type T
Definition Vector.hpp:115
constexpr TMatrix4< T > perspective(T fovy, T aspect, T zNear, T zFar) noexcept
Creates a matrix for a symetric perspective-view frustum based on the default handedness and default ...
Definition Math.hpp:170
TVector< 3, T > TVector3
A three dimensional vector type that uses a internal representation of type T
Definition Vector.hpp:80
A structure that describes orthogonal directions.
Definition Transform.hpp:23
TVector3< T > right
The right facing direction vector.
Definition Transform.hpp:37
TVector3< T > up
The up facing direction vector.
Definition Transform.hpp:31
TVector3< T > down
The down facing direction vector.
Definition Transform.hpp:34
TVector3< T > left
The left facing direction vector.
Definition Transform.hpp:40
TVector3< T > front
The front facing direction vector.
Definition Transform.hpp:25
TVector3< T > back
The back facing direction vector.
Definition Transform.hpp:28
Wrapper class which indicates a given angle value is in radians.
Definition Angle.hpp:125