Implement/match LegoCameraController::FUN_100123e0 (#715)

This commit is contained in:
Christian Semmler 2024-03-23 13:46:27 -04:00 committed by GitHub
parent 0391b5b42a
commit 8b43e940f8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 33 additions and 4 deletions

View file

@ -37,7 +37,7 @@ class LegoCameraController : public LegoPointOfViewController {
virtual MxResult Create(); // vtable+0x44
void SetWorldTransform(const Vector3& p_at, const Vector3& p_dir, const Vector3& p_up);
void FUN_100123e0(const Matrix4& p_transform, MxU32);
void FUN_100123e0(const Matrix4& p_transform, MxU32 p_und);
Mx3DPointFloat GetWorldUp();
Mx3DPointFloat GetWorldLocation();
Mx3DPointFloat GetWorldDirection();

View file

@ -2,10 +2,15 @@
#include "legoinputmanager.h"
#include "legonotify.h"
#include "legosoundmanager.h"
#include "legovideomanager.h"
#include "misc.h"
#include "mxmisc.h"
#include "mxtimer.h"
#include "realtime/realtime.h"
#include <vec.h>
DECOMP_SIZE_ASSERT(LegoCameraController, 0xc8)
// FUNCTION: LEGO1 0x10011d50
@ -117,10 +122,34 @@ void LegoCameraController::SetWorldTransform(const Vector3& p_at, const Vector3&
m_matrix2 = m_matrix1;
}
// STUB: LEGO1 0x100123e0
void LegoCameraController::FUN_100123e0(const Matrix4& p_transform, MxU32)
// FUNCTION: LEGO1 0x100123e0
void LegoCameraController::FUN_100123e0(const Matrix4& p_transform, MxU32 p_und)
{
// TODO
if (m_lego3DView != NULL) {
ViewROI* pov = m_lego3DView->GetPointOfView();
if (pov != NULL) {
MxMatrix mat;
if (p_und) {
MXM4(mat, m_matrix1, p_transform);
}
else {
mat = p_transform;
}
((TimeROI*) pov)->FUN_100a9b40(mat, Timer()->GetTime());
pov->WrappedSetLocalTransform(mat);
m_lego3DView->Moved(*pov);
SoundManager()->FUN_1002a410(
pov->GetWorldPosition(),
pov->GetWorldDirection(),
pov->GetWorldUp(),
pov->GetWorldVelocity()
);
}
}
}
// FUNCTION: LEGO1 0x10012740