8 #ifndef META_OCEAN_MATH_HOMOGENOUS_MATRIX_4_H
9 #define META_OCEAN_MATH_HOMOGENOUS_MATRIX_4_H
25 template <
typename T>
class EulerT;
28 template <
typename T>
class RotationT;
31 template <
typename T>
class SquareMatrixT4;
34 template <
typename T>
class QuaternionT;
37 template <
typename T>
class HomogenousMatrixT4;
108 template <
typename T>
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>
718 template <typename T>
724 template <
typename T>
730 template <
typename T>
731 template <
typename U>
734 for (
unsigned int n = 0u; n < 16u; ++n)
740 template <
typename T>
769 for (
unsigned int n = 0u; n < 16u; ++n)
778 template <
typename T>
779 template <
typename U>
782 for (
unsigned int n = 0u; n < 16u; ++n)
784 values_[n] = T(arrayValues[n]);
788 template <
typename T>
791 memcpy(
values_, arrayValues,
sizeof(T) * 16);
794 template <
typename T>
795 template <
typename U>
798 ocean_assert(arrayValues);
800 if (valuesRowAligned)
802 values_[ 0] = T(arrayValues[ 0]);
803 values_[ 1] = T(arrayValues[ 4]);
804 values_[ 2] = T(arrayValues[ 8]);
805 values_[ 3] = T(arrayValues[12]);
806 values_[ 4] = T(arrayValues[ 1]);
807 values_[ 5] = T(arrayValues[ 5]);
808 values_[ 6] = T(arrayValues[ 9]);
809 values_[ 7] = T(arrayValues[13]);
810 values_[ 8] = T(arrayValues[ 2]);
811 values_[ 9] = T(arrayValues[ 6]);
812 values_[10] = T(arrayValues[10]);
813 values_[11] = T(arrayValues[14]);
814 values_[12] = T(arrayValues[ 3]);
815 values_[13] = T(arrayValues[ 7]);
816 values_[14] = T(arrayValues[11]);
817 values_[15] = T(arrayValues[15]);
821 for (
unsigned int n = 0u; n < 16u; ++n)
823 values_[n] = T(arrayValues[n]);
828 template <
typename T>
831 ocean_assert(arrayValues);
833 if (valuesRowAligned)
854 memcpy(
values_, arrayValues,
sizeof(T) * 16);
858 template <
typename T>
884 template <
typename T>
914 template <
typename T>
944 template <
typename T>
974 template <
typename T>
1000 template <
typename T>
1003 memcpy(
values_, matrix(),
sizeof(T) * 16);
1008 template <
typename T>
1038 template <
typename T>
1041 ocean_assert(translationAndRotation.second.isValid());
1058 values_[12] = translationAndRotation.first[0];
1059 values_[13] = translationAndRotation.first[1];
1060 values_[14] = translationAndRotation.first[2];
1068 template <
typename T>
1071 ocean_assert(euler.
isValid());
1098 template <
typename T>
1128 template <
typename T>
1131 ocean_assert(translationAndRotation.second.isValid());
1148 values_[12] = translationAndRotation.first[0];
1149 values_[13] = translationAndRotation.first[1];
1150 values_[14] = translationAndRotation.first[2];
1158 template <
typename T>
1184 template <
typename T>
1210 template <
typename T>
1241 template <
typename T>
1256 shearMatrix(0, 1) = shear(0);
1257 shearMatrix(0, 2) = shear(1);
1258 shearMatrix(1, 2) = shear(2);
1259 *
this = *
this * shearMatrix;
1268 template <
typename T>
1279 shearMatrix(0, 1) = shear(0);
1280 shearMatrix(0, 2) = shear(1);
1281 shearMatrix(1, 2) = shear(2);
1282 *
this = *
this * shearMatrix;
1291 template <
typename T>
1307 template <
typename T>
1333 template <
typename T>
1359 template <
typename T>
1366 template <
typename T>
1373 template <
typename T>
1380 template <
typename T>
1387 template <
typename T>
1394 template <
typename T>
1406 template <
typename T>
1438 const T invScaleY = T(1) /
scale.y();
1443 shear(0) *= invScaleY;
1461 const T invScaleZ = T(1) /
scale.z();
1466 shear(1) *= invScaleZ;
1467 shear(2) *= invScaleZ;
1492 template <
typename T>
1502 template <
typename T>
1537 template <
typename T>
1544 template <
typename T>
1574 template <
typename T>
1581 if (!
invert(invertedMatrix))
1583 ocean_assert(
false &&
"Could not invert the matrix.");
1587 return invertedMatrix;
1590 template <
typename T>
1595 if (!
invert(invertedMatrix))
1600 *
this = invertedMatrix;
1605 template <
typename T>
1617 const T factor = T(1.0) / det;
1633 invertedMatrix.
values_[3] = T(0.0);
1634 invertedMatrix.
values_[7] = T(0.0);
1635 invertedMatrix.
values_[11] = T(0.0);
1636 invertedMatrix.
values_[15] = T(1.0);
1641 template <
typename T>
1649 template <
typename T>
1656 template <
typename T>
1666 template <
typename T>
1674 const T cosValue1 = T(1.0) - cosValue;
1679 const T xx = axis.
x() * axis.
x() * cosValue1;
1680 const T yy = axis.
y() * axis.
y() * cosValue1;
1681 const T zz = axis.
z() * axis.
z() * cosValue1;
1682 const T xy = axis.
x() * axis.
y() * cosValue1;
1683 const T xz = axis.
x() * axis.
z() * cosValue1;
1684 const T yz = axis.
y() * axis.
z() * cosValue1;
1686 const T nx = axis.
x() * sinValue;
1687 const T ny = axis.
y() * sinValue;
1688 const T nz = axis.
z() * sinValue;
1706 template <
typename T>
1709 ocean_assert(quaternion.
isValid());
1711 const T xx = quaternion.
x() * quaternion.
x();
1712 const T yy = quaternion.
y() * quaternion.
y();
1713 const T zz = quaternion.
z() * quaternion.
z();
1715 const T wx = quaternion.
w() * quaternion.
x();
1716 const T wy = quaternion.
w() * quaternion.
y();
1717 const T wz = quaternion.
w() * quaternion.
z();
1718 const T xy = quaternion.
x() * quaternion.
y();
1719 const T xz = quaternion.
x() * quaternion.
z();
1720 const T yz = quaternion.
y() * quaternion.
z();
1722 values_[ 0] = T(1.0) - T(2.0) * (yy + zz);
1723 values_[ 1] = T(2.0) * (wz + xy);
1724 values_[ 2] = T(2.0) * (xz - wy);
1726 values_[ 4] = T(2.0) * (xy - wz);
1727 values_[ 5] = T(1.0) - T(2.0) * (xx + zz);
1728 values_[ 6] = T(2.0) * (wx + yz);
1730 values_[ 8] = T(2.0) * (wy + xz);
1731 values_[ 9] = T(2.0) * (yz - wx);
1732 values_[10] = T(1.0) - T(2.0) * (xx + yy);
1738 template <
typename T>
1741 memcpy(
values_, matrix(),
sizeof(T) * 3);
1742 memcpy(
values_ + 4, matrix() + 3,
sizeof(T) * 3);
1743 memcpy(
values_ + 8, matrix() + 6,
sizeof(T) * 3);
1748 template <
typename T>
1768 template <
typename T>
1794 template <
typename T>
1797 for (
unsigned int n = 0u; n < 16u; ++n)
1805 template <
typename T>
1811 template <
typename T>
1820 template <
typename T>
1833 template <
typename T>
1842 template <
typename T>
1848 template <
typename T>
1854 template <
typename T>
1857 ocean_assert(arrayValues !=
nullptr);
1859 if (valuesRowAligned)
1864 arrayValues[ 0] =
values_[ 0];
1865 arrayValues[ 1] =
values_[ 4];
1866 arrayValues[ 2] =
values_[ 8];
1867 arrayValues[ 3] =
values_[12];
1869 arrayValues[ 4] =
values_[ 1];
1870 arrayValues[ 5] =
values_[ 5];
1871 arrayValues[ 6] =
values_[ 9];
1872 arrayValues[ 7] =
values_[13];
1874 arrayValues[ 8] =
values_[ 2];
1875 arrayValues[ 9] =
values_[ 6];
1876 arrayValues[10] =
values_[10];
1877 arrayValues[11] =
values_[14];
1879 arrayValues[12] =
values_[ 3];
1880 arrayValues[13] =
values_[ 7];
1881 arrayValues[14] =
values_[11];
1882 arrayValues[15] =
values_[15];
1889 memcpy(arrayValues,
values_,
sizeof(T) * 16);
1893 template <
typename T>
1894 template <
typename U>
1897 ocean_assert(arrayValues !=
nullptr);
1899 if (valuesRowAligned)
1904 arrayValues[ 0] = U(
values_[ 0]);
1905 arrayValues[ 1] = U(
values_[ 4]);
1906 arrayValues[ 2] = U(
values_[ 8]);
1907 arrayValues[ 3] = U(
values_[12]);
1909 arrayValues[ 4] = U(
values_[ 1]);
1910 arrayValues[ 5] = U(
values_[ 5]);
1911 arrayValues[ 6] = U(
values_[ 9]);
1912 arrayValues[ 7] = U(
values_[13]);
1914 arrayValues[ 8] = U(
values_[ 2]);
1915 arrayValues[ 9] = U(
values_[ 6]);
1916 arrayValues[10] = U(
values_[10]);
1917 arrayValues[11] = U(
values_[14]);
1919 arrayValues[12] = U(
values_[ 3]);
1920 arrayValues[13] = U(
values_[ 7]);
1921 arrayValues[14] = U(
values_[11]);
1922 arrayValues[15] = U(
values_[15]);
1929 for (
unsigned int n = 0u; n < 16u; ++n)
1931 arrayValues[n] = U(
values_[n]);
1936 template <
typename T>
1946 template <
typename T>
1956 template <
typename T>
1962 template <
typename T>
1965 return !(*
this == matrix);
1968 template <
typename T>
1995 ocean_assert(result.
isValid());
2000 template <
typename T>
2003 *
this = *
this * matrix;
2007 template <
typename T>
2014 template <
typename T>
2021 template <
typename T>
2027 template <
typename T>
2034 template <
typename T>
2044 template <
typename T>
2055 template <
typename T>
2058 ocean_assert(index < 16);
2062 template <
typename T>
2065 ocean_assert(index < 16u);
2069 template <
typename T>
2072 ocean_assert(row < 4u && column < 4u);
2073 return values_[column * 4u + row];
2076 template <
typename T>
2079 ocean_assert(row < 4u && column < 4u);
2080 return values_[column * 4u + row];
2083 template <
typename T>
2086 ocean_assert(index < 16u);
2090 template <
typename T>
2093 ocean_assert(index < 16u);
2097 template <
typename T>
2103 template <
typename T>
2109 template <
typename T>
2114 size_t seed = std::hash<T>{}(matrix.
values_[0]);
2115 seed ^= std::hash<T>{}(matrix.
values_[1]) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
2116 seed ^= std::hash<T>{}(matrix.
values_[2]) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
2118 seed ^= std::hash<T>{}(matrix.
values_[4]) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
2119 seed ^= std::hash<T>{}(matrix.
values_[5]) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
2120 seed ^= std::hash<T>{}(matrix.
values_[6]) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
2122 seed ^= std::hash<T>{}(matrix.
values_[8]) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
2123 seed ^= std::hash<T>{}(matrix.
values_[9]) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
2124 seed ^= std::hash<T>{}(matrix.
values_[10]) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
2126 seed ^= std::hash<T>{}(matrix.
values_[12]) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
2127 seed ^= std::hash<T>{}(matrix.
values_[13]) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
2128 seed ^= std::hash<T>{}(matrix.
values_[14]) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
2133 template <
typename T>
2134 template <
typename U>
2137 std::vector< HomogenousMatrixT4<T> > result;
2138 result.reserve(matrices.size());
2140 for (
typename std::vector<
HomogenousMatrixT4<U> >::const_iterator i = matrices.begin(); i != matrices.end(); ++i)
2162 template <
typename T>
2163 template <
typename U>
2166 std::vector< HomogenousMatrixT4<T> > result;
2167 result.reserve(size);
2169 for (
size_t n = 0; n < size; ++n)
2177 template <
typename T>
2180 stream <<
"|" << matrix(0, 0) <<
", " << matrix(0, 1) <<
", " << matrix(0, 2) <<
", " << matrix(0, 3) <<
"|" << std::endl;
2181 stream <<
"|" << matrix(1, 0) <<
", " << matrix(1, 1) <<
", " << matrix(1, 2) <<
", " << matrix(1, 3) <<
"|" << std::endl;
2182 stream <<
"|" << matrix(2, 0) <<
", " << matrix(2, 1) <<
", " << matrix(2, 2) <<
", " << matrix(2, 3) <<
"|" << std::endl;
2183 stream <<
"|" << matrix(3, 0) <<
", " << matrix(3, 1) <<
", " << matrix(3, 2) <<
", " << matrix(3, 3) <<
"|";
2188 template <
bool tActive,
typename T>
2189 MessageObject<tActive>&
operator<<(MessageObject<tActive>& messageObject,
const HomogenousMatrixT4<T>& matrix)
2191 return messageObject <<
"|" << matrix(0, 0) <<
", " << matrix(0, 1) <<
", " << matrix(0, 2) <<
", " << matrix(0, 3) <<
"|\n|"
2192 << matrix(1, 0) <<
", " << matrix(1, 1) <<
", " << matrix(1, 2) <<
", " << matrix(1, 3) <<
"|\n|"
2193 << matrix(2, 0) <<
", " << matrix(2, 1) <<
", " << matrix(2, 2) <<
", " << matrix(2, 3) <<
"|\n|"
2194 << matrix(3, 0) <<
", " << matrix(3, 1) <<
", " << matrix(3, 2) <<
", " << matrix(3, 3) <<
"|";
2197 template <
bool tActive,
typename T>
2198 MessageObject<tActive>&
operator<<(MessageObject<tActive>&& messageObject,
const HomogenousMatrixT4<T>& matrix)
2200 return messageObject <<
"|" << matrix(0, 0) <<
", " << matrix(0, 1) <<
", " << matrix(0, 2) <<
", " << matrix(0, 3) <<
"|\n|"
2201 << matrix(1, 0) <<
", " << matrix(1, 1) <<
", " << matrix(1, 2) <<
", " << matrix(1, 3) <<
"|\n|"
2202 << matrix(2, 0) <<
", " << matrix(2, 1) <<
", " << matrix(2, 2) <<
", " << matrix(2, 3) <<
"|\n|"
2203 << 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:80
bool isValid() const
Returns whether the euler rotation holds valid parameters.
Definition: Euler.h:351
HomogenousMatrixT4()
Creates a new default HomogenousMatrixT4 object with undefined elements.
Definition: HomogenousMatrix4.h:719
bool invert()
Inverts the matrix.
Definition: HomogenousMatrix4.h:1591
const T * data() const
Returns a pointer to the internal values.
Definition: HomogenousMatrix4.h:1843
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:796
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:915
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:1292
HomogenousMatrixT4(const SquareMatrixT4< T > &matrix)
Creates a new HomogenousMatrixT4 object from a 4x4 square matrix.
Definition: HomogenousMatrix4.h:1001
HomogenousMatrixT4< T > inverted() const noexcept
Returns the inverted of this matrix.
Definition: HomogenousMatrix4.h:1575
VectorT3< T > scale() const
Returns the scale of the transformation.
Definition: HomogenousMatrix4.h:1395
HomogenousMatrixT4< T > & setRotation(const RotationT< T > &rotation)
Sets the rotation of this transformation.
Definition: HomogenousMatrix4.h:1667
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:1947
SquareMatrixT3< T > rotationMatrix() const
Returns the rotation matrix of the transformation.
Definition: HomogenousMatrix4.h:1493
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:1855
HomogenousMatrixT4(const VectorT3< T > &translation)
Creates a new HomogenousMatrixT4 object with only a translation.
Definition: HomogenousMatrix4.h:859
T trace() const
Returns the trace of the matrix which is the sum of the diagonal elements.
Definition: HomogenousMatrix4.h:1650
HomogenousMatrixT4(const T *arrayValues, const bool valuesRowAligned)
Creates a new HomogenousMatrixT4 object by an array of at least sixteen elements.
Definition: HomogenousMatrix4.h:829
HomogenousMatrixT4(const VectorT3< T > &translation, const VectorT3< T > &scale)
Creates a new HomogenousMatrixT4 object by a translation and a scale.
Definition: HomogenousMatrix4.h:1185
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:1367
HomogenousMatrixT4< T > & applyScale(const VectorT3< T > &scale)
Applies new scale values.
Definition: HomogenousMatrix4.h:1749
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:2135
HomogenousMatrixT4(const std::pair< VectorT3< T >, RotationT< T >> &translationAndRotation)
Creates a new HomogenousMatrixT4 object with a translation and rotation.
HomogenousMatrixT4(const VectorT3< T > &translation, const SquareMatrixT3< T > &rotation)
Creates a new HomogenousMatrixT4 object with a translation and rotation matrix.
Definition: HomogenousMatrix4.h:1159
T values_[16]
The sixteen values of the transformation matrix.
Definition: HomogenousMatrix4.h:715
HomogenousMatrixT4< T > & setTranslation(const VectorT3< T > &translation)
Sets the translation of this transformation.
Definition: HomogenousMatrix4.h:1657
T operator[](const unsigned int index) const
Element operator.
Definition: HomogenousMatrix4.h:2056
void toNull()
Sets the matrix to a zero matrix (including the lower right element).
Definition: HomogenousMatrix4.h:1795
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:1211
HomogenousMatrixT4(const std::pair< VectorT3< T >, QuaternionT< T >> &translationAndRotation)
Creates a new HomogenousMatrixT4 object with a translation and rotation.
HomogenousMatrixT4< T > & operator*=(const HomogenousMatrixT4< T > &matrix)
Combines and assigns two transformation matrices.
Definition: HomogenousMatrix4.h:2001
T determinant() const
Returns the determinant of the matrix.
Definition: HomogenousMatrix4.h:1642
HomogenousMatrixT4(const QuaternionT< T > &rotation)
Creates a new HomogenousMatrixT4 object with only a rotation given as quaternion.
Definition: HomogenousMatrix4.h:945
HomogenousMatrixT4(const VectorT3< T > &translation, const EulerT< T > &euler)
Creates a new HomogenousMatrixT4 object with a translation and rotation.
Definition: HomogenousMatrix4.h:1069
T Type
Definition of the used data type.
Definition: HomogenousMatrix4.h:118
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:1308
bool isNull() const
Returns whether this matrix is a zero matrix (with all elements equal to zero).
Definition: HomogenousMatrix4.h:1834
void rotationMatrix(T *data, const bool transposed=false) const
Copies the 3x3 rotation matrix elements of the 4x4 transformation.
Definition: HomogenousMatrix4.h:1503
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:1360
HomogenousMatrixT4(const RotationT< T > &rotation)
Creates a new HomogenousMatrixT4 object with only a rotation.
Definition: HomogenousMatrix4.h:885
HomogenousMatrixT4(const VectorT3< T > &translation, const QuaternionT< T > &rotation)
Creates a new HomogenousMatrixT4 object with a translation and rotation.
Definition: HomogenousMatrix4.h:1099
VectorT3< T > translation() const
Returns the translation of the transformation.
Definition: HomogenousMatrix4.h:1381
bool isValid() const
Returns whether this matrix is a valid homogeneous transformation.
Definition: HomogenousMatrix4.h:1806
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:1269
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:1407
HomogenousMatrixT4< T > operator*(const HomogenousMatrixT4< T > &matrix) const
Combines two transformation matrices.
Definition: HomogenousMatrix4.h:1969
HomogenousMatrixT4(const U *arrayValues)
Creates a new HomogenousMatrixT4 object by 16 given floating point values of type U.
Definition: HomogenousMatrix4.h:780
QuaternionT< T > rotation() const
Returns the rotation of the transformation as quaternion.
Definition: HomogenousMatrix4.h:1388
bool operator!=(const HomogenousMatrixT4< T > &matrix) const
Returns whether two transformations are not identical up to a small epsilon.
Definition: HomogenousMatrix4.h:1963
void toIdentity()
Sets the matrix to the identity matrix.
Definition: HomogenousMatrix4.h:1769
bool operator==(const HomogenousMatrixT4< T > &matrix) const
Returns whether two transformations are identical up to a small epsilon.
Definition: HomogenousMatrix4.h:1957
bool isIdentity() const
Returns whether this matrix is an identity matrix.
Definition: HomogenousMatrix4.h:1812
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:1821
HomogenousMatrixT4(const SquareMatrixT3< T > &rotation)
Creates a new HomogenousMatrixT4 object with only a rotation given as 3x3 rotation matrix.
Definition: HomogenousMatrix4.h:975
HomogenousMatrixT4(const VectorT3< T > &translation, const RotationT< T > &rotation)
Creates a new HomogenousMatrixT4 object with a translation and rotation.
Definition: HomogenousMatrix4.h:1009
SquareMatrixT4< T > transposed() const
Returns the transposed of this matrix.
Definition: HomogenousMatrix4.h:1545
SquareMatrixT3< T > orthonormalRotationMatrix() const
Returns the 3x3 orthonormal rotation matrix of the 4x4 transformation (by forcing a orthogonal and no...
Definition: HomogenousMatrix4.h:1538
HomogenousMatrixT4(const bool setToIdentity)
Creates a new HomogenousMatrixT4.
Definition: HomogenousMatrix4.h:741
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:1334
const T * operator()() const
Access operator.
Definition: HomogenousMatrix4.h:2098
HomogenousMatrixT4(const HomogenousMatrixT4< U > &matrix)
Copy constructor for a matrix with difference element data type than T.
Definition: HomogenousMatrix4.h:732
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:1242
VectorT3< T > zAxis() const
Returns the z-axis of the transformation which is the first vector of the upper left 3x3 rotation mat...
Definition: HomogenousMatrix4.h:1374
HomogenousMatrixT4(const T *arrayValues)
Creates a new HomogenousMatrixT4 object by 16 given floating point values.
Definition: HomogenousMatrix4.h:789
HomogenousMatrixT4(const HomogenousMatrixT4< T > &matrix)
Copy constructor.
Definition: HomogenousMatrix4.h:725
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:1568
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:2386
static constexpr bool isEqualEps(const T value)
Returns whether a value is smaller than or equal to a small epsilon.
Definition: Numeric.h:2087
static T cos(const T value)
Returns the cosine of a given value.
Definition: Numeric.h:1584
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:917
bool isValid() const
Returns whether this quaternion is a valid unit quaternion.
Definition: Quaternion.h:899
const T & w() const
Returns the w value of the quaternion.
Definition: Quaternion.h:905
const T & y() const
Returns the y value of the quaternion.
Definition: Quaternion.h:929
const T & z() const
Returns the z value of the quaternion.
Definition: Quaternion.h:941
This class implements a axis-angle rotation using floating point values.
Definition: Rotation.h:79
This class implements a 3x3 square matrix.
Definition: SquareMatrix3.h:88
This class implements a 4x4 square matrix.
Definition: SquareMatrix4.h:85
SquareMatrixT4< T > transposed() const
Returns the transposed of this matrix.
Definition: SquareMatrix4.h:802
This class implements a vector with three elements.
Definition: Vector3.h:97
const T & y() const noexcept
Returns the y value.
Definition: Vector3.h:812
const T & x() const noexcept
Returns the x value.
Definition: Vector3.h:800
const T & z() const noexcept
Returns the z value.
Definition: Vector3.h:824
T length() const
Returns the length of the vector.
Definition: Vector3.h:664
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
HomogenousMatrixT4< double > HomogenousMatrixD4
Instantiation of the HomogenousMatrixT4 template class using a double precision float data type.
Definition: HomogenousMatrix4.h:51
std::vector< HomogenousMatrixD4 > HomogenousMatricesD4
Definition of a vector holding HomogenousMatrixD4 objects.
Definition: HomogenousMatrix4.h:79
HomogenousMatrixT4< Scalar > HomogenousMatrix4
Definition of the HomogenousMatrix4 object, depending on the OCEAN_MATH_USE_SINGLE_PRECISION flag eit...
Definition: HomogenousMatrix4.h:37
HomogenousMatrixT4< float > HomogenousMatrixF4
Instantiation of the HomogenousMatrixT4 template class using a float precision float data type.
Definition: HomogenousMatrix4.h:58
std::vector< HomogenousMatrixF4 > HomogenousMatricesF4
Definition of a vector holding HomogenousMatrixF4 objects.
Definition: HomogenousMatrix4.h:85
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15
std::ostream & operator<<(std::ostream &stream, const HighPerformanceStatistic &highPerformanceStatistic)
Definition: HighPerformanceTimer.h:963