7 #ifndef NAZARA_MATRIX4_HPP 8 #define NAZARA_MATRIX4_HPP 12 #include <Nazara/Core/String.hpp> 13 #include <Nazara/Math/Config.hpp> 17 struct SerializationContext;
19 template<
typename T>
class EulerAngles;
30 Matrix4(T r11, T r12, T r13, T r14,
31 T r21, T r22, T r23, T r24,
32 T r31, T r32, T r33, T r34,
33 T r41, T r42, T r43, T r44);
71 Matrix4&
MakeOrtho(T left, T right, T top, T bottom, T zNear = -1.0, T zFar = 1.0);
82 T r21, T r22, T r23, T r24,
83 T r31, T r32, T r33, T r34,
84 T r41, T r42, T r43, T r44);
102 operator const T* ()
const;
104 T&
operator()(
unsigned int x,
unsigned int y);
105 T
operator()(
unsigned int x,
unsigned int y)
const;
125 static Matrix4 Ortho(T left, T right, T top, T bottom, T zNear = -1.0, T zFar = 1.0);
135 T m11, m12, m13, m14,
148 template<
typename T> std::ostream& operator<<(std::ostream& out, const Nz::Matrix4<T>& matrix);
153 #include <Nazara/Math/Matrix4.inl> 155 #endif // NAZARA_MATRIX4_HPP TODO: Inherit SoundEmitter from Node.
Definition: Algorithm.hpp:12
Matrix4 & ApplyScale(const Vector3< T > &scale)
Apply the scale represented by the vector to this matrix.
Definition: Matrix4.inl:97
static Matrix4 Zero()
Shorthand for the 'zero' matrix.
Definition: Matrix4.inl:1758
bool HasNegativeScale() const
Checks whetever matrix has negative scale.
Definition: Matrix4.inl:719
Matrix4 & MakeRotation(const Quaternion< T > &rotation)
Makes the matrix the representation of the quaternion.
Definition: Matrix4.inl:924
Matrix4 & Set(T r11, T r12, T r13, T r14, T r21, T r22, T r23, T r24, T r31, T r32, T r33, T r34, T r41, T r42, T r43, T r44)
Sets the components of the matrix.
Definition: Matrix4.inl:1075
Matrix4 & SetRotation(const Quaternion< T > &rotation)
Sets the components of the matrix from a quaternion.
Definition: Matrix4.inl:1160
static Matrix4 Rotate(const Quaternion< T > &rotation)
Shorthand for the 'rotation' matrix.
Definition: Matrix4.inl:1644
bool Unserialize(SerializationContext &context, bool *value)
Unserializes a boolean.
Definition: Algorithm.inl:279
Matrix4 & MakeTranslation(const Vector3< T > &translation)
Makes the matrix with the translation.
Definition: Matrix4.inl:970
void GetTransposed(Matrix4 *dest) const
Gets the transposed of this matrix.
Definition: Matrix4.inl:695
Matrix4 & SetScale(const Vector3< T > &scale)
Sets the components of the matrix from a scale.
Definition: Matrix4.inl:1200
Core class that represents a string.
Definition: String.hpp:22
String ToString() const
Gives a string representation.
Definition: Matrix4.inl:1234
Matrix4 & MakeTransform(const Vector3< T > &translation, const Quaternion< T > &rotation)
Makes the matrix with the translation and the rotation.
Definition: Matrix4.inl:993
static Matrix4 Translate(const Vector3< T > &translation)
Shorthand for the 'translation' matrix.
Definition: Matrix4.inl:1680
Matrix4 & MakePerspective(T angle, T ratio, T zNear, T zFar)
Makes the matrix a 'perspective matrix'.
Definition: Matrix4.inl:895
Vector3< T > GetSquaredScale() const
Gets the squared scale from this matrix.
Definition: Matrix4.inl:665
static Matrix4 Scale(const Vector3< T > &scale)
Shorthand for the 'scale' matrix.
Definition: Matrix4.inl:1662
bool operator==(const Matrix4 &mat) const
Compares the matrix to other one.
Definition: Matrix4.inl:1494
bool operator!=(const Matrix4 &mat) const
Compares the matrix to other one.
Definition: Matrix4.inl:1511
Matrix4 & MakeZero()
Makes the matrix zero (with 0 everywhere)
Definition: Matrix4.inl:1057
Matrix4 & MakeIdentity()
Makes the matrix identity (with 1 on diagonal and 0 for others)
Definition: Matrix4.inl:820
bool IsIdentity() const
Checks whether the matrix is identity.
Definition: Matrix4.inl:804
static Matrix4 ViewMatrix(const Vector3< T > &translation, const Quaternion< T > &rotation)
Shorthand for the 'view' matrix.
Definition: Matrix4.inl:1742
Matrix4 & SetTranslation(const Vector3< T > &translation)
Sets the components of the matrix from a translation.
Definition: Matrix4.inl:1219
Matrix4 & MakeOrtho(T left, T right, T top, T bottom, T zNear=-1.0, T zFar=1.0)
Makes the matrix a 'orthographic matrix'.
Definition: Matrix4.inl:871
Matrix4 & Inverse(bool *succeeded=nullptr)
Inverts this matrix.
Definition: Matrix4.inl:759
Matrix4 & Concatenate(const Matrix4 &matrix)
Concatenates this matrix to other one.
Definition: Matrix4.inl:143
Structure containing a serialization/unserialization context states.
Definition: SerializationContext.hpp:18
T & operator()(unsigned int x, unsigned int y)
Gets the component (x, y) of the matrix.
Definition: Matrix4.inl:1346
Matrix4 & ApplyRotation(const Quaternion< T > &rotation)
Apply the rotation represented by the quaternion to this matrix.
Definition: Matrix4.inl:84
Matrix4 & Transpose()
Transposes the matrix.
Definition: Matrix4.inl:1299
Vector3< T > GetScale() const
Gets the scale from this matrix.
Definition: Matrix4.inl:651
static Matrix4 LookAt(const Vector3< T > &eye, const Vector3< T > &target, const Vector3< T > &up=Vector3< T >::Up())
Shorthand for the 'look at' matrix.
Definition: Matrix4.inl:1582
Quaternion< T > GetRotation() const
Gets the rotation from this matrix.
Definition: Matrix4.inl:566
bool Serialize(SerializationContext &context, bool value)
Serializes a boolean.
Definition: Algorithm.inl:214
Matrix4 operator*(const Matrix4 &matrix) const
Multiplies the components of the matrix with other matrix.
Definition: Matrix4.inl:1393
Math class that represents an element of the three dimensional vector space with the notion of projec...
Definition: Matrix4.hpp:23
static Matrix4 Perspective(T angle, T ratio, T zNear, T zFar)
Shorthand for the 'perspective' matrix.
Definition: Matrix4.inl:1626
T GetDeterminant() const
Calcultes the determinant of this matrix.
Definition: Matrix4.inl:259
Matrix4 & InverseAffine(bool *succeeded=nullptr)
Inverts this matrix.
Definition: Matrix4.inl:778
Matrix4 & MakeViewMatrix(const Vector3< T > &translation, const Quaternion< T > &rotation)
Makes the matrix a 'view matrix'.
Definition: Matrix4.inl:1041
static Matrix4 Identity()
Shorthand for the identity matrix.
Definition: Matrix4.inl:1562
Vector4< T > GetRow(unsigned int row) const
Gets the ith row of the matrix.
Definition: Matrix4.inl:625
bool IsAffine() const
Checks whether the matrix is affine.
Definition: Matrix4.inl:793
Matrix4 & MakeLookAt(const Vector3< T > &eye, const Vector3< T > &target, const Vector3< T > &up=Vector3< T >::Up())
Makes the matrix a 'look at matrix'.
Definition: Matrix4.inl:842
Matrix4 & ApplyTranslation(const Vector3< T > &translation)
Apply the translation represented by the vector to this matrix.
Definition: Matrix4.inl:122
Vector3< T > GetTranslation() const
Gets the translation from this matrix.
Definition: Matrix4.inl:678
Matrix4 & operator*=(const Matrix4 &matrix)
Multiplies this matrix with another one.
Definition: Matrix4.inl:1463
Math class that represents a transformation of the four dimensional vector space with the notion of p...
Definition: Matrix4.hpp:26
T GetDeterminantAffine() const
Calcultes the determinant of this matrix.
Definition: Matrix4.inl:284
static Matrix4 Ortho(T left, T right, T top, T bottom, T zNear=-1.0, T zFar=1.0)
Shorthand for the 'orthographic' matrix.
Definition: Matrix4.inl:1605
Vector2< T > Transform(const Vector2< T > &vector, T z=0.0, T w=1.0) const
Transforms the Vector2 and two components by the matrix.
Definition: Matrix4.inl:1253
Matrix4 & ConcatenateAffine(const Matrix4 &matrix)
Concatenates this matrix to other one.
Definition: Matrix4.inl:183
Vector4< T > GetColumn(unsigned int column) const
Gets the ith column of the matrix.
Definition: Matrix4.inl:231
Math class that represents an element of the three dimensional vector space.
Definition: Matrix4.hpp:22
bool HasScale() const
Checks whetever matrix has scale.
Definition: Matrix4.inl:732
bool GetInverse(Matrix4 *dest) const
Gets the inverse of this matrix.
Definition: Matrix4.inl:315
bool GetInverseAffine(Matrix4 *dest) const
Gets the inverse of this matrix.
Definition: Matrix4.inl:472
Math class that represents an element of the quaternions.
Definition: Matrix4.hpp:20
Matrix4 & MakeScale(const Vector3< T > &scale)
Makes the matrix with the scale.
Definition: Matrix4.inl:950
Math class that represents an element of the two dimensional vector space.
Definition: Matrix4.hpp:21