Refactor various operator[] based on BETA10 (#1110)

* Tidy up `operator[]` code

* Add weird index operator for `FUN_1002ddc0`

* Cleanup

* Add Matrix4 BETA10 annotations, fix typo

---------

Co-authored-by: jonschz <jonschz@users.noreply.github.com>
This commit is contained in:
jonschz
2024-10-06 16:50:34 +02:00
committed by GitHub
parent 1a15981324
commit 85ce10ab50
9 changed files with 53 additions and 29 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

@@ -25,9 +25,9 @@ public:
LegoResult FUN_1002ddc0(LegoWEEdge& p_f, Vector3& p_point)
{
if (p_f.IsEqual(*m_faceA)) {
p_point[0] = -m_unk0x28[0];
p_point[1] = -m_unk0x28[1];
p_point[2] = -m_unk0x28[2];
p_point[0] = -m_unk0x28.index_operator(0);
p_point[1] = -m_unk0x28.index_operator(1);
p_point[2] = -m_unk0x28.index_operator(2);
}
else {
// clang-format off