Implement LegoPathActor::VTable0x9c (#942)

* Implement LegoPathActor::VTable0x9c

* Add annotation
This commit is contained in:
Christian Semmler 2024-05-20 12:27:54 -04:00 committed by GitHub
parent 3342464321
commit 7538988f50
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 105 additions and 19 deletions

View file

@ -38,7 +38,8 @@ class LegoCarRaceActor : public virtual LegoRaceActor {
void VTable0x70(float p_float) override; // vtable+0x70
MxU32 VTable0x90(float, Matrix4&) override; // vtable+0x90
MxResult VTable0x94(LegoPathActor* p_actor, MxBool p_bool) override; // vtable+0x94
void VTable0x98() override; // vtable+0x98
void VTable0x98(LegoPathBoundary*& p_boundary, LegoUnknown100db7f4*& p_edge, float& p_unk0xe4)
override; // vtable+0x98
MxResult VTable0x9c() override; // vtable+0x9c
virtual void FUN_10080590();

View file

@ -43,7 +43,8 @@ class LegoJetski : public LegoJetskiRaceActor, public LegoRaceMap {
) override; // vtable+0x6c
void VTable0x70(float p_float) override; // vtable+0x70
MxResult VTable0x94(LegoPathActor* p_actor, MxBool p_bool) override; // vtable+0x94
void VTable0x98() override; // vtable+0x98
void VTable0x98(LegoPathBoundary*& p_boundary, LegoUnknown100db7f4*& p_edge, float& p_unk0xe4)
override; // vtable+0x98
MxResult VTable0x9c() override; // vtable+0x9c
virtual void FUN_100136f0(float p_worldSpeed);

View file

@ -36,7 +36,8 @@ class LegoJetskiRaceActor : public virtual LegoCarRaceActor {
Vector3& p_v3
) override; // vtable+0x6c
void VTable0x70(float p_float) override; // vtable+0x70
void VTable0x98() override; // vtable+0x98
void VTable0x98(LegoPathBoundary*& p_boundary, LegoUnknown100db7f4*& p_edge, float& p_unk0xe4)
override; // vtable+0x98
MxResult VTable0x9c() override; // vtable+0x9c
void VTable0x1c() override; // vtable+0x1c

View file

@ -86,7 +86,11 @@ class LegoPathActor : public LegoActor {
// FUNCTION: LEGO1 0x10002d50
virtual MxResult VTable0x94(LegoPathActor*, MxBool) { return 0; } // vtable+0x94
virtual void VTable0x98(); // vtable+0x98
virtual void VTable0x98(
LegoPathBoundary*& p_boundary,
LegoUnknown100db7f4*& p_edge,
float& p_unk0xe4
); // vtable+0x98
virtual MxResult VTable0x9c(); // vtable+0x9c
// FUNCTION: LEGO1 0x10002d60

View file

@ -103,7 +103,7 @@ class LegoPathController : public MxCore {
LegoPathBoundary* GetPathBoundary(const char* p_name);
void Enable(MxBool p_enable);
void FUN_10046bb0(LegoWorld* p_world);
MxU32 FUN_1004a240(
MxS32 FUN_1004a240(
LegoPathEdgeContainer& p_grec,
Vector3& p_v1,
Vector3& p_v2,

View file

@ -40,6 +40,8 @@ struct LegoPathEdgeContainer : public list<LegoBoundaryEdge> {
}
}
MxU32 GetBit1() { return m_flags & c_bit1; }
Mx3DPointFloat m_unk0x0c; // 0x0c
Mx3DPointFloat m_unk0x20; // 0x20
LegoPathBoundary* m_boundary; // 0x34

View file

@ -42,7 +42,8 @@ class LegoRaceCar : public LegoCarRaceActor, public LegoRaceMap {
) override; // vtable+0x6c
void VTable0x70(float p_float) override; // vtable+0x70
MxResult VTable0x94(LegoPathActor* p_actor, MxBool p_bool) override; // vtable+0x94
void VTable0x98() override; // vtable+0x98
void VTable0x98(LegoPathBoundary*& p_boundary, LegoUnknown100db7f4*& p_edge, float& p_unk0xe4)
override; // vtable+0x98
MxResult VTable0x9c() override; // vtable+0x9c
virtual void FUN_10012ea0(float p_worldSpeed);

View file

@ -72,7 +72,7 @@ void LegoCarRaceActor::VTable0x70(float p_float)
}
// STUB: LEGO1 0x10081d20
void LegoCarRaceActor::VTable0x98()
void LegoCarRaceActor::VTable0x98(LegoPathBoundary*& p_boundary, LegoUnknown100db7f4*& p_edge, float& p_unk0xe4)
{
// TODO
}

View file

@ -71,7 +71,7 @@ MxResult LegoJetski::VTable0x94(LegoPathActor* p_actor, MxBool p_bool)
}
// STUB: LEGO1 0x100141c0
void LegoJetski::VTable0x98()
void LegoJetski::VTable0x98(LegoPathBoundary*& p_boundary, LegoUnknown100db7f4*& p_edge, float& p_unk0xe4)
{
// TODO
}

View file

@ -38,7 +38,7 @@ void LegoJetskiRaceActor::VTable0x70(float p_float)
}
// STUB: LEGO1 0x100822d0
void LegoJetskiRaceActor::VTable0x98()
void LegoJetskiRaceActor::VTable0x98(LegoPathBoundary*& p_boundary, LegoUnknown100db7f4*& p_edge, float& p_unk0xe4)
{
// TODO
}

View file

@ -400,6 +400,7 @@ void LegoExtraActor::SetWorldSpeed(MxFloat p_worldSpeed)
if (m_curAnim == 0 && p_worldSpeed > 0) {
VTable0xc4();
}
LegoAnimActor::SetWorldSpeed(p_worldSpeed);
}

View file

@ -418,7 +418,8 @@ void LegoPathActor::VTable0x70(float p_time)
}
// STUB: LEGO1 0x1002e8b0
void LegoPathActor::VTable0x98()
// FUNCTION: BETA10 0x100af2f7
void LegoPathActor::VTable0x98(LegoPathBoundary*& p_boundary, LegoUnknown100db7f4*& p_edge, float& p_unk0xe4)
{
// TODO
}
@ -545,11 +546,85 @@ void LegoPathActor::ParseAction(char* p_extra)
LegoActor::ParseAction(p_extra);
}
// STUB: LEGO1 0x1002f1b0
// FUNCTION: LEGO1 0x1002f1b0
// FUNCTION: BETA10 0x100af899
MxResult LegoPathActor::VTable0x9c()
{
// TODO
Mx3DPointFloat local34;
Mx3DPointFloat local48;
MxU32 local1c = 1;
MxU32 local20 = 1;
if (m_grec != NULL) {
if (m_grec->GetBit1()) {
local1c = 0;
local20 = 0;
Mx3DPointFloat vec;
switch (m_controller->FUN_1004a240(*m_grec, local34, local48, m_unk0xe4, m_destEdge, m_boundary)) {
case 0:
case 1:
break;
default:
return FAILURE;
}
}
else {
delete m_grec;
m_grec = NULL;
}
}
if (local1c != 0) {
VTable0x98(m_boundary, m_destEdge, m_unk0xe4);
}
if (local20 != 0) {
Mx3DPointFloat local78;
Vector3& v1 = *m_destEdge->GetOpposingPoint(*m_boundary);
Vector3& v2 = *m_destEdge->CCWVertex(*m_boundary);
LERP3(local34, v1, v2, m_unk0xe4);
m_destEdge->FUN_1002ddc0(*m_boundary, local78);
local48.EqualsCross(m_boundary->GetUnknown0x14(), &local78);
local48.Unitize();
}
Vector3 rightRef(m_unk0xec[0]);
Vector3 upRef(m_unk0xec[1]);
Vector3 dirRef(m_unk0xec[2]);
upRef = *m_boundary->GetUnknown0x14();
rightRef.EqualsCross(&upRef, &dirRef);
rightRef.Unitize();
dirRef.EqualsCross(&rightRef, &upRef);
dirRef.Unitize();
Mx3DPointFloat localc0(m_unk0xec[3]);
Mx3DPointFloat local84(m_unk0xec[2]);
Mx3DPointFloat local70(local34);
((Vector3&) local70).Sub(&localc0);
float len = local70.LenSquared();
if (len >= 0.0f) {
len = sqrt(len);
((Vector3&) local84).Mul(len);
((Vector3&) local48).Mul(len);
}
if (!m_userNavFlag) {
((Vector3&) local84).Mul(-1.0f);
}
if (VTable0x80(localc0, local84, local34, local48) != SUCCESS) {
return FAILURE;
}
m_unk0x7c = 0.0f;
return SUCCESS;
}

View file

@ -731,7 +731,7 @@ MxResult LegoPathController::ReadVector(LegoStorage* p_storage, Mx4DPointFloat&
// FUNCTION: LEGO1 0x1004a240
// FUNCTION: BETA10 0x100b9160
MxU32 LegoPathController::FUN_1004a240(
MxS32 LegoPathController::FUN_1004a240(
LegoPathEdgeContainer& p_grec,
Vector3& p_v1,
Vector3& p_v2,

View file

@ -91,7 +91,7 @@ MxResult LegoRaceCar::VTable0x94(LegoPathActor* p_actor, MxBool p_bool)
}
// STUB: LEGO1 0x10014550
void LegoRaceCar::VTable0x98()
void LegoRaceCar::VTable0x98(LegoPathBoundary*& p_boundary, LegoUnknown100db7f4*& p_edge, float& p_unk0xe4)
{
// TODO
}