53 TMatrix44(T m00, T m01, T m02, T m03, T m10, T m11, T m12, T m13, T m20, T m21, T m22, T m23, T m30, T m31, T m32, T m33);
202 operator const T*() const;
420 void setElement(
unsigned int column,
unsigned int row, T value);
428 T
element(
unsigned int column,
unsigned int row)
const;
436 T&
element(
unsigned int column,
unsigned int row);
565 }
_data = {1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1};
601#include <math/TMatrix44.hpp>
Generic 4 x 4 matrix template.
Definition TMatrix44.h:38
TVector3D< T > getTranslation() const
Gets translation part of matrix.
TMatrix44 orbit(T horizontal, T vertical) const
Gets transformation of rotation around local x- and y-axis of current matrix.
TMatrix44 & rotate(T angle, const TVector3D< T > &vec, bool only=true)
Applies rotation on the current matrix around a vector.
TMatrix44 & setTiltPanRoll(T tilt, T pan, T roll)
Sets/resets rotation part of the matrix according to tilt pan roll and does not touch the translation...
TMatrix44 multiplied(const TMatrix44 &m) const
Same as multiply() but returns the changed matrix and does not affect this matrix.
TMatrix44 rotated(T angle, T x, T y, T z, bool only=true) const
Same as rotate() but only returns the changed matrix and does not affect this matrix.
TMatrix44 & insertGIGRotXYZ(T rx, T ry, T rz)
Another way of applying rotation to the matrix.
bool isEqual(const TMatrix44 &m, T tol=tolerance) const
Compares the passed matrix within the set tolerance.
TMatrix44 & assign(const T[4][4])
Assigns the 4x4 array structure to this matrix.
TMatrix44 transposed() const
Get a transposed matrix of this instance.
TMatrix44 & transpose()
Transpose this matrix.
TMatrix44(std::initializer_list< T[4]> list)
Constructor using an initializer list.
T & operator()(int row, int column)
Function operator for row column value manipulations. This is different from the element() method.
TMatrix44(const T *)
Initialization constructor for 16 floating point values.
TMatrix44 & multiply(const TMatrix44 &m)
Multiplies this matrix with the passed one so that the given matrix is applied on the matrix axes.
std::string toString() const
Gets the string representation of the matrix formed like '({m00,m01,m02,m03},{m10,...
T & element(unsigned int column, unsigned int row)
Gets the element reference specified by the row and column.
T value_type
Type accessible when implemented.
Definition TMatrix44.h:43
void copyTo(T[4][4]) const
Copies the matrix to a 4x4 array.
TMatrix44 & resetOrientation()
Resets the orientation and leaves the translation as is.
TMatrix44 & unit()
Set or resets this instance as unit/identity matrix. A unit matrix, also known as the identity matrix...
void setElement(unsigned int column, unsigned int row, T value)
Sets the element specified by the row and column.
TMatrix44(T tilt, T pan, T roll)
Construct from rotations.
void clearTranslation()
Zero's or clears translation part of this instance.
value_type * data()
Gets the pointer to the array of this matrix.
TMatrix44 & transposeAssign(const T[4][4])
Assigns the transposed 4x4 array structure to this matrix.
TMatrix44 & assignOpenGL(const R *matrix)
Assigns a row-major matrix array compatible with OpenGL standard to this instance....
TMatrix44 inverse() const
Gets the inverted version of this instance. Call the method invert() to do this.
T operator()(int row, int column) const
Gets the element from row and column index. This is different from the element() method.
EAxis
Enumerate for identifying a matrix axis.
Definition TMatrix44.h:384
@ axisZ
Z-axis of the matrix.
Definition TMatrix44.h:390
@ axisX
X-axis of the matrix.
Definition TMatrix44.h:386
@ axisT
Translation axis of the matrix.
Definition TMatrix44.h:392
@ axisY
Y-axis of the matrix.
Definition TMatrix44.h:388
T determinant() const
Gets the 3x3 determinant from this instance.
TVector3D< T > transformed(const TVector3D< T > &v) const
Applies the matrix rotation up on a 3D-vector.
void toOpenGL(R *matrix) const
Copies this matrix to a column-major matrix array compatible with OpenGL standard....
TQuaternion< T > quaternion() const
Convert rotation matrix part to identity or unit quaternion. Calls sf::TQuaternion::fromMatrix()
TVector3D< T > getAxis(EAxis axis) const
Gets given axis of matrix as a 3D vector.
void transposeCopyTo(T[4][4]) const
Transposed copy to a 4x4 array for compatibility with OpenGL.
TMatrix44 setTranslation(const TVector3D< T > &v)
Sets translation part of this matrix.
TMatrix44 & setOrientationZY(const TVector3D< T > &z_axis, const TVector3D< T > &y_axis)
Set orientation using 2 direction vectors. The z-axis direction dominates y-axis (y-axis is corrected...
void setPerspectiveProjection(T near_plane, T far_plane, T fov)
Sets the projection for this matrix.
bool isRotational() const
Determines if the matrix is a rotation matrix.
TMatrix44(const TVector3D< T > &tv)
Construct from a translation vector. Construct a translation transformation from a given 3D Vector.
static TMatrix44 fromOpenGL(const R *matrix)
Creates a instance from a row-major matrix array compatible with OpenGL standard. Essentially convert...
std::array< R, 16 > toOpenGL() const
Gets a column-major matrix array buffer compatible with OpenGL standard. Essentially converts from a ...
void getTiltPanRoll(T &tilt, T &pan, T &roll) const
Translates rotation part of matrix to tilt, pan and roll values.
TMatrix44(const TQuaternion< T > &q)
Construct from quaternion rotation.
TMatrix44 & fromString(const std::string &s) noexcept(false)
Gets matrix values from the string representation formed like '({1,2,3,4},{11,12,13,...
T element(unsigned int column, unsigned int row) const
Gets the element specified by the row and column.
TMatrix44(const TMatrix44 &)
Copy constructor.
TMatrix44 & translate(const TVector3D< T > &v)
Adds a translation vector of this instance using a 3D vector.
TMatrix44 & invert()
Inverts this matrix.
TMatrix44(const T[4][4])
Initialization constructor for 4x4 floating point values.
TMatrix44 & setOrientationXY(const TVector3D< T > &x_axis, const TVector3D< T > &y_axis)
Set orientation using 2 direction vectors. y-axis direction dominates x-axis (x-axis is corrected if ...
TMatrix44()=default
Default constructor which is by default a unit-matrix.
TMatrix44(T m00, T m01, T m02, T m03, T m10, T m11, T m12, T m13, T m20, T m21, T m22, T m23, T m30, T m31, T m32, T m33)
Initialization constructor for 16 single floating point values.
TMatrix44(TMatrix44 &&) noexcept
Move constructor.
union sf::TMatrix44::data_type _data
static constexpr auto tolerance
Tolerance for when comparing in the equal operator.
Definition TMatrix44.h:554
TMatrix44 translated(const TVector3D< T > &v) const
Same as translate() but does not change this matrix only returns the translated one.
TMatrix44 orientation() const
Gets the orientation part of matrix.
Generic type Quaternion.
Definition TQuaternion.h:14
3-dimensional vector for math operations.
Definition TVector3D.h:17
Definition Application.h:10
_GII_FUNC std::istream & operator>>(std::istream &is, ResultData &)
Stream operator for setting up this instance with a setup std::string.
TMatrix44< T > operator*(const TMatrix44< T > &lm, const TMatrix44< T > &rm)
Multiplies to matrices into a single one.
_GII_FUNC std::ostream & operator<<(std::ostream &os, const ResultData &)
Stream operator for the setup std::string.
Storage union of the 4x4 matrix as array and 4 x4 array. It is initialized as a unit-matrix.
Definition TMatrix44.h:562
T mtx[4][4]
Definition TMatrix44.h:564
T array[4 *4]
Definition TMatrix44.h:563