diff --git a/LEGO1/lego/legoomni/include/legocameracontroller.h b/LEGO1/lego/legoomni/include/legocameracontroller.h index 0032092b..086965bf 100644 --- a/LEGO1/lego/legoomni/include/legocameracontroller.h +++ b/LEGO1/lego/legoomni/include/legocameracontroller.h @@ -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 MxMatrix& p_transform, MxU32); + void FUN_100123e0(const Matrix4& p_transform, MxU32); Mx3DPointFloat GetWorldUp(); Mx3DPointFloat GetWorldLocation(); Mx3DPointFloat GetWorldDirection(); diff --git a/LEGO1/lego/legoomni/src/entity/legocameracontroller.cpp b/LEGO1/lego/legoomni/src/entity/legocameracontroller.cpp index b68d0a01..95cf839d 100644 --- a/LEGO1/lego/legoomni/src/entity/legocameracontroller.cpp +++ b/LEGO1/lego/legoomni/src/entity/legocameracontroller.cpp @@ -80,7 +80,7 @@ void LegoCameraController::SetWorldTransform(const Vector3& p_at, const Vector3& } // STUB: LEGO1 0x100123e0 -void LegoCameraController::FUN_100123e0(const MxMatrix& p_transform, MxU32) +void LegoCameraController::FUN_100123e0(const Matrix4& p_transform, MxU32) { } diff --git a/LEGO1/realtime/orientableroi.h b/LEGO1/realtime/orientableroi.h index 90d967f4..98c127d0 100644 --- a/LEGO1/realtime/orientableroi.h +++ b/LEGO1/realtime/orientableroi.h @@ -38,7 +38,7 @@ class OrientableROI : public ROI { void FUN_100a58f0(const Matrix4& p_transform); void FUN_100a5a30(const Vector3& p_world_velocity); - const MxMatrix& GetLocal2World() const { return m_local2world; } + const Matrix4& GetLocal2World() const { return m_local2world; } const float* GetWorldPosition() const { return m_local2world[3]; } const float* GetWorldDirection() const { return m_local2world[2]; } const float* GetWorldUp() const { return m_local2world[1]; } diff --git a/LEGO1/viewmanager/viewmanager.cpp b/LEGO1/viewmanager/viewmanager.cpp index c72c10d3..1aa6acdd 100644 --- a/LEGO1/viewmanager/viewmanager.cpp +++ b/LEGO1/viewmanager/viewmanager.cpp @@ -15,12 +15,12 @@ ViewManager::ViewManager(Tgl::Renderer* pRenderer, Tgl::Group* scene, const Orie unk0x28 = 0.09; SetD3DRM(d3drm, pRenderer); SetFrame(frame, scene); - unk0x34 = 0.0; - unk0x38 = 0.0; - unk0x3c = 0.0; - unk0x40.SetIdentity(); - unk0x88 = 0.0; - unk0x8c = 0.0; + width = 0.0; + height = 0.0; + view_angle = 0.0; + pov.SetIdentity(); + front = 0.0; + back = 0.0; memset(unk0xf0, 0, sizeof(unk0xf0)); seconds_allowed = 1.0; @@ -44,22 +44,30 @@ void ViewManager::Update(float p_previousRenderTime, float p_und2) // TODO } -// STUB: LEGO1 0x100a6d50 +// FUNCTION: LEGO1 0x100a6d50 void ViewManager::SetResolution(int width, int height) { - // TODO + flags |= c_bit3; + this->width = width; + this->height = height; } -// STUB: LEGO1 0x100a6d70 +// FUNCTION: LEGO1 0x100a6d70 void ViewManager::SetFrustrum(float fov, float front, float back) { - // TODO + this->front = front; + this->back = back; + flags |= c_bit3; + view_angle = fov * 0.017453292519944444; } -// STUB: LEGO1 0x100a6da0 +// FUNCTION: LEGO1 0x100a6da0 void ViewManager::SetPOVSource(const OrientableROI* point_of_view) { - // TODO + if (point_of_view != NULL) { + pov = point_of_view->GetLocal2World(); + flags |= c_bit2; + } } inline undefined4 SetD3DRM(IDirect3DRM2*& d3drm, Tgl::Renderer* pRenderer) diff --git a/LEGO1/viewmanager/viewmanager.h b/LEGO1/viewmanager/viewmanager.h index 19398ef8..d0beb746 100644 --- a/LEGO1/viewmanager/viewmanager.h +++ b/LEGO1/viewmanager/viewmanager.h @@ -43,12 +43,12 @@ class ViewManager { float unk0x28; // 0x28 undefined4 unk0x2c; // 0x2c unsigned int flags; // 0x30 - float unk0x34; // 0x34 - float unk0x38; // 0x38 - float unk0x3c; // 0x3c - MxMatrix unk0x40; // 0x40 - float unk0x88; // 0x88 - float unk0x8c; // 0x8c + float width; // 0x34 + float height; // 0x38 + float view_angle; // 0x3c + MxMatrix pov; // 0x40 + float front; // 0x88 + float back; // 0x8c undefined unk0x90[0x60]; // 0x90 undefined unk0xf0[0x60]; // 0xf0 undefined unk0x150[0x60]; // 0x150