Isle
Loading...
Searching...
No Matches
MxMatrix Class Reference

[AI] Represents a 4x4 transformation matrix, specialized for the LEGO Island engine and derived from Matrix4. More...

#include <mxmatrix.h>

Inheritance diagram for MxMatrix:
Collaboration diagram for MxMatrix:

Public Member Functions

 MxMatrix ()
 [AI] Default constructor. More...
 
 MxMatrix (const MxMatrix &p_matrix)
 [AI] Copy constructor from another MxMatrix. More...
 
 MxMatrix (const Matrix4 &p_matrix)
 [AI] Constructor from a generic Matrix4. More...
 
float * operator[] (int idx)
 [AI] Subscript operator for access to individual rows of the matrix. More...
 
const float * operator[] (int idx) const
 [AI] Const version of subscript operator. More...
 
void operator= (const Matrix4 &p_matrix) override
 [AI] Assignment operator from a generic Matrix4. More...
 
virtual void operator= (const MxMatrix &p_matrix)
 [AI] Assignment operator from another MxMatrix. More...
 
- Public Member Functions inherited from Matrix4
 Matrix4 (float(*p_data)[4])
 Constructs a Matrix4 object referring to the given 4x4 float array. More...
 
virtual void Equals (float(*p_data)[4])
 Set the matrix elements from a 4x4 float array. More...
 
virtual void Equals (const Matrix4 &p_matrix)
 Copies the matrix from another Matrix4. More...
 
virtual void SetData (float(*p_data)[4])
 Set this matrix instance to use/point to a new 4x4 data block. More...
 
virtual void SetData (UnknownMatrixType &p_matrix)
 Copies the matrix data from a raw UnknownMatrixType instance. More...
 
virtual float(* GetData ())[4]
 Gets modifiable access to the 4x4 float matrix. More...
 
virtual float(* GetData () const)[4]
 Gets read-only access to the 4x4 float matrix data. More...
 
virtual float * Element (int p_row, int p_col)
 Accesses an individual element of the matrix in writable form. More...
 
virtual const float * Element (int p_row, int p_col) const
 Accesses an individual element in read-only form. More...
 
virtual void Clear ()
 Sets every element of the matrix to zero. More...
 
virtual void SetIdentity ()
 Sets this matrix to identity (diagonal 1, others 0). More...
 
virtual void operator= (const Matrix4 &p_matrix)
 Assign/copy another matrix's values into this one. More...
 
virtual Matrix4operator+= (float(*p_data)[4])
 In-place matrix addition with external float[4][4]. More...
 
virtual void TranslateBy (const float &p_x, const float &p_y, const float &p_z)
 Applies translation by amounts along X, Y, Z axes. More...
 
virtual void SetTranslation (const float &p_x, const float &p_y, const float &p_z)
 Overwrites the translation part of the matrix (last column). More...
 
virtual void Product (float(*p_a)[4], float(*p_b)[4])
 Multiplies two 4x4 float matrices, storing result in this. More...
 
virtual void Product (const Matrix4 &p_a, const Matrix4 &p_b)
 Multiplies two Matrix4s, storing result in this matrix. More...
 
virtual void ToQuaternion (Vector4 &p_resultQuat)
 Converts the 3x3 rotation part of this matrix to a quaternion (Vector4). More...
 
virtual int FromQuaternion (const Vector4 &p_vec)
 Initializes the matrix from a quaternion (Vector4). More...
 
void Scale (const float &p_x, const float &p_y, const float &p_z)
 Applies scaling factors along X, Y, and Z axes. More...
 
void RotateX (const float &p_angle)
 Applies a rotation (in radians or degrees, depending on implementation) about the X axis. More...
 
void RotateY (const float &p_angle)
 Applies a rotation (in radians or degrees, depending on implementation) about the Y axis. More...
 
void RotateZ (const float &p_angle)
 Applies a rotation (in radians or degrees) about the Z axis. More...
 
int BETA_1005a590 (Matrix4 &p_mat)
 [AI] Appears to perform some operation using another matrix, but function/purpose unknown. More...
 
void Swap (int p_d1, int p_d2)
 Swaps the data between two rows/columns (presumably). More...
 
float * operator[] (int idx)
 Array subscript operator for modifiable row access. More...
 
const float * operator[] (int idx) const
 Const array subscript operator for readonly row access. More...
 

Additional Inherited Members

- Protected Attributes inherited from Matrix4
float(* m_data )[4]
 Pointer to 4x4 float array, owns or refers to matrix data. More...
 

Detailed Description

[AI] Represents a 4x4 transformation matrix, specialized for the LEGO Island engine and derived from Matrix4.

[AI]

[AI] MxMatrix is an engine-specific wrapper for 4x4 matrices, providing convenient constructors and assignment operators to interoperate with both generic Matrix4 and other MxMatrix instances. It is used for world transforms, camera transforms, and other spatial calculations within the game engine. Its underlying storage is a float 4x4 array. []

Definition at line 16 of file mxmatrix.h.

Constructor & Destructor Documentation

◆ MxMatrix() [1/3]

MxMatrix::MxMatrix ( )
inline

[AI] Default constructor.

Initializes the matrix storage and sets identity.

[AI] Calls the base Matrix4 constructor with the address of this matrix's underlying storage (m_elements), ensuring all matrix operations operate on this data. Starts as an identity matrix.

Definition at line 22 of file mxmatrix.h.

◆ MxMatrix() [2/3]

MxMatrix::MxMatrix ( const MxMatrix p_matrix)
inline

[AI] Copy constructor from another MxMatrix.

Parameters
p_matrixSource MxMatrix to copy. [AI]

[AI] Initializes matrix storage as in the default constructor and then copies all elements from the given MxMatrix.

Definition at line 29 of file mxmatrix.h.

◆ MxMatrix() [3/3]

MxMatrix::MxMatrix ( const Matrix4 p_matrix)
inline

[AI] Constructor from a generic Matrix4.

Parameters
p_matrixSource Matrix4 to copy. [AI]

[AI] Initializes matrix storage and copies the elements from another Matrix4. Provides interoperability with generic matrix math in the engine.

Definition at line 36 of file mxmatrix.h.

Member Function Documentation

◆ operator=() [1/2]

void MxMatrix::operator= ( const Matrix4 p_matrix)
inlineoverridevirtual

[AI] Assignment operator from a generic Matrix4.

[AI]

Parameters
p_matrixSource Matrix4. [AI]

[AI] Overridden from base, copies all matrix values from a Matrix4 into this MxMatrix.

Reimplemented from Matrix4.

Definition at line 59 of file mxmatrix.h.

◆ operator=() [2/2]

virtual void MxMatrix::operator= ( const MxMatrix p_matrix)
inlinevirtual

[AI] Assignment operator from another MxMatrix.

[AI]

Parameters
p_matrixSource MxMatrix. [AI]

[AI] Copies all matrix elements from another MxMatrix.

Definition at line 66 of file mxmatrix.h.

◆ operator[]() [1/2]

float * MxMatrix::operator[] ( int  idx)
inline

[AI] Subscript operator for access to individual rows of the matrix.

Parameters
idxRow index (0-3). [AI]
Returns
Pointer to the first element of the row. [AI]

[AI] Allows access as m[i][j] where 'i' selects the row and 'j' the column. [AI]

Definition at line 44 of file mxmatrix.h.

◆ operator[]() [2/2]

const float * MxMatrix::operator[] ( int  idx) const
inline

[AI] Const version of subscript operator.

Parameters
idxRow index (0-3). [AI]
Returns
Const pointer to the row. [AI]

[AI]

Definition at line 52 of file mxmatrix.h.


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