Refactor LegoUnknown100db7f4 to LegoOrientedEdge (#1515)

* Refactor `LegoUnknown100db7f4` to `LegoOrientedEdge`

* Update LEGO1/lego/sources/geom/legoorientededge.h

* Update legopathcontroller.h

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
This commit is contained in:
Florian Kaiser
2025-05-25 08:09:24 +02:00
committed by GitHub
parent 8e54a20d7d
commit 804632b13f
24 changed files with 158 additions and 166 deletions

View File

@@ -316,12 +316,12 @@ void LegoRaceCar::FUN_10012ff0(float p_param)
if (a->GetDuration() <= deltaTime || deltaTime < 0.0) {
if (m_userState == LEGORACECAR_KICK1) {
LegoUnknown100db7f4** edges = m_kick1B->GetEdges();
LegoOrientedEdge** edges = m_kick1B->GetEdges();
m_destEdge = edges[2];
m_boundary = m_kick1B;
}
else {
LegoUnknown100db7f4** edges = m_kick1B->GetEdges();
LegoOrientedEdge** edges = m_kick1B->GetEdges();
m_destEdge = edges[1];
m_boundary = m_kick2B;
}

View File

@@ -1,6 +1,6 @@
#include "legoracespecial.h"
#include "geom/legounkown100db7f4.h"
#include "geom/legoorientededge.h"
#include "legonavcontroller.h"
#include "legopathboundary.h"
#include "legopathcontroller.h"
@@ -65,7 +65,7 @@ void LegoCarRaceActor::FUN_10080590(float p_time)
Mx3DPointFloat destEdgeUnknownVector;
Mx3DPointFloat worldDirection = Mx3DPointFloat(m_roi->GetWorldDirection());
m_destEdge->FUN_1002ddc0(*m_boundary, destEdgeUnknownVector);
m_destEdge->GetFaceNormal(*m_boundary, destEdgeUnknownVector);
if (abs(destEdgeUnknownVector.Dot(destEdgeUnknownVector.GetData(), worldDirection.GetData())) > 0.5) {
maxSpeed *= m_unk0x10;
@@ -169,7 +169,7 @@ MxS32 LegoCarRaceActor::VTable0x1c(LegoPathBoundary* p_boundary, LegoEdge* p_edg
LERP3(pointUnknown, *v1, *v2, m_unk0xe4);
m_destEdge->FUN_1002ddc0(*m_boundary, destEdgeUnknownVector);
m_destEdge->GetFaceNormal(*m_boundary, destEdgeUnknownVector);
crossProduct.EqualsCross(*m_boundary->GetUnknown0x14(), destEdgeUnknownVector);
crossProduct.Unitize();
@@ -212,7 +212,7 @@ MxS32 LegoCarRaceActor::VTable0x1c(LegoPathBoundary* p_boundary, LegoEdge* p_edg
// FUNCTION: LEGO1 0x10080b40
// FUNCTION: BETA10 0x100cdb3c
void LegoCarRaceActor::SwitchBoundary(LegoPathBoundary*& p_boundary, LegoUnknown100db7f4*& p_edge, float& p_unk0xe4)
void LegoCarRaceActor::SwitchBoundary(LegoPathBoundary*& p_boundary, LegoOrientedEdge*& p_edge, float& p_unk0xe4)
{
LegoPathActor::SwitchBoundary(m_boundary, m_destEdge, m_unk0xe4);
}
@@ -241,7 +241,7 @@ void LegoCarRaceActor::Animate(float p_time)
// FUNCTION: BETA10 0x100cdc54
MxResult LegoCarRaceActor::VTable0x9c()
{
LegoUnknown100db7f4* d = m_destEdge;
LegoOrientedEdge* d = m_destEdge;
if (VTable0x1c(m_boundary, m_destEdge)) {
LegoPathBoundary* b = m_boundary;
@@ -262,8 +262,8 @@ MxResult LegoCarRaceActor::VTable0x9c()
Mx3DPointFloat point4;
Mx3DPointFloat point5;
d->FUN_1002ddc0(*b, point2);
m_destEdge->FUN_1002ddc0(*m_boundary, point3);
d->GetFaceNormal(*b, point2);
m_destEdge->GetFaceNormal(*m_boundary, point3);
point4.EqualsCross(point2, *m_boundary->GetUnknown0x14());
point5.EqualsCross(*m_boundary->GetUnknown0x14(), point3);
@@ -364,7 +364,7 @@ MxS32 LegoJetskiRaceActor::VTable0x1c(LegoPathBoundary* p_boundary, LegoEdge* p_
LERP3(a, *v1, *v2, m_unk0xe4);
m_destEdge->FUN_1002ddc0(*m_boundary, bbb);
m_destEdge->GetFaceNormal(*m_boundary, bbb);
c.EqualsCross(bbb, *m_boundary->GetUnknown0x14());
c.Unitize();