Implement/match LegoCameraController::FUN_10012290 and FUN_10012320 (#969)

This commit is contained in:
Christian Semmler
2024-05-30 08:48:14 -04:00
committed by GitHub
parent 085bdbe74b
commit 689178f689
3 changed files with 26 additions and 7 deletions

View File

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

View File

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