Tidy up operator[] code

This commit is contained in:
jonschz 2024-10-06 13:07:13 +02:00
parent 1a15981324
commit 8960d8fa5b
7 changed files with 27 additions and 17 deletions

View File

@ -9,6 +9,7 @@ class LegoEntity;
class MxDSChunk;
// VTABLE: LEGO1 0x100d4e50
// VTABLE: BETA10 0x101bcd88
// SIZE 0x6c
class LegoModelPresenter : public MxVideoPresenter {
public:

View File

@ -789,9 +789,9 @@ void LegoAnimPresenter::StartingTickle()
FUN_1006c8a0(TRUE);
if (m_unk0x78 == NULL) {
if (fabs(m_action->GetDirection().GetX()) >= 0.00000047683716F ||
fabs(m_action->GetDirection().GetY()) >= 0.00000047683716F ||
fabs(m_action->GetDirection().GetZ()) >= 0.00000047683716F) {
if (fabs(m_action->GetDirection()[0]) >= 0.00000047683716F ||
fabs(m_action->GetDirection()[1]) >= 0.00000047683716F ||
fabs(m_action->GetDirection()[2]) >= 0.00000047683716F) {
m_unk0x78 = new MxMatrix();
CalcLocalTransform(m_action->GetLocation(), m_action->GetDirection(), m_action->GetUp(), *m_unk0x78);
}

View File

@ -50,6 +50,7 @@ void LegoModelPresenter::Destroy(MxBool p_fromDestructor)
}
// FUNCTION: LEGO1 0x1007f6b0
// FUNCTION: BETA10 0x1009845e
MxResult LegoModelPresenter::CreateROI(MxDSChunk* p_chunk)
{
MxResult result = FAILURE;
@ -171,13 +172,9 @@ MxResult LegoModelPresenter::CreateROI(MxDSChunk* p_chunk)
// Get scripted location, direction and up vectors
CalcLocalTransform(
Mx3DPointFloat(m_action->GetLocation().GetX(), m_action->GetLocation().GetY(), m_action->GetLocation().GetZ()),
Mx3DPointFloat(
m_action->GetDirection().GetX(),
m_action->GetDirection().GetY(),
m_action->GetDirection().GetZ()
),
Mx3DPointFloat(m_action->GetUp().GetX(), m_action->GetUp().GetY(), m_action->GetUp().GetZ()),
Mx3DPointFloat(m_action->GetLocation()[0], m_action->GetLocation()[1], m_action->GetLocation()[2]),
Mx3DPointFloat(m_action->GetDirection()[0], m_action->GetDirection()[1], m_action->GetDirection()[2]),
Mx3DPointFloat(m_action->GetUp()[0], m_action->GetUp()[1], m_action->GetUp()[2]),
mat
);
m_roi->UpdateTransformationRelativeToParent(mat);
@ -234,6 +231,7 @@ MxResult LegoModelPresenter::FUN_1007ff70(
}
// FUNCTION: LEGO1 0x10080050
// FUNCTION: BETA10 0x100991c2
void LegoModelPresenter::ReadyTickle()
{
if (m_compositePresenter != NULL && m_compositePresenter->IsA("LegoEntityPresenter") &&

View File

@ -710,6 +710,15 @@
// LIBRARY: BETA10 0x100fa0e0
// atof
// // LIBRARY: BETA10 0x1005a9c0
// // fabs
//
// // LIBRARY: BETA10 0x1005a9f0
// // fabsf
//
// // LIBRARY: BETA10 0x100f9bb0
// // _fabs
// LIBRARY: BETA10 0x100ff82b
// __ctrandisp1

View File

@ -32,13 +32,10 @@ class Mx3DPointFloat : public Vector3 {
// FUNCTION: LEGO1 0x10003c10
virtual void operator=(const Vector3& p_impl) { EqualsImpl(p_impl.m_data); } // vtable+0x88
float GetX() { return m_data[0]; }
float GetY() { return m_data[1]; }
float GetZ() { return m_data[2]; }
// FUNCTION: BETA10 0x10013460
float& operator[](int idx) { return m_data[idx]; }
// FUNCTION: BETA10 0x100373c0
const float& operator[](int idx) const { return m_data[idx]; }
// SYNTHETIC: LEGO1 0x10010c00

View File

@ -86,13 +86,13 @@ class MxDSAction : public MxDSObject {
void SetLoopCount(MxS32 p_loopCount) { m_loopCount = p_loopCount; }
// FUNCTION: BETA10 0x1003db50
Mx3DPointFloat& GetLocation() { return m_location; }
Vector3& GetLocation() { return m_location; }
// FUNCTION: BETA10 0x1003db80
Mx3DPointFloat& GetDirection() { return m_direction; }
Vector3& GetDirection() { return m_direction; }
// FUNCTION: BETA10 0x1003dbb0
Mx3DPointFloat& GetUp() { return m_up; }
Vector3& GetUp() { return m_up; }
void SetLocation(const Vector3& p_location) { m_location = p_location; }
void SetDirection(const Vector3& p_direction) { m_direction = p_direction; }

View File

@ -416,6 +416,11 @@ class Vector4 : public Vector3 {
m_data[3] = p_value;
} // vtable+0x84
float& operator[](int idx) { return m_data[idx]; }
// FUNCTION: BETA10 0x10010890
const float& operator[](int idx) const { return m_data[idx]; }
friend class Mx4DPointFloat;
};