isle/LEGO1/mxmatrix.h

68 lines
1.8 KiB
C
Raw Normal View History

#ifndef MXMATRIX_H
#define MXMATRIX_H
#include "mxvector.h"
// VTABLE 0x100d4350
// SIZE 0x8
2023-10-24 19:38:27 -04:00
class MxMatrix {
public:
2023-10-24 19:38:27 -04:00
inline MxMatrix(float* p_data) : m_data(p_data) {}
2023-10-24 19:38:27 -04:00
// vtable + 0x00
virtual void EqualsMxMatrix(const MxMatrix* p_other);
virtual void EqualsMatrixData(const float* p_matrix);
virtual void SetData(float* p_data);
virtual void AnotherSetData(float* p_data);
2023-10-24 19:38:27 -04:00
// vtable + 0x10
virtual float* GetData();
virtual const float* GetData() const;
virtual float* Element(int p_row, int p_col);
virtual const float* Element(int p_row, int p_col) const;
2023-10-24 19:38:27 -04:00
// vtable + 0x20
virtual void Clear();
virtual void SetIdentity();
virtual void operator=(const MxMatrix& p_other);
virtual MxMatrix* operator+=(const float* p_matrix);
2023-10-24 19:38:27 -04:00
// vtable + 0x30
virtual void TranslateBy(const float* p_x, const float* p_y, const float* p_z);
virtual void SetTranslation(const float* p_x, const float* p_y, const float* p_z);
virtual void EqualsMxProduct(const MxMatrix* p_a, const MxMatrix* p_b);
virtual void EqualsDataProduct(const float* p_a, const float* p_b);
2023-10-24 19:38:27 -04:00
// vtable + 0x40
virtual void ToQuaternion(MxVector4* p_resultQuat);
virtual MxResult FUN_10002710(const MxVector3* p_vec);
2023-10-24 19:38:27 -04:00
inline float& operator[](size_t idx) { return m_data[idx]; }
private:
2023-10-24 19:38:27 -04:00
float* m_data;
};
// VTABLE 0x100d4300
// SIZE 0x48
2023-10-24 19:38:27 -04:00
class MxMatrixData : public MxMatrix {
public:
2023-10-24 19:38:27 -04:00
inline MxMatrixData() : MxMatrix(e) {}
2023-10-24 19:38:27 -04:00
// No idea why there's another equals. Maybe to some other type like the
// DirectX Retained Mode Matrix type which is also a float* alias?
// vtable + 0x44
virtual void operator=(const MxMatrixData& p_other);
2023-10-24 19:38:27 -04:00
// Alias an easy way to access the translation part of the matrix, because
// various members / other functions benefit from the clarity.
union {
float e[16];
struct {
float _[12];
float x, y, z, w;
};
};
};
#endif // MXMATRIX_H