Urho3D
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
Urho3D::Matrix4 Class Reference

4x4 matrix for arbitrary linear transforms including projection. More...

#include </home/runner/work/urho3d-doxygen.github.io/urho3d-doxygen.github.io/urho3d_repo/Source/Urho3D/Math/Matrix4.h>

Public Member Functions

 Matrix4 () noexcept
 Construct an identity matrix.
 
 Matrix4 (const Matrix4 &matrix) noexcept
 Copy-construct from another matrix.
 
 Matrix4 (const Matrix3 &matrix) noexcept
 Copy-construct from a 3x3 matrix and set the extra elements to identity.
 
 Matrix4 (float v00, float v01, float v02, float v03, float v10, float v11, float v12, float v13, float v20, float v21, float v22, float v23, float v30, float v31, float v32, float v33) noexcept
 Construct from values.
 
 Matrix4 (const float *data) noexcept
 Construct from a float array.
 
Matrix4operator= (const Matrix4 &rhs) noexcept
 Assign from another matrix.
 
Matrix4operator= (const Matrix3 &rhs) noexcept
 Assign from a 3x3 matrix. Set the extra elements to identity.
 
bool operator== (const Matrix4 &rhs) const
 Test for equality with another matrix without epsilon.
 
bool operator!= (const Matrix4 &rhs) const
 Test for inequality with another matrix without epsilon.
 
Vector3 operator* (const Vector3 &rhs) const
 Multiply a Vector3 which is assumed to represent position.
 
Vector4 operator* (const Vector4 &rhs) const
 Multiply a Vector4.
 
Matrix4 operator+ (const Matrix4 &rhs) const
 Add a matrix.
 
Matrix4 operator- (const Matrix4 &rhs) const
 Subtract a matrix.
 
Matrix4 operator* (float rhs) const
 Multiply with a scalar.
 
Matrix4 operator* (const Matrix4 &rhs) const
 Multiply a matrix.
 
Matrix4 operator* (const Matrix3x4 &rhs) const
 Multiply with a 3x4 matrix.
 
void SetTranslation (const Vector3 &translation)
 Set translation elements.
 
void SetRotation (const Matrix3 &rotation)
 Set rotation elements from a 3x3 matrix.
 
void SetScale (const Vector3 &scale)
 Set scaling elements.
 
void SetScale (float scale)
 Set uniform scaling elements.
 
Matrix3 ToMatrix3 () const
 Return the combined rotation and scaling matrix.
 
Matrix3 RotationMatrix () const
 Return the rotation matrix with scaling removed.
 
Vector3 Translation () const
 Return the translation part.
 
Quaternion Rotation () const
 Return the rotation part.
 
Vector3 Scale () const
 Return the scaling part.
 
Vector3 SignedScale (const Matrix3 &rotation) const
 Return the scaling part with the sign. Reference rotation matrix is required to avoid ambiguity.
 
Matrix4 Transpose () const
 Return transposed.
 
bool Equals (const Matrix4 &rhs) const
 Test for equality with another matrix with epsilon.
 
void Decompose (Vector3 &translation, Quaternion &rotation, Vector3 &scale) const
 Return decomposition to translation, rotation and scale.
 
Matrix4 Inverse () const
 Return inverse.
 
const float * Data () const
 Return float data.
 
float Element (unsigned i, unsigned j) const
 Return matrix element.
 
Vector4 Row (unsigned i) const
 Return matrix row.
 
Vector4 Column (unsigned j) const
 Return matrix column.
 
bool IsNaN () const
 Return whether any element is NaN.
 
bool IsInf () const
 Return whether any element is Inf.
 
String ToString () const
 Return as string.
 

Static Public Member Functions

static void BulkTranspose (float *dest, const float *src, unsigned count)
 Bulk transpose matrices.
 

Public Attributes

float m00_
 
float m01_
 
float m02_
 
float m03_
 
float m10_
 
float m11_
 
float m12_
 
float m13_
 
float m20_
 
float m21_
 
float m22_
 
float m23_
 
float m30_
 
float m31_
 
float m32_
 
float m33_
 

Static Public Attributes

static const Matrix4 ZERO
 Zero matrix.
 
static const Matrix4 IDENTITY
 Identity matrix.
 

Detailed Description

4x4 matrix for arbitrary linear transforms including projection.


The documentation for this class was generated from the following files: