mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-23 16:34:06 +00:00
Implement/match LegoPlantManager::FUN_10026410
(#1223)
* Implement/match `LegoPlantManager::FUN_10026410` * Full match on LEGO1 and BETA10 * Improve `LegoBuildingManager::FUN_10030630` --------- Co-authored-by: jonschz <jonschz@users.noreply.github.com>
This commit is contained in:
@@ -221,6 +221,7 @@ char* LegoBuildingManager::g_customizeAnimFile = NULL;
|
||||
MxS32 g_buildingManagerConfig = 1;
|
||||
|
||||
// GLOBAL: LEGO1 0x10104c30
|
||||
// GLOBAL: BETA10 0x10209fa0
|
||||
LegoBuildingInfo g_buildingInfo[16];
|
||||
|
||||
// GLOBAL: LEGO1 0x100f3748
|
||||
@@ -808,7 +809,7 @@ MxResult LegoBuildingManager::FUN_10030630()
|
||||
for (MxS32 j = 0; j < boundary->GetNumEdges(); 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(
|
||||
"Building %d shot location (%g, %g, %g) is not in boundary %s.\n",
|
||||
i,
|
||||
@@ -825,26 +826,28 @@ MxResult LegoBuildingManager::FUN_10030630()
|
||||
if (g_buildingInfo[i].m_boundary != NULL) {
|
||||
Mx4DPointFloat& unk0x14 = *g_buildingInfo[i].m_boundary->GetUnknown0x14();
|
||||
|
||||
if (position.Dot(&position, &unk0x14) + unk0x14[3] <= 0.001 &&
|
||||
position.Dot(&position, &unk0x14) + unk0x14[3] >= -0.001) {
|
||||
continue;
|
||||
if (position.Dot(&position, &unk0x14) + unk0x14.index_operator(3) > 0.001 ||
|
||||
position.Dot(&position, &unk0x14) + unk0x14.index_operator(3) < -0.001) {
|
||||
|
||||
g_buildingInfo[i].m_y =
|
||||
-((position[0] * unk0x14.index_operator(0) + unk0x14.index_operator(3) +
|
||||
position[2] * unk0x14.index_operator(2)) /
|
||||
unk0x14.index_operator(1));
|
||||
|
||||
MxTrace(
|
||||
"Building %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_buildingInfo[i].m_boundary->GetName(),
|
||||
position[0],
|
||||
g_buildingInfo[i].m_y,
|
||||
position[2]
|
||||
);
|
||||
}
|
||||
|
||||
g_buildingInfo[i].m_y =
|
||||
-((unk0x14[3] + unk0x14[0] * position[0] + unk0x14[2] * position[2]) / unk0x14[1]);
|
||||
|
||||
MxTrace(
|
||||
"Building %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_buildingInfo[i].m_boundary->GetName(),
|
||||
position[0],
|
||||
g_buildingInfo[i].m_y,
|
||||
position[2]
|
||||
);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
Reference in New Issue
Block a user