Implement/match LegoWEGEdge functions (#1259)

* Implement/match `LegoWEGEdge::VTable0x04`

* Implement/match `LegoWEGEdge::FUN_1009aea0`

* Rename
This commit is contained in:
Christian Semmler
2024-12-22 11:47:39 -07:00
committed by GitHub
parent 3e6d789324
commit cbc3d7227e
9 changed files with 266 additions and 18 deletions

View File

@@ -48,7 +48,7 @@ void LegoPathBoundary::FUN_100575b0(Vector3& p_point1, Vector3& p_point2, LegoPa
{
Vector3* ccwV = NULL;
if (m_unk0x48 > 0 && m_unk0x50 != NULL) {
if (m_numTriggers > 0 && m_unk0x50 != NULL) {
ccwV = m_edges[0]->CCWVertex(*this);
Mx3DPointFloat v;
@@ -61,7 +61,7 @@ void LegoPathBoundary::FUN_100575b0(Vector3& p_point1, Vector3& p_point2, LegoPa
float dot2 = v.Dot(&v, m_unk0x50);
if (dot2 > dot1) {
for (MxS32 i = 0; i < m_unk0x48; i++) {
for (MxS32 i = 0; i < m_numTriggers; i++) {
LegoPathStruct* s = m_pathTrigger[i].m_pathStruct;
if (m_pathTrigger[i].m_unk0x08 >= dot1 && m_pathTrigger[i].m_unk0x08 < dot2) {
@@ -70,7 +70,7 @@ void LegoPathBoundary::FUN_100575b0(Vector3& p_point1, Vector3& p_point2, LegoPa
}
}
else if (dot2 < dot1) {
for (MxS32 i = 0; i < m_unk0x48; i++) {
for (MxS32 i = 0; i < m_numTriggers; i++) {
LegoPathStruct* s = m_pathTrigger[i].m_pathStruct;
if (m_pathTrigger[i].m_unk0x08 >= dot2 && m_pathTrigger[i].m_unk0x08 < dot1) {

View File

@@ -673,15 +673,15 @@ MxResult LegoPathController::ReadBoundaries(LegoStorage* p_storage)
return FAILURE;
}
if (p_storage->Read(&boundary.m_unk0x48, sizeof(boundary.m_unk0x48)) != SUCCESS) {
if (p_storage->Read(&boundary.m_numTriggers, sizeof(boundary.m_numTriggers)) != SUCCESS) {
return FAILURE;
}
if (boundary.m_unk0x48 > 0) {
if (boundary.m_numTriggers > 0) {
boundary.m_unk0x50 = new Mx3DPointFloat;
boundary.m_pathTrigger = new LegoWEGEdge::PathWithTrigger[boundary.m_unk0x48];
boundary.m_pathTrigger = new LegoWEGEdge::PathWithTrigger[boundary.m_numTriggers];
for (j = 0; j < boundary.m_unk0x48; j++) {
for (j = 0; j < boundary.m_numTriggers; j++) {
if (p_storage->Read(&s, sizeof(s)) != SUCCESS) {
return FAILURE;
}