diff --git a/LEGO1/lego/legoomni/include/legocarraceactor.h b/LEGO1/lego/legoomni/include/legocarraceactor.h index dc0a74be..060ac703 100644 --- a/LEGO1/lego/legoomni/include/legocarraceactor.h +++ b/LEGO1/lego/legoomni/include/legocarraceactor.h @@ -38,8 +38,9 @@ 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 - MxResult VTable0x9c() override; // vtable+0x9c + void VTable0x98(LegoPathBoundary*& p_boundary, LegoUnknown100db7f4*& p_edge, float& p_unk0xe4) + override; // vtable+0x98 + MxResult VTable0x9c() override; // vtable+0x9c virtual void FUN_10080590(); diff --git a/LEGO1/lego/legoomni/include/legojetski.h b/LEGO1/lego/legoomni/include/legojetski.h index 682fbda8..a90f817b 100644 --- a/LEGO1/lego/legoomni/include/legojetski.h +++ b/LEGO1/lego/legoomni/include/legojetski.h @@ -43,8 +43,9 @@ 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 - MxResult VTable0x9c() override; // vtable+0x9c + 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); diff --git a/LEGO1/lego/legoomni/include/legojetskiraceactor.h b/LEGO1/lego/legoomni/include/legojetskiraceactor.h index e4616527..d7b58c63 100644 --- a/LEGO1/lego/legoomni/include/legojetskiraceactor.h +++ b/LEGO1/lego/legoomni/include/legojetskiraceactor.h @@ -36,9 +36,10 @@ class LegoJetskiRaceActor : public virtual LegoCarRaceActor { Vector3& p_v3 ) override; // vtable+0x6c void VTable0x70(float p_float) override; // vtable+0x70 - void VTable0x98() override; // vtable+0x98 - MxResult VTable0x9c() override; // vtable+0x9c - void VTable0x1c() override; // vtable+0x1c + void VTable0x98(LegoPathBoundary*& p_boundary, LegoUnknown100db7f4*& p_edge, float& p_unk0xe4) + override; // vtable+0x98 + MxResult VTable0x9c() override; // vtable+0x9c + void VTable0x1c() override; // vtable+0x1c // SYNTHETIC: LEGO1 0x10081d40 // LegoJetskiRaceActor::`scalar deleting destructor' diff --git a/LEGO1/lego/legoomni/include/legopathactor.h b/LEGO1/lego/legoomni/include/legopathactor.h index 261ee3a6..fd62fa76 100644 --- a/LEGO1/lego/legoomni/include/legopathactor.h +++ b/LEGO1/lego/legoomni/include/legopathactor.h @@ -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 diff --git a/LEGO1/lego/legoomni/include/legopathcontroller.h b/LEGO1/lego/legoomni/include/legopathcontroller.h index 10b83de5..e5d84e94 100644 --- a/LEGO1/lego/legoomni/include/legopathcontroller.h +++ b/LEGO1/lego/legoomni/include/legopathcontroller.h @@ -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, diff --git a/LEGO1/lego/legoomni/include/legopathedgecontainer.h b/LEGO1/lego/legoomni/include/legopathedgecontainer.h index 2d6f7b38..c133122c 100644 --- a/LEGO1/lego/legoomni/include/legopathedgecontainer.h +++ b/LEGO1/lego/legoomni/include/legopathedgecontainer.h @@ -40,6 +40,8 @@ struct LegoPathEdgeContainer : public list { } } + MxU32 GetBit1() { return m_flags & c_bit1; } + Mx3DPointFloat m_unk0x0c; // 0x0c Mx3DPointFloat m_unk0x20; // 0x20 LegoPathBoundary* m_boundary; // 0x34 diff --git a/LEGO1/lego/legoomni/include/legoracecar.h b/LEGO1/lego/legoomni/include/legoracecar.h index b8b1f66b..6427fbf9 100644 --- a/LEGO1/lego/legoomni/include/legoracecar.h +++ b/LEGO1/lego/legoomni/include/legoracecar.h @@ -42,8 +42,9 @@ 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 - MxResult VTable0x9c() override; // vtable+0x9c + 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); virtual void FUN_10012ff0(float); diff --git a/LEGO1/lego/legoomni/src/entity/legocarraceactor.cpp b/LEGO1/lego/legoomni/src/entity/legocarraceactor.cpp index a7d7f3ad..e2f807fc 100644 --- a/LEGO1/lego/legoomni/src/entity/legocarraceactor.cpp +++ b/LEGO1/lego/legoomni/src/entity/legocarraceactor.cpp @@ -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 } diff --git a/LEGO1/lego/legoomni/src/entity/legojetski.cpp b/LEGO1/lego/legoomni/src/entity/legojetski.cpp index 38d881d1..8d64dcd9 100644 --- a/LEGO1/lego/legoomni/src/entity/legojetski.cpp +++ b/LEGO1/lego/legoomni/src/entity/legojetski.cpp @@ -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 } diff --git a/LEGO1/lego/legoomni/src/entity/legojetskiraceactor.cpp b/LEGO1/lego/legoomni/src/entity/legojetskiraceactor.cpp index e19e6cb3..bdb8539f 100644 --- a/LEGO1/lego/legoomni/src/entity/legojetskiraceactor.cpp +++ b/LEGO1/lego/legoomni/src/entity/legojetskiraceactor.cpp @@ -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 } diff --git a/LEGO1/lego/legoomni/src/paths/legoextraactor.cpp b/LEGO1/lego/legoomni/src/paths/legoextraactor.cpp index 900e7c5c..b3118e38 100644 --- a/LEGO1/lego/legoomni/src/paths/legoextraactor.cpp +++ b/LEGO1/lego/legoomni/src/paths/legoextraactor.cpp @@ -400,6 +400,7 @@ void LegoExtraActor::SetWorldSpeed(MxFloat p_worldSpeed) if (m_curAnim == 0 && p_worldSpeed > 0) { VTable0xc4(); } + LegoAnimActor::SetWorldSpeed(p_worldSpeed); } diff --git a/LEGO1/lego/legoomni/src/paths/legopathactor.cpp b/LEGO1/lego/legoomni/src/paths/legopathactor.cpp index f30e2136..9c608ddf 100644 --- a/LEGO1/lego/legoomni/src/paths/legopathactor.cpp +++ b/LEGO1/lego/legoomni/src/paths/legopathactor.cpp @@ -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; } diff --git a/LEGO1/lego/legoomni/src/paths/legopathcontroller.cpp b/LEGO1/lego/legoomni/src/paths/legopathcontroller.cpp index ec7c8530..8894ea40 100644 --- a/LEGO1/lego/legoomni/src/paths/legopathcontroller.cpp +++ b/LEGO1/lego/legoomni/src/paths/legopathcontroller.cpp @@ -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, diff --git a/LEGO1/lego/legoomni/src/race/legoracecar.cpp b/LEGO1/lego/legoomni/src/race/legoracecar.cpp index c22310a3..e520317a 100644 --- a/LEGO1/lego/legoomni/src/race/legoracecar.cpp +++ b/LEGO1/lego/legoomni/src/race/legoracecar.cpp @@ -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 }