Implement/match some ViewManager functions (#615)

This commit is contained in:
Christian Semmler 2024-03-02 13:40:42 -05:00 committed by GitHub
parent 05965f5357
commit 6de17cf1b6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 29 additions and 21 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 MxMatrix& p_transform, MxU32);
void FUN_100123e0(const Matrix4& p_transform, MxU32);
Mx3DPointFloat GetWorldUp();
Mx3DPointFloat GetWorldLocation();
Mx3DPointFloat GetWorldDirection();

View file

@ -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)
{
}

View file

@ -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]; }

View file

@ -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)

View file

@ -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