Match LegoExtraActor::FUN_1002aae0

This commit is contained in:
Christian Semmler 2024-03-28 09:10:36 -04:00
parent 944a210e39
commit a96c072c92
3 changed files with 18 additions and 8 deletions

View File

@ -93,15 +93,15 @@ void LegoExtraActor::VTable0xa4(MxU8& p_und1, MxS32& p_und2)
case 1: case 1:
p_und1 = 1; p_und1 = 1;
p_und2 = 1; p_und2 = 1;
return; break;
case 2: case 2:
p_und1 = 0; p_und1 = 0;
p_und2 = 1; p_und2 = 1;
return; break;
default: default:
p_und1 = 1; p_und1 = 1;
p_und2 = rand() % p_und2 + 1; p_und2 = rand() % p_und2 + 1;
return; break;
} }
} }
@ -110,20 +110,24 @@ MxResult LegoExtraActor::FUN_1002aae0()
{ {
LegoPathBoundary* oldEdge = m_boundary; LegoPathBoundary* oldEdge = m_boundary;
Vector3 dir(m_unk0xec[0]); Vector3 dir(m_unk0xec[0]);
Vector3 right(m_unk0xec[1]);
Vector3 up(m_unk0xec[2]); Vector3 up(m_unk0xec[2]);
float scale = -1.0f; Vector3 unused(m_unk0xec[3]);
float* right = m_unk0xec[1];
up.Mul(scale); up.Mul(-1.0f);
((Vector3&) dir).EqualsCrossImpl(right, up.GetData()); dir.EqualsCross(&right, &up);
if (m_boundary == m_destEdge->m_faceA) { if (m_boundary == m_destEdge->m_faceA) {
m_boundary = (LegoPathBoundary*) m_destEdge->m_faceB; m_boundary = (LegoPathBoundary*) m_destEdge->m_faceB;
} }
else { else {
m_boundary = (LegoPathBoundary*) m_destEdge->m_faceA; m_boundary = (LegoPathBoundary*) m_destEdge->m_faceA;
} }
if (!m_boundary) { if (!m_boundary) {
m_boundary = oldEdge; m_boundary = oldEdge;
} }
LegoPathActor::VTable0x9c(); LegoPathActor::VTable0x9c();
return SUCCESS; return SUCCESS;
} }

View File

@ -9,6 +9,9 @@ struct UnknownMatrixType {
float m_data[4][4]; float m_data[4][4];
}; };
// Note: Many functions most likely take const references/pointers instead of non-const.
// The class needs to undergo a very careful refactoring to fix that (no matches should break).
// VTABLE: LEGO1 0x100d4350 // VTABLE: LEGO1 0x100d4350
// SIZE 0x08 // SIZE 0x08
class Matrix4 { class Matrix4 {

View File

@ -6,6 +6,9 @@
#include <math.h> #include <math.h>
#include <memory.h> #include <memory.h>
// Note: Many functions most likely take const references/pointers instead of non-const.
// The class needs to undergo a very careful refactoring to fix that (no matches should break).
// VTABLE: LEGO1 0x100d4288 // VTABLE: LEGO1 0x100d4288
// SIZE 0x08 // SIZE 0x08
class Vector2 { class Vector2 {
@ -130,7 +133,7 @@ class Vector2 {
virtual void Mul(Vector2* p_other) { MulVectorImpl(p_other->m_data); } // vtable+0x60 virtual void Mul(Vector2* p_other) { MulVectorImpl(p_other->m_data); } // vtable+0x60
// FUNCTION: LEGO1 0x10002230 // FUNCTION: LEGO1 0x10002230
virtual void Mul(float& p_value) { MulScalarImpl(&p_value); } // vtable+0x5c virtual void Mul(const float& p_value) { MulScalarImpl((float*) &p_value); } // vtable+0x5c
// FUNCTION: LEGO1 0x10002240 // FUNCTION: LEGO1 0x10002240
virtual void Div(float& p_value) { DivScalarImpl(&p_value); } // vtable+0x68 virtual void Div(float& p_value) { DivScalarImpl(&p_value); } // vtable+0x68