Full match on LEGO1 and BETA10

This commit is contained in:
jonschz 2024-12-14 09:18:28 +01:00
parent 42cb46fe67
commit a60019a86c
2 changed files with 27 additions and 19 deletions

View File

@ -140,7 +140,7 @@ MxResult LegoPlantManager::FUN_10026410()
for (MxS32 j = 0; j < boundary->GetNumEdges(); j++) { for (MxS32 j = 0; j < boundary->GetNumEdges(); j++) {
Mx4DPointFloat* normal = boundary->GetEdgeNormal(j); Mx4DPointFloat* normal = boundary->GetEdgeNormal(j);
if (position.Dot(normal, &position) + (*normal)[3] < -0.001) { if (position.Dot(normal, &position) + (*normal).index_operator(3) < -0.001) {
MxTrace( MxTrace(
"Plant %d shot location (%g, %g, %g) is not in boundary %s.\n", "Plant %d shot location (%g, %g, %g) is not in boundary %s.\n",
i, i,
@ -157,25 +157,28 @@ MxResult LegoPlantManager::FUN_10026410()
if (g_plantInfo[i].m_boundary != NULL) { if (g_plantInfo[i].m_boundary != NULL) {
Mx4DPointFloat& unk0x14 = *g_plantInfo[i].m_boundary->GetUnknown0x14(); Mx4DPointFloat& unk0x14 = *g_plantInfo[i].m_boundary->GetUnknown0x14();
if (position.Dot(&position, &unk0x14) + unk0x14[3] <= 0.001 && if (position.Dot(&position, &unk0x14) + unk0x14.index_operator(3) > 0.001 ||
position.Dot(&position, &unk0x14) + unk0x14[3] >= -0.001) { position.Dot(&position, &unk0x14) + unk0x14.index_operator(3) < -0.001) {
continue;
g_plantInfo[i].m_y =
-((position[0] * unk0x14.index_operator(0) + unk0x14.index_operator(3) +
position[2] * unk0x14.index_operator(2)) /
unk0x14.index_operator(1));
MxTrace(
"Plant %d shot location (%g, %g, %g) is not on plane of boundary %s...adjusting to (%g, "
"%g, "
"%g)\n",
i,
position[0],
position[1],
position[2],
g_plantInfo[i].m_boundary->GetName(),
position[0],
g_plantInfo[i].m_y,
position[2]
);
} }
g_plantInfo[i].m_y =
-((unk0x14[3] + unk0x14[0] * position[0] + unk0x14[2] * position[2]) / unk0x14[1]);
MxTrace(
"Plant %d shot location (%g, %g, %g) is not on plane of boundary %s...adjusting to (%g, %g, %g)\n",
i,
position[0],
position[1],
position[2],
g_plantInfo[i].m_boundary->GetName(),
position[0],
g_plantInfo[i].m_y,
position[2]
);
} }
} }
else { else {

View File

@ -78,6 +78,11 @@ class Mx4DPointFloat : public Vector4 {
const float& operator[](int idx) const { return m_data[idx]; } const float& operator[](int idx) const { return m_data[idx]; }
// only used by a couple of BETA10 functions for some unknown reason
// FUNCTION: BETA10 0x1001c950
float& index_operator(int idx) { return m_data[idx]; }
// SYNTHETIC: LEGO1 0x10064b20 // SYNTHETIC: LEGO1 0x10064b20
// SYNTHETIC: BETA10 0x10070420 // SYNTHETIC: BETA10 0x10070420
// ??4Mx4DPointFloat@@QAEAAV0@ABV0@@Z // ??4Mx4DPointFloat@@QAEAAV0@ABV0@@Z