8#ifndef META_OCEAN_MATH_HOMOGENOUS_MATRIX_4_H
9#define META_OCEAN_MATH_HOMOGENOUS_MATRIX_4_H
25template <
typename T>
class EulerT;
28template <
typename T>
class RotationT;
31template <
typename T>
class SquareMatrixT4;
34template <
typename T>
class QuaternionT;
37template <
typename T>
class HomogenousMatrixT4;
139 template <
typename U>
154 template <
typename U>
169 template <
typename U>
529 inline
void copyElements(T* arrayValues, const
bool valuesRowAligned = false) const;
536 template <typename U>
537 inline
void copyElements(U* arrayValues, const
bool valuesRowAligned = false) const;
635 inline T operator[](const
unsigned int index) const;
642 inline T& operator[](const
unsigned int index);
650 inline T operator()(const
unsigned int row, const
unsigned int column) const;
658 inline T& operator()(const
unsigned int row, const
unsigned int column);
665 inline T operator()(const
unsigned int index) const;
672 inline T& operator()(const
unsigned int index);
678 inline const T* operator()() const;
684 inline T* operator()();
699 template <typename U>
709 template <typename U>
728 for (
unsigned int n = 0u; n < 16u; ++n)
763 for (
unsigned int n = 0u; n < 16u; ++n)
776 for (
unsigned int n = 0u; n < 16u; ++n)
778 values_[n] = T(arrayValues[n]);
785 memcpy(
values_, arrayValues,
sizeof(T) * 16);
792 ocean_assert(arrayValues);
794 if (valuesRowAligned)
796 values_[ 0] = T(arrayValues[ 0]);
797 values_[ 1] = T(arrayValues[ 4]);
798 values_[ 2] = T(arrayValues[ 8]);
799 values_[ 3] = T(arrayValues[12]);
800 values_[ 4] = T(arrayValues[ 1]);
801 values_[ 5] = T(arrayValues[ 5]);
802 values_[ 6] = T(arrayValues[ 9]);
803 values_[ 7] = T(arrayValues[13]);
804 values_[ 8] = T(arrayValues[ 2]);
805 values_[ 9] = T(arrayValues[ 6]);
806 values_[10] = T(arrayValues[10]);
807 values_[11] = T(arrayValues[14]);
808 values_[12] = T(arrayValues[ 3]);
809 values_[13] = T(arrayValues[ 7]);
810 values_[14] = T(arrayValues[11]);
811 values_[15] = T(arrayValues[15]);
815 for (
unsigned int n = 0u; n < 16u; ++n)
817 values_[n] = T(arrayValues[n]);
825 ocean_assert(arrayValues);
827 if (valuesRowAligned)
848 memcpy(
values_, arrayValues,
sizeof(T) * 16);
997 memcpy(
values_, matrix(),
sizeof(T) * 16);
1002template <
typename T>
1032template <
typename T>
1035 ocean_assert(translationAndRotation.second.isValid());
1052 values_[12] = translationAndRotation.first[0];
1053 values_[13] = translationAndRotation.first[1];
1054 values_[14] = translationAndRotation.first[2];
1062template <
typename T>
1065 ocean_assert(euler.
isValid());
1092template <
typename T>
1122template <
typename T>
1125 ocean_assert(translationAndRotation.second.isValid());
1142 values_[12] = translationAndRotation.first[0];
1143 values_[13] = translationAndRotation.first[1];
1144 values_[14] = translationAndRotation.first[2];
1152template <
typename T>
1178template <
typename T>
1204template <
typename T>
1235template <
typename T>
1250 shearMatrix(0, 1) = shear(0);
1251 shearMatrix(0, 2) = shear(1);
1252 shearMatrix(1, 2) = shear(2);
1253 *
this = *
this * shearMatrix;
1262template <
typename T>
1273 shearMatrix(0, 1) = shear(0);
1274 shearMatrix(0, 2) = shear(1);
1275 shearMatrix(1, 2) = shear(2);
1276 *
this = *
this * shearMatrix;
1285template <
typename T>
1301template <
typename T>
1327template <
typename T>
1353template <
typename T>
1360template <
typename T>
1367template <
typename T>
1374template <
typename T>
1381template <
typename T>
1388template <
typename T>
1400template <
typename T>
1432 const T invScaleY = T(1) /
scale.y();
1437 shear(0) *= invScaleY;
1455 const T invScaleZ = T(1) /
scale.z();
1460 shear(1) *= invScaleZ;
1461 shear(2) *= invScaleZ;
1486template <
typename T>
1496template <
typename T>
1531template <
typename T>
1538template <
typename T>
1568template <
typename T>
1575 if (!
invert(invertedMatrix))
1577 ocean_assert(
false &&
"Could not invert the matrix.");
1581 return invertedMatrix;
1584template <
typename T>
1589 if (!
invert(invertedMatrix))
1594 *
this = invertedMatrix;
1599template <
typename T>
1611 const T factor = T(1.0) / det;
1627 invertedMatrix.
values_[3] = T(0.0);
1628 invertedMatrix.
values_[7] = T(0.0);
1629 invertedMatrix.
values_[11] = T(0.0);
1630 invertedMatrix.
values_[15] = T(1.0);
1635template <
typename T>
1643template <
typename T>
1650template <
typename T>
1660template <
typename T>
1668 const T cosValue1 = T(1.0) - cosValue;
1673 const T xx = axis.
x() * axis.
x() * cosValue1;
1674 const T yy = axis.
y() * axis.
y() * cosValue1;
1675 const T zz = axis.
z() * axis.
z() * cosValue1;
1676 const T xy = axis.
x() * axis.
y() * cosValue1;
1677 const T xz = axis.
x() * axis.
z() * cosValue1;
1678 const T yz = axis.
y() * axis.
z() * cosValue1;
1680 const T nx = axis.
x() * sinValue;
1681 const T ny = axis.
y() * sinValue;
1682 const T nz = axis.
z() * sinValue;
1700template <
typename T>
1703 ocean_assert(quaternion.
isValid());
1705 const T xx = quaternion.
x() * quaternion.
x();
1706 const T yy = quaternion.
y() * quaternion.
y();
1707 const T zz = quaternion.
z() * quaternion.
z();
1709 const T wx = quaternion.
w() * quaternion.
x();
1710 const T wy = quaternion.
w() * quaternion.
y();
1711 const T wz = quaternion.
w() * quaternion.
z();
1712 const T xy = quaternion.
x() * quaternion.
y();
1713 const T xz = quaternion.
x() * quaternion.
z();
1714 const T yz = quaternion.
y() * quaternion.
z();
1716 values_[ 0] = T(1.0) - T(2.0) * (yy + zz);
1717 values_[ 1] = T(2.0) * (wz + xy);
1718 values_[ 2] = T(2.0) * (xz - wy);
1720 values_[ 4] = T(2.0) * (xy - wz);
1721 values_[ 5] = T(1.0) - T(2.0) * (xx + zz);
1722 values_[ 6] = T(2.0) * (wx + yz);
1724 values_[ 8] = T(2.0) * (wy + xz);
1725 values_[ 9] = T(2.0) * (yz - wx);
1726 values_[10] = T(1.0) - T(2.0) * (xx + yy);
1732template <
typename T>
1735 memcpy(
values_, matrix(),
sizeof(T) * 3);
1736 memcpy(
values_ + 4, matrix() + 3,
sizeof(T) * 3);
1737 memcpy(
values_ + 8, matrix() + 6,
sizeof(T) * 3);
1742template <
typename T>
1762template <
typename T>
1788template <
typename T>
1791 for (
unsigned int n = 0u; n < 16u; ++n)
1799template <
typename T>
1805template <
typename T>
1814template <
typename T>
1827template <
typename T>
1836template <
typename T>
1842template <
typename T>
1848template <
typename T>
1851 ocean_assert(arrayValues !=
nullptr);
1853 if (valuesRowAligned)
1857 arrayValues[ 0] =
values_[ 0];
1858 arrayValues[ 1] =
values_[ 4];
1859 arrayValues[ 2] =
values_[ 8];
1860 arrayValues[ 3] =
values_[12];
1862 arrayValues[ 4] =
values_[ 1];
1863 arrayValues[ 5] =
values_[ 5];
1864 arrayValues[ 6] =
values_[ 9];
1865 arrayValues[ 7] =
values_[13];
1867 arrayValues[ 8] =
values_[ 2];
1868 arrayValues[ 9] =
values_[ 6];
1869 arrayValues[10] =
values_[10];
1870 arrayValues[11] =
values_[14];
1872 arrayValues[12] =
values_[ 3];
1873 arrayValues[13] =
values_[ 7];
1874 arrayValues[14] =
values_[11];
1875 arrayValues[15] =
values_[15];
1882 memcpy(arrayValues,
values_,
sizeof(T) * 16);
1886template <
typename T>
1887template <
typename U>
1890 ocean_assert(arrayValues !=
nullptr);
1892 if (valuesRowAligned)
1896 arrayValues[ 0] = U(
values_[ 0]);
1897 arrayValues[ 1] = U(
values_[ 4]);
1898 arrayValues[ 2] = U(
values_[ 8]);
1899 arrayValues[ 3] = U(
values_[12]);
1901 arrayValues[ 4] = U(
values_[ 1]);
1902 arrayValues[ 5] = U(
values_[ 5]);
1903 arrayValues[ 6] = U(
values_[ 9]);
1904 arrayValues[ 7] = U(
values_[13]);
1906 arrayValues[ 8] = U(
values_[ 2]);
1907 arrayValues[ 9] = U(
values_[ 6]);
1908 arrayValues[10] = U(
values_[10]);
1909 arrayValues[11] = U(
values_[14]);
1911 arrayValues[12] = U(
values_[ 3]);
1912 arrayValues[13] = U(
values_[ 7]);
1913 arrayValues[14] = U(
values_[11]);
1914 arrayValues[15] = U(
values_[15]);
1921 for (
unsigned int n = 0u; n < 16u; ++n)
1923 arrayValues[n] = U(
values_[n]);
1928template <
typename T>
1938template <
typename T>
1948template <
typename T>
1954template <
typename T>
1957 return !(*
this == matrix);
1960template <
typename T>
1987 ocean_assert(result.
isValid());
1992template <
typename T>
1995 *
this = *
this * matrix;
1999template <
typename T>
2006template <
typename T>
2013template <
typename T>
2019template <
typename T>
2026template <
typename T>
2036template <
typename T>
2047template <
typename T>
2050 ocean_assert(index < 16);
2054template <
typename T>
2057 ocean_assert(index < 16u);
2061template <
typename T>
2064 ocean_assert(row < 4u && column < 4u);
2065 return values_[column * 4u + row];
2068template <
typename T>
2071 ocean_assert(row < 4u && column < 4u);
2072 return values_[column * 4u + row];
2075template <
typename T>
2078 ocean_assert(index < 16u);
2082template <
typename T>
2085 ocean_assert(index < 16u);
2089template <
typename T>
2095template <
typename T>
2101template <
typename T>
2106 size_t seed = std::hash<T>{}(matrix.
values_[0]);
2107 seed ^= std::hash<T>{}(matrix.
values_[1]) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
2108 seed ^= std::hash<T>{}(matrix.
values_[2]) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
2110 seed ^= std::hash<T>{}(matrix.
values_[4]) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
2111 seed ^= std::hash<T>{}(matrix.
values_[5]) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
2112 seed ^= std::hash<T>{}(matrix.
values_[6]) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
2114 seed ^= std::hash<T>{}(matrix.
values_[8]) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
2115 seed ^= std::hash<T>{}(matrix.
values_[9]) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
2116 seed ^= std::hash<T>{}(matrix.
values_[10]) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
2118 seed ^= std::hash<T>{}(matrix.
values_[12]) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
2119 seed ^= std::hash<T>{}(matrix.
values_[13]) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
2120 seed ^= std::hash<T>{}(matrix.
values_[14]) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
2125template <
typename T>
2126template <
typename U>
2129 std::vector< HomogenousMatrixT4<T> > result;
2130 result.reserve(matrices.size());
2132 for (
typename std::vector<
HomogenousMatrixT4<U> >::const_iterator i = matrices.begin(); i != matrices.end(); ++i)
2154template <
typename T>
2155template <
typename U>
2158 std::vector< HomogenousMatrixT4<T> > result;
2159 result.reserve(size);
2161 for (
size_t n = 0; n < size; ++n)
2169template <
typename T>
2172 stream <<
"|" << matrix(0, 0) <<
", " << matrix(0, 1) <<
", " << matrix(0, 2) <<
", " << matrix(0, 3) <<
"|" << std::endl;
2173 stream <<
"|" << matrix(1, 0) <<
", " << matrix(1, 1) <<
", " << matrix(1, 2) <<
", " << matrix(1, 3) <<
"|" << std::endl;
2174 stream <<
"|" << matrix(2, 0) <<
", " << matrix(2, 1) <<
", " << matrix(2, 2) <<
", " << matrix(2, 3) <<
"|" << std::endl;
2175 stream <<
"|" << matrix(3, 0) <<
", " << matrix(3, 1) <<
", " << matrix(3, 2) <<
", " << matrix(3, 3) <<
"|";
2180template <
bool tActive,
typename T>
2181MessageObject<tActive>&
operator<<(MessageObject<tActive>& messageObject,
const HomogenousMatrixT4<T>& matrix)
2183 return messageObject <<
"|" << matrix(0, 0) <<
", " << matrix(0, 1) <<
", " << matrix(0, 2) <<
", " << matrix(0, 3) <<
"|\n|"
2184 << matrix(1, 0) <<
", " << matrix(1, 1) <<
", " << matrix(1, 2) <<
", " << matrix(1, 3) <<
"|\n|"
2185 << matrix(2, 0) <<
", " << matrix(2, 1) <<
", " << matrix(2, 2) <<
", " << matrix(2, 3) <<
"|\n|"
2186 << matrix(3, 0) <<
", " << matrix(3, 1) <<
", " << matrix(3, 2) <<
", " << matrix(3, 3) <<
"|";
2189template <
bool tActive,
typename T>
2190MessageObject<tActive>&
operator<<(MessageObject<tActive>&& messageObject,
const HomogenousMatrixT4<T>& matrix)
2192 return messageObject <<
"|" << matrix(0, 0) <<
", " << matrix(0, 1) <<
", " << matrix(0, 2) <<
", " << matrix(0, 3) <<
"|\n|"
2193 << matrix(1, 0) <<
", " << matrix(1, 1) <<
", " << matrix(1, 2) <<
", " << matrix(1, 3) <<
"|\n|"
2194 << matrix(2, 0) <<
", " << matrix(2, 1) <<
", " << matrix(2, 2) <<
", " << matrix(2, 3) <<
"|\n|"
2195 << matrix(3, 0) <<
", " << matrix(3, 1) <<
", " << matrix(3, 2) <<
", " << matrix(3, 3) <<
"|";
This class implements an euler rotation with angles: yaw, pitch and roll.
Definition Euler.h:82
bool isValid() const
Returns whether the euler rotation holds valid parameters.
Definition Euler.h:360
HomogenousMatrixT4()
Creates a new default HomogenousMatrixT4 object with undefined elements.
Definition HomogenousMatrix4.h:719
bool invert()
Inverts the matrix.
Definition HomogenousMatrix4.h:1585
const T * data() const
Returns a pointer to the internal values.
Definition HomogenousMatrix4.h:1837
HomogenousMatrixT4(const U *arrayValues, const bool valuesRowAligned)
Creates a new HomogenousMatrixT4 object by an array of at least sixteen elements of float type U.
Definition HomogenousMatrix4.h:790
friend class HomogenousMatrixT4
Definition HomogenousMatrix4.h:111
HomogenousMatrixT4(const EulerT< T > &euler)
Creates a new HomogenousMatrixT4 object with only a rotation given as Euler rotation.
Definition HomogenousMatrix4.h:909
HomogenousMatrixT4(const VectorT3< T > &translation, const QuaternionT< T > &rotation, const VectorT3< T > &scale)
Creates a new HomogenousMatrixT4 object by a translation, rotation and scale.
Definition HomogenousMatrix4.h:1286
HomogenousMatrixT4(const SquareMatrixT4< T > &matrix)
Creates a new HomogenousMatrixT4 object from a 4x4 square matrix.
Definition HomogenousMatrix4.h:995
HomogenousMatrixT4< T > inverted() const noexcept
Returns the inverted of this matrix.
Definition HomogenousMatrix4.h:1569
HomogenousMatrixT4(const HomogenousMatrixT4< T > &matrix)=default
Copy constructor.
VectorT3< T > scale() const
Returns the scale of the transformation.
Definition HomogenousMatrix4.h:1389
HomogenousMatrixT4< T > & setRotation(const RotationT< T > &rotation)
Sets the rotation of this transformation.
Definition HomogenousMatrix4.h:1661
VectorT3< T > transposedRotationMatrix(const VectorT3< T > &vector) const
Transforms a 3D vector by application of only the inner transposed rotation matrix (including scale a...
Definition HomogenousMatrix4.h:1939
SquareMatrixT3< T > rotationMatrix() const
Returns the rotation matrix of the transformation.
Definition HomogenousMatrix4.h:1487
void copyElements(T *arrayValues, const bool valuesRowAligned=false) const
Copies the elements of this matrix to an array with floating point values of the same type T.
Definition HomogenousMatrix4.h:1849
HomogenousMatrixT4(const VectorT3< T > &translation)
Creates a new HomogenousMatrixT4 object with only a translation.
Definition HomogenousMatrix4.h:853
T trace() const
Returns the trace of the matrix which is the sum of the diagonal elements.
Definition HomogenousMatrix4.h:1644
HomogenousMatrixT4(const T *arrayValues, const bool valuesRowAligned)
Creates a new HomogenousMatrixT4 object by an array of at least sixteen elements.
Definition HomogenousMatrix4.h:823
HomogenousMatrixT4(const VectorT3< T > &translation, const VectorT3< T > &scale)
Creates a new HomogenousMatrixT4 object by a translation and a scale.
Definition HomogenousMatrix4.h:1179
VectorT3< T > yAxis() const
Returns the y-axis of the transformation which is the second vector of the upper left 3x3 rotation ma...
Definition HomogenousMatrix4.h:1361
HomogenousMatrixT4< T > & applyScale(const VectorT3< T > &scale)
Applies new scale values.
Definition HomogenousMatrix4.h:1743
static std::vector< HomogenousMatrixT4< T > > matrices2matrices(const std::vector< HomogenousMatrixT4< U > > &matrices)
Converts matrices with specific data type to matrices with different data type.
Definition HomogenousMatrix4.h:2127
HomogenousMatrixT4(const VectorT3< T > &translation, const SquareMatrixT3< T > &rotation)
Creates a new HomogenousMatrixT4 object with a translation and rotation matrix.
Definition HomogenousMatrix4.h:1153
T values_[16]
The sixteen values of the transformation matrix.
Definition HomogenousMatrix4.h:715
HomogenousMatrixT4(const std::pair< VectorT3< T >, RotationT< T > > &translationAndRotation)
Creates a new HomogenousMatrixT4 object with a translation and rotation.
Definition HomogenousMatrix4.h:1033
HomogenousMatrixT4< T > & setTranslation(const VectorT3< T > &translation)
Sets the translation of this transformation.
Definition HomogenousMatrix4.h:1651
T operator[](const unsigned int index) const
Element operator.
Definition HomogenousMatrix4.h:2048
void toNull()
Sets the matrix to a zero matrix (including the lower right element).
Definition HomogenousMatrix4.h:1789
HomogenousMatrixT4(const VectorT3< T > &translation, const RotationT< T > &rotation, const VectorT3< T > &scale)
Creates a new HomogenousMatrixT4 object by a translation, rotation and scale.
Definition HomogenousMatrix4.h:1205
HomogenousMatrixT4< T > & operator*=(const HomogenousMatrixT4< T > &matrix)
Combines and assigns two transformation matrices.
Definition HomogenousMatrix4.h:1993
T determinant() const
Returns the determinant of the matrix.
Definition HomogenousMatrix4.h:1636
HomogenousMatrixT4(const QuaternionT< T > &rotation)
Creates a new HomogenousMatrixT4 object with only a rotation given as quaternion.
Definition HomogenousMatrix4.h:939
HomogenousMatrixT4(const VectorT3< T > &translation, const EulerT< T > &euler)
Creates a new HomogenousMatrixT4 object with a translation and rotation.
Definition HomogenousMatrix4.h:1063
HomogenousMatrixT4(const VectorT3< T > &xAxis, const VectorT3< T > &yAxis, const VectorT3< T > &zAxis)
Creates a new HomogenousMatrixT4 object by three basis vectors.
Definition HomogenousMatrix4.h:1302
bool isNull() const
Returns whether this matrix is a zero matrix (with all elements equal to zero).
Definition HomogenousMatrix4.h:1828
void rotationMatrix(T *data, const bool transposed=false) const
Copies the 3x3 rotation matrix elements of the 4x4 transformation.
Definition HomogenousMatrix4.h:1497
VectorT3< T > xAxis() const
Returns the x-axis of the transformation which is the first vector of the upper left 3x3 rotation mat...
Definition HomogenousMatrix4.h:1354
HomogenousMatrixT4(const RotationT< T > &rotation)
Creates a new HomogenousMatrixT4 object with only a rotation.
Definition HomogenousMatrix4.h:879
HomogenousMatrixT4(const VectorT3< T > &translation, const QuaternionT< T > &rotation)
Creates a new HomogenousMatrixT4 object with a translation and rotation.
Definition HomogenousMatrix4.h:1093
VectorT3< T > translation() const
Returns the translation of the transformation.
Definition HomogenousMatrix4.h:1375
bool isValid() const
Returns whether this matrix is a valid homogeneous transformation.
Definition HomogenousMatrix4.h:1800
HomogenousMatrixT4(const VectorT3< T > &translation, const RotationT< T > &rotation, const VectorT3< T > &scale, const VectorT3< T > &shear)
Creates a new HomogenousMatrixT4 object by a translation, rotation, scale and shear.
Definition HomogenousMatrix4.h:1263
bool decompose(VectorT3< T > &translation, QuaternionT< T > &rotation, VectorT3< T > &scale, VectorT3< T > &shear) const
Decomposes the transformation matrix into translation, rotation, scale and shear parameters.
Definition HomogenousMatrix4.h:1401
HomogenousMatrixT4< T > operator*(const HomogenousMatrixT4< T > &matrix) const
Combines two transformation matrices.
Definition HomogenousMatrix4.h:1961
HomogenousMatrixT4(const U *arrayValues)
Creates a new HomogenousMatrixT4 object by 16 given floating point values of type U.
Definition HomogenousMatrix4.h:774
QuaternionT< T > rotation() const
Returns the rotation of the transformation as quaternion.
Definition HomogenousMatrix4.h:1382
T Type
Definition of the used data type.
Definition HomogenousMatrix4.h:118
bool operator!=(const HomogenousMatrixT4< T > &matrix) const
Returns whether two transformations are not identical up to a small epsilon.
Definition HomogenousMatrix4.h:1955
void toIdentity()
Sets the matrix to the identity matrix.
Definition HomogenousMatrix4.h:1763
bool operator==(const HomogenousMatrixT4< T > &matrix) const
Returns whether two transformations are identical up to a small epsilon.
Definition HomogenousMatrix4.h:1949
bool isIdentity() const
Returns whether this matrix is an identity matrix.
Definition HomogenousMatrix4.h:1806
bool isEqual(const HomogenousMatrixT4< T > &matrix, const T epsilon=NumericT< T >::eps()) const
Returns whether two matrices are almost identical up to a specified epsilon.
Definition HomogenousMatrix4.h:1815
HomogenousMatrixT4(const SquareMatrixT3< T > &rotation)
Creates a new HomogenousMatrixT4 object with only a rotation given as 3x3 rotation matrix.
Definition HomogenousMatrix4.h:969
HomogenousMatrixT4(const VectorT3< T > &translation, const RotationT< T > &rotation)
Creates a new HomogenousMatrixT4 object with a translation and rotation.
Definition HomogenousMatrix4.h:1003
SquareMatrixT4< T > transposed() const
Returns the transposed of this matrix.
Definition HomogenousMatrix4.h:1539
SquareMatrixT3< T > orthonormalRotationMatrix() const
Returns the 3x3 orthonormal rotation matrix of the 4x4 transformation (by forcing a orthogonal and no...
Definition HomogenousMatrix4.h:1532
HomogenousMatrixT4(const bool setToIdentity)
Creates a new HomogenousMatrixT4.
Definition HomogenousMatrix4.h:735
HomogenousMatrixT4(const VectorT3< T > &xAxis, const VectorT3< T > &yAxis, const VectorT3< T > &zAxis, const VectorT3< T > &translation)
Creates a new HomogenousMatrixT4 object by three basis vectors and a translation vector.
Definition HomogenousMatrix4.h:1328
HomogenousMatrixT4(const std::pair< VectorT3< T >, QuaternionT< T > > &translationAndRotation)
Creates a new HomogenousMatrixT4 object with a translation and rotation.
Definition HomogenousMatrix4.h:1123
const T * operator()() const
Access operator.
Definition HomogenousMatrix4.h:2090
HomogenousMatrixT4(const HomogenousMatrixT4< U > &matrix)
Copy constructor for a matrix with difference element data type than T.
Definition HomogenousMatrix4.h:726
HomogenousMatrixT4(const VectorT3< T > &translation, const QuaternionT< T > &rotation, const VectorT3< T > &scale, const VectorT3< T > &shear)
Creates a new HomogenousMatrixT4 object by a translation, rotation, scale and shear.
Definition HomogenousMatrix4.h:1236
VectorT3< T > zAxis() const
Returns the z-axis of the transformation which is the third vector of the upper left 3x3 rotation mat...
Definition HomogenousMatrix4.h:1368
HomogenousMatrixT4(const T *arrayValues)
Creates a new HomogenousMatrixT4 object by 16 given floating point values.
Definition HomogenousMatrix4.h:783
This class provides basic numeric functionalities.
Definition Numeric.h:57
static constexpr T weakEps()
Returns a weak epsilon.
static T sin(const T value)
Returns the sine of a given value.
Definition Numeric.h:1572
static constexpr T eps()
Returns a small epsilon.
static bool isEqual(const T first, const T second)
Returns whether two values are equal up to a small epsilon.
Definition Numeric.h:2395
static constexpr bool isEqualEps(const T value)
Returns whether a value is smaller than or equal to a small epsilon.
Definition Numeric.h:2096
static T cos(const T value)
Returns the cosine of a given value.
Definition Numeric.h:1588
This class implements a unit quaternion rotation.
Definition Quaternion.h:100
const T & x() const
Returns the x value of the quaternion.
Definition Quaternion.h:900
bool isValid() const
Returns whether this quaternion is a valid unit quaternion.
Definition Quaternion.h:882
const T & w() const
Returns the w value of the quaternion.
Definition Quaternion.h:888
const T & y() const
Returns the y value of the quaternion.
Definition Quaternion.h:912
const T & z() const
Returns the z value of the quaternion.
Definition Quaternion.h:924
This class implements a axis-angle rotation using floating point values.
Definition Rotation.h:73
This class implements a 3x3 square matrix.
Definition SquareMatrix3.h:89
This class implements a 4x4 square matrix.
Definition SquareMatrix4.h:85
SquareMatrixT4< T > transposed() const
Returns the transposed of this matrix.
Definition SquareMatrix4.h:762
This class implements a vector with three elements.
Definition Vector3.h:97
const T & y() const noexcept
Returns the y value.
Definition Vector3.h:816
const T & x() const noexcept
Returns the x value.
Definition Vector3.h:804
const T & z() const noexcept
Returns the z value.
Definition Vector3.h:828
T length() const
Returns the length of the vector.
Definition Vector3.h:668
This class implements a vector with four elements.
Definition Vector4.h:97
std::vector< HomogenousMatrixT4< T > > HomogenousMatricesT4
Definition of a typename alias for vectors with HomogenousMatrixT4 objects.
Definition HomogenousMatrix4.h:66
std::vector< HomogenousMatrix4 > HomogenousMatrices4
Definition of a vector holding HomogenousMatrix4 objects.
Definition HomogenousMatrix4.h:73
std::vector< HomogenousMatrixF4 > HomogenousMatricesF4
Definition of a vector holding HomogenousMatrixF4 objects.
Definition HomogenousMatrix4.h:85
std::vector< HomogenousMatrixD4 > HomogenousMatricesD4
Definition of a vector holding HomogenousMatrixD4 objects.
Definition HomogenousMatrix4.h:79
The namespace covering the entire Ocean framework.
Definition Accessor.h:15
std::ostream & operator<<(std::ostream &stream, const HighPerformanceStatistic &highPerformanceStatistic)
Definition HighPerformanceTimer.h:963