Implement/match ViewManager::FUN_100a6150 (#934)

This commit is contained in:
Christian Semmler 2024-05-18 12:27:14 -04:00 committed by GitHub
parent c1c78cb8aa
commit 01735bdc28
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 31 additions and 4 deletions

View file

@ -8,6 +8,9 @@
DECOMP_SIZE_ASSERT(ViewManager, 0x1bc)
// GLOBAL: LEGO1 0x100dbc78
int g_unk0x100dbc78[8][3] = {{0, 0, 0}, {0, 0, 1}, {0, 1, 0}, {1, 0, 0}, {0, 1, 1}, {1, 0, 1}, {1, 1, 0}, {1, 1, 1}};
// GLOBAL: LEGO1 0x100dbcd8
int g_unk0x100dbcd8[18] = {0, 1, 5, 6, 2, 3, 3, 0, 4, 1, 2, 6, 0, 3, 2, 4, 5, 6};
@ -55,11 +58,35 @@ ViewManager::~ViewManager()
SetPOVSource(NULL);
}
// STUB: LEGO1 0x100a6150
// FUNCTION: LEGO1 0x100a6150
// FUNCTION: BETA10 0x10172164
undefined4 ViewManager::FUN_100a6150(const BoundingBox& p_bounding_box)
unsigned int ViewManager::FUN_100a6150(const BoundingBox& p_bounding_box)
{
return 1;
const Vector3* box[] = {&p_bounding_box.Min(), &p_bounding_box.Max()};
float und[8][3];
int i, j, k;
for (i = 0; i < 8; i++) {
for (j = 0; j < 3; j++) {
und[i][j] = box[g_unk0x100dbc78[i][j]]->operator[](j);
}
}
for (i = 0; i < 6; i++) {
for (k = 0; k < 8; k++) {
if (unk0x150[i][0] * und[k][0] + unk0x150[i][2] * und[k][2] + unk0x150[i][1] * und[k][1] + unk0x150[i][3] >=
0.0f) {
break;
}
}
if (k == 8) {
return FALSE;
}
}
return TRUE;
}
// FUNCTION: LEGO1 0x100a6410

View file

@ -23,7 +23,7 @@ class ViewManager {
void Remove(ViewROI* p_roi);
void RemoveAll(ViewROI* p_roi);
undefined4 FUN_100a6150(const BoundingBox& p_bounding_box);
unsigned int FUN_100a6150(const BoundingBox& p_bounding_box);
void FUN_100a65b0(ViewROI* p_roi, int p_und);
void FUN_100a66a0(ViewROI* p_roi);
void SetPOVSource(const OrientableROI* point_of_view);