Implement/match LegoPathBoundary::FUN_100575b0 (#939)

This commit is contained in:
Christian Semmler
2024-05-19 15:41:07 -04:00
committed by GitHub
parent c8a0e4cf8d
commit fb16b2c896
9 changed files with 79 additions and 43 deletions

View File

@@ -2139,8 +2139,8 @@ MxBool LegoAnimationManager::FUN_10063fb0(LegoLocation::Boundary* p_boundary, Le
MxBool LegoAnimationManager::FUN_10064010(LegoPathBoundary* p_boundary, LegoUnknown100db7f4* p_edge, float p_destScale)
{
Mx3DPointFloat p1;
Vector3* v1 = p_edge->GetOpposingPoint(p_boundary);
Vector3* v2 = p_edge->GetPoint(p_boundary);
Vector3* v1 = p_edge->GetOpposingPoint(*p_boundary);
Vector3* v2 = p_edge->CCWVertex(*p_boundary);
p1 = *v2;
((Vector3&) p1).Sub(v1);
@@ -2196,7 +2196,7 @@ MxBool LegoAnimationManager::FUN_10064120(LegoLocation::Boundary* p_boundary, Mx
e = local50;
do {
e = (LegoUnknown100db7f4*) e->GetCounterclockwiseEdge(boundary);
e = (LegoUnknown100db7f4*) e->GetCounterclockwiseEdge(*boundary);
if (e->GetMask0x03()) {
break;
}
@@ -2237,10 +2237,10 @@ MxBool LegoAnimationManager::FUN_10064120(LegoLocation::Boundary* p_boundary, Mx
do {
if (p_bool1) {
local34 = (LegoUnknown100db7f4*) local34->GetCounterclockwiseEdge(boundary);
local34 = (LegoUnknown100db7f4*) local34->GetCounterclockwiseEdge(*boundary);
}
else {
local34 = (LegoUnknown100db7f4*) local34->GetClockwiseEdge(boundary);
local34 = (LegoUnknown100db7f4*) local34->GetClockwiseEdge(*boundary);
}
} while (!local34->GetMask0x03() && local34 != local50);

View File

@@ -90,10 +90,10 @@ MxResult LegoPathActor::VTable0x88(
float p_destScale
)
{
Vector3* v1 = p_srcEdge.GetOpposingPoint(p_boundary);
Vector3* v2 = p_srcEdge.GetPoint(p_boundary);
Vector3* v3 = p_destEdge.GetOpposingPoint(p_boundary);
Vector3* v4 = p_destEdge.GetPoint(p_boundary);
Vector3* v1 = p_srcEdge.GetOpposingPoint(*p_boundary);
Vector3* v2 = p_srcEdge.CCWVertex(*p_boundary);
Vector3* v3 = p_destEdge.GetOpposingPoint(*p_boundary);
Vector3* v4 = p_destEdge.CCWVertex(*p_boundary);
Mx3DPointFloat p1, p2, p3, p4, p5;
@@ -167,8 +167,8 @@ MxResult LegoPathActor::VTable0x84(
float p_destScale
)
{
Vector3* v3 = p_destEdge.GetOpposingPoint(p_boundary);
Vector3* v4 = p_destEdge.GetPoint(p_boundary);
Vector3* v3 = p_destEdge.GetOpposingPoint(*p_boundary);
Vector3* v4 = p_destEdge.CCWVertex(*p_boundary);
Mx3DPointFloat p2, p3, p5;

View File

@@ -3,6 +3,7 @@
#include "decomp.h"
#include "geom/legounkown100db7f4.h"
#include "legopathactor.h"
#include "legopathstruct.h"
DECOMP_SIZE_ASSERT(LegoPathBoundary, 0x74)
@@ -40,9 +41,43 @@ MxResult LegoPathBoundary::RemoveActor(LegoPathActor* p_actor)
return SUCCESS;
}
// STUB: LEGO1 0x100575b0
// FUNCTION: LEGO1 0x100575b0
// FUNCTION: BETA10 0x100b1598
void LegoPathBoundary::FUN_100575b0(Vector3& p_point1, Vector3& p_point2, LegoPathActor* p_actor)
{
Vector3* ccwV = NULL;
if (m_unk0x48 > 0 && m_unk0x50 != NULL) {
ccwV = m_edges[0]->CCWVertex(*this);
Mx3DPointFloat v;
v = p_point1;
((Vector3&) v).Sub(ccwV);
float dot1 = v.Dot(&v, m_unk0x50);
v = p_point2;
((Vector3&) v).Sub(ccwV);
float dot2 = v.Dot(&v, m_unk0x50);
if (dot2 > dot1) {
for (MxS32 i = 0; i < m_unk0x48; i++) {
LegoPathStruct* s = m_unk0x4c[i].m_unk0x00;
if (m_unk0x4c[i].m_unk0x08 >= dot1 && m_unk0x4c[i].m_unk0x08 < dot2) {
s->VTable0x04(p_actor, 1, m_unk0x4c[i].m_unk0x04);
}
}
}
else if (dot2 < dot1) {
for (MxS32 i = 0; i < m_unk0x48; i++) {
LegoPathStruct* s = m_unk0x4c[i].m_unk0x00;
if (m_unk0x4c[i].m_unk0x08 >= dot2 && m_unk0x4c[i].m_unk0x08 < dot1) {
s->VTable0x04(p_actor, 0, m_unk0x4c[i].m_unk0x04);
}
}
}
}
}
// FUNCTION: LEGO1 0x10057950
@@ -98,7 +133,7 @@ MxU32 LegoPathBoundary::Intersect(
Mx3DPointFloat local50;
Mx3DPointFloat local70;
Vector3* local5c = e->GetOpposingPoint(this);
Vector3* local5c = e->GetOpposingPoint(*this);
p_point3 = vec;
p_point3.Mul(localc);
@@ -115,15 +150,15 @@ MxU32 LegoPathBoundary::Intersect(
if (local58 < 0.0f) {
Mx3DPointFloat local84;
for (LegoUnknown100db7f4* local88 = (LegoUnknown100db7f4*) e->GetClockwiseEdge(this); e != local88;
local88 = (LegoUnknown100db7f4*) local88->GetClockwiseEdge(this)) {
for (LegoUnknown100db7f4* local88 = (LegoUnknown100db7f4*) e->GetClockwiseEdge(*this); e != local88;
local88 = (LegoUnknown100db7f4*) local88->GetClockwiseEdge(*this)) {
local88->FUN_1002ddc0(*this, local84);
if (local84.Dot(&local84, &local70) <= 0.9) {
break;
}
Vector3* local90 = local88->GetOpposingPoint(this);
Vector3* local90 = local88->GetOpposingPoint(*this);
Mx3DPointFloat locala4(p_point3);
((Vector3&) locala4).Sub(local90);
@@ -141,16 +176,16 @@ MxU32 LegoPathBoundary::Intersect(
if (e->m_unk0x3c < local58) {
Mx3DPointFloat localbc;
for (LegoUnknown100db7f4* locala8 = (LegoUnknown100db7f4*) e->GetCounterclockwiseEdge(this);
for (LegoUnknown100db7f4* locala8 = (LegoUnknown100db7f4*) e->GetCounterclockwiseEdge(*this);
e != locala8;
locala8 = (LegoUnknown100db7f4*) locala8->GetCounterclockwiseEdge(this)) {
locala8 = (LegoUnknown100db7f4*) locala8->GetCounterclockwiseEdge(*this)) {
locala8->FUN_1002ddc0(*this, localbc);
if (localbc.Dot(&localbc, &local70) <= 0.9) {
break;
}
Vector3* localc4 = locala8->GetOpposingPoint(this);
Vector3* localc4 = locala8->GetOpposingPoint(*this);
Mx3DPointFloat locald8(p_point3);
((Vector3&) locald8).Sub(localc4);
@@ -172,7 +207,7 @@ MxU32 LegoPathBoundary::Intersect(
if (local58 <= 0.0f) {
if (!e->GetMask0x03()) {
p_edge = e->GetClockwiseEdge(this);
p_edge = e->GetClockwiseEdge(*this);
}
else {
p_edge = e;
@@ -189,10 +224,10 @@ MxU32 LegoPathBoundary::Intersect(
return 1;
}
else {
p_point3 = *e->GetPoint(this);
p_point3 = *e->CCWVertex(*this);
if (!e->GetMask0x03()) {
p_edge = e->GetCounterclockwiseEdge(this);
p_edge = e->GetCounterclockwiseEdge(*this);
}
else {
p_edge = e;

View File

@@ -279,10 +279,10 @@ MxResult LegoPathController::FUN_10046050(
if (edge->GetMask0x03()) {
Mx3DPointFloat vec;
if (((LegoUnknown100db7f4*) edge->GetClockwiseEdge(boundary))->FUN_1002ddc0(*boundary, vec) == SUCCESS &&
if (((LegoUnknown100db7f4*) edge->GetClockwiseEdge(*boundary))->FUN_1002ddc0(*boundary, vec) == SUCCESS &&
vec.Dot(&vec, &p_direction) < 0.0f) {
edge =
(LegoUnknown100db7f4*) edge->GetCounterclockwiseEdge(boundary)->GetCounterclockwiseEdge(boundary);
(LegoUnknown100db7f4*) edge->GetCounterclockwiseEdge(*boundary)->GetCounterclockwiseEdge(*boundary);
}
if (!edge->GetMask0x03()) {

View File

@@ -5,7 +5,7 @@ DECOMP_SIZE_ASSERT(LegoPathStruct, 0x14)
// STUB: LEGO1 0x1001b700
// FUNCTION: BETA10 0x100c26c5
void LegoPathStruct::VTable0x04(undefined4, undefined4, undefined4)
void LegoPathStruct::VTable0x04(LegoPathActor*, undefined4, undefined4)
{
// TODO
}