1
0
Fork 0
mirror of https://github.com/isledecomp/isle.git synced 2025-04-21 02:50:52 -04:00

Implement/match LegoCameraController::FUN_10012290 and FUN_10012320 ()

This commit is contained in:
Christian Semmler 2024-05-30 08:48:14 -04:00 committed by GitHub
parent 085bdbe74b
commit 689178f689
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 26 additions and 7 deletions
LEGO1
lego/legoomni
realtime

View file

@ -36,8 +36,8 @@ public:
virtual MxResult Create(); // vtable+0x44
void SetWorldTransform(const Vector3& p_at, const Vector3& p_dir, const Vector3& p_up);
void FUN_10012290(float);
void FUN_10012320(MxFloat);
void FUN_10012290(float p_angle);
void FUN_10012320(float p_angle);
void FUN_100123e0(const Matrix4& p_transform, MxU32 p_und);
Mx3DPointFloat GetWorldUp();
Mx3DPointFloat GetWorldLocation();

View file

@ -124,15 +124,20 @@ void LegoCameraController::SetWorldTransform(const Vector3& p_at, const Vector3&
m_matrix2 = m_matrix1;
}
// STUB: LEGO1 0x10012290
void LegoCameraController::FUN_10012290(float)
// FUNCTION: LEGO1 0x10012290
// FUNCTION: BETA10 0x10068c34
void LegoCameraController::FUN_10012290(float p_angle)
{
m_matrix1 = m_matrix2;
m_matrix1.RotateZ(p_angle);
}
// STUB: LEGO1 0x10012320
void LegoCameraController::FUN_10012320(MxFloat)
// FUNCTION: LEGO1 0x10012320
// FUNCTION: BETA10 0x10068c73
void LegoCameraController::FUN_10012320(float p_angle)
{
// TODO
m_matrix1 = m_matrix2;
m_matrix1.RotateY(p_angle);
}
// FUNCTION: LEGO1 0x100123e0

View file

@ -133,6 +133,20 @@ public:
}
}
// FUNCTION: BETA10 0x1001fd60
inline void RotateY(const float& p_angle)
{
float s = sin(p_angle);
float c = cos(p_angle);
float matrix[4][4];
memcpy(matrix, m_data, sizeof(float) * 16);
for (int i = 0; i < 4; i++) {
m_data[i][0] = matrix[i][0] * c + matrix[i][2] * s;
m_data[i][2] = matrix[i][2] * c - matrix[i][0] * s;
}
}
// FUNCTION: BETA10 0x1006ab10
inline void RotateZ(const float& p_angle)
{
float s = sin(p_angle);