Implement/match LegoAnimPresenter::VTable0x94 (#852)

This commit is contained in:
Christian Semmler 2024-04-25 11:27:55 -04:00 committed by GitHub
parent 054120bc5d
commit 31f5143741
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 43 additions and 20 deletions

View file

@ -67,7 +67,7 @@ class LegoAnimPresenter : public MxVideoPresenter {
virtual MxResult CreateAnim(MxStreamChunk* p_chunk); // vtable+0x88 virtual MxResult CreateAnim(MxStreamChunk* p_chunk); // vtable+0x88
virtual void VTable0x8c(); // vtable+0x8c virtual void VTable0x8c(); // vtable+0x8c
virtual void VTable0x90(); // vtable+0x90 virtual void VTable0x90(); // vtable+0x90
virtual MxResult VTable0x94(Vector3&, Vector3&, float, float, Vector3&); // vtable+0x94 virtual MxU32 VTable0x94(Vector3& p_vec1, Vector3& p_vec2, float p_f1, float p_f2, Vector3& p_vec3); // vtable+0x94
virtual MxResult VTable0x98(LegoPathBoundary* p_boundary); // vtable+0x98 virtual MxResult VTable0x98(LegoPathBoundary* p_boundary); // vtable+0x98
// FUNCTION: LEGO1 0x1000c990 // FUNCTION: LEGO1 0x1000c990
@ -125,7 +125,7 @@ class LegoAnimPresenter : public MxVideoPresenter {
LegoAnimSubstMap* m_substMap; // 0x98 LegoAnimSubstMap* m_substMap; // 0x98
MxS16 m_unk0x9c; // 0x9c MxS16 m_unk0x9c; // 0x9c
undefined4* m_unk0xa0; // 0xa0 undefined4* m_unk0xa0; // 0xa0
undefined4 m_unk0xa4; // 0xa4 float m_unk0xa4; // 0xa4
Mx3DPointFloat m_unk0xa8; // 0xa8 Mx3DPointFloat m_unk0xa8; // 0xa8
}; };

View file

@ -1105,11 +1105,34 @@ void LegoAnimPresenter::FUN_1006c8a0(MxBool p_bool)
} }
} }
// STUB: LEGO1 0x1006c8f0 // FUNCTION: LEGO1 0x1006c8f0
MxResult LegoAnimPresenter::VTable0x94(Vector3&, Vector3&, float, float, Vector3&) // FUNCTION: BETA10 0x1005206c
MxU32 LegoAnimPresenter::VTable0x94(Vector3& p_vec1, Vector3& p_vec2, float p_f1, float p_f2, Vector3& p_vec3)
{ {
// TODO Mx3DPointFloat a, b;
return SUCCESS;
b = p_vec2;
((Vector3&) b).Mul(p_f1);
((Vector3&) b).Add(&p_vec1);
a = b;
((Vector3&) a).Sub(&m_unk0xa8);
float len = a.LenSquared();
if (len <= 0.0f) {
return TRUE;
}
if (m_unk0xa4 + p_f2 >= sqrt(len) && m_roiMapSize != 0 && m_roiMap != NULL) {
for (MxU32 i = 1; i <= m_roiMapSize; i++) {
if (m_roiMap[i]->GetLODCount() != 0 &&
m_roiMap[i]->FUN_100a9410(p_vec1, p_vec2, p_f1, p_f2, p_vec3, FALSE)) {
return TRUE;
}
}
}
return FALSE;
} }
// FUNCTION: LEGO1 0x1006ca50 // FUNCTION: LEGO1 0x1006ca50