mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-24 08:54:15 +00:00
Implement most of LegoCameraController (#419)
* Implement LegoCameraController subclasses * Update legopovcontroller.cpp * fixes * Update legocameracontroller.cpp * fix naming conventions * Update legopointofviewcontroller.h * Update legopointofviewcontroller.h * Fixes * Match LegoPointOfViewController::Create --------- Co-authored-by: Christian Semmler <mail@csemmler.com>
This commit is contained in:
@@ -1,17 +1,21 @@
|
||||
#ifndef LEGOCAMERACONTROLLER_H
|
||||
#define LEGOCAMERACONTROLLER_H
|
||||
|
||||
#include "legopointofviewcontroller.h"
|
||||
#include "mxcore.h"
|
||||
#include "mxpoint32.h"
|
||||
#include "realtime/matrix.h"
|
||||
#include "realtime/vector.h"
|
||||
|
||||
// VTABLE: LEGO1 0x100d57b0
|
||||
// SIZE 0xc8
|
||||
class LegoCameraController : public MxCore {
|
||||
class LegoCameraController : public LegoPointOfViewController {
|
||||
public:
|
||||
LegoCameraController();
|
||||
virtual ~LegoCameraController() override; // vtable+0x0
|
||||
|
||||
virtual MxLong Notify(MxParam& p_param) override; // vtable+04
|
||||
|
||||
// FUNCTION: LEGO1 0x10011ec0
|
||||
inline virtual const char* ClassName() const override // vtable+0x0c
|
||||
{
|
||||
@@ -25,11 +29,22 @@ public:
|
||||
return !strcmp(p_name, ClassName()) || MxCore::IsA(p_name);
|
||||
}
|
||||
|
||||
void LookAt(Vector3Impl& p_at, Vector3Impl& p_dir, Vector3Impl& p_up);
|
||||
virtual void OnLButtonDown(MxPoint32 p_point) override; // vtable+0x30
|
||||
virtual void OnLButtonUp(MxPoint32 p_point) override; // vtable+0x34
|
||||
virtual void OnRButtonDown(MxPoint32 p_point) override; // vtable+0x38
|
||||
virtual void OnRButtonUp(MxPoint32 p_point) override; // vtable+0x3c
|
||||
virtual void OnMouseMove(MxU8 p_modifier, MxPoint32 p_point) override; // vtable+0x40
|
||||
virtual MxResult Create(); // vtable+0x44
|
||||
|
||||
void SetWorldTransform(Vector3Impl& p_at, Vector3Impl& p_dir, Vector3Impl& p_up);
|
||||
void FUN_100123e0(Matrix4Data& p_transform, MxU32);
|
||||
Vector3Data& FUN_10012740();
|
||||
Vector3Data& FUN_100127f0();
|
||||
Vector3Data& FUN_100128a0();
|
||||
|
||||
private:
|
||||
Matrix4Data m_matrix1; // 0x38
|
||||
Matrix4Data m_matrix2; // 0x80
|
||||
};
|
||||
|
||||
#endif // LEGOCAMERACONTROLLER_H
|
||||
|
||||
@@ -56,6 +56,7 @@ public:
|
||||
|
||||
inline LegoControlManager* GetControlManager() { return m_controlManager; }
|
||||
inline LegoWorld* GetWorld() { return m_world; }
|
||||
inline LegoCameraController* GetCamera() { return m_camera; }
|
||||
|
||||
void ProcessEvents();
|
||||
MxBool ProcessOneEvent(LegoEventNotificationParam& p_param);
|
||||
|
||||
@@ -59,6 +59,8 @@ public:
|
||||
float CalculateNewAccel(int p_pos, int p_center, float p_maxAccel, int p_minAccel);
|
||||
float CalculateNewVel(float p_targetVel, float p_currentVel, float p_accel, float p_time);
|
||||
|
||||
inline void SetTrackDefaultParams(MxBool p_trackDefault) { m_trackDefault = p_trackDefault; }
|
||||
|
||||
private:
|
||||
int m_hMax;
|
||||
int m_vMax;
|
||||
|
||||
11
LEGO1/lego/legoomni/include/legonotify.h
Normal file
11
LEGO1/lego/legoomni/include/legonotify.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#ifndef LEGONOTIFY_H
|
||||
#define LEGONOTIFY_H
|
||||
|
||||
enum LegoEventNotificationParamType {
|
||||
c_lButtonState = 1,
|
||||
c_rButtonState = 2,
|
||||
c_modKey1 = 4,
|
||||
c_modKey2 = 8,
|
||||
};
|
||||
|
||||
#endif // LEGONOTIFY_H
|
||||
@@ -102,7 +102,6 @@ public:
|
||||
|
||||
LegoVideoManager* GetVideoManager() { return (LegoVideoManager*) m_videoManager; }
|
||||
LegoSoundManager* GetSoundManager() { return (LegoSoundManager*) m_soundManager; }
|
||||
|
||||
LegoInputManager* GetInputManager() { return m_inputMgr; }
|
||||
GifManager* GetGifManager() { return m_gifManager; }
|
||||
LegoWorld* GetCurrentOmniWorld() { return m_currentWorld; }
|
||||
@@ -116,6 +115,8 @@ public:
|
||||
MxTransitionManager* GetTransitionManager() { return m_transitionManager; }
|
||||
MxDSAction& GetCurrentAction() { return m_action; }
|
||||
|
||||
inline void SetNavController(LegoNavController* p_navController) { m_navController = p_navController; }
|
||||
|
||||
inline void SetExit(MxBool p_exit) { m_exit = p_exit; };
|
||||
|
||||
private:
|
||||
|
||||
94
LEGO1/lego/legoomni/include/legopointofviewcontroller.h
Normal file
94
LEGO1/lego/legoomni/include/legopointofviewcontroller.h
Normal file
@@ -0,0 +1,94 @@
|
||||
#ifndef LEGOPOINTOFVIEWCONTROLLER_H
|
||||
#define LEGOPOINTOFVIEWCONTROLLER_H
|
||||
|
||||
#include "decomp.h"
|
||||
#include "mxcore.h"
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
class Lego3DView;
|
||||
class LegoEntity;
|
||||
class LegoNavController;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// LegoMouseController
|
||||
|
||||
// VTABLE: LEGO1 0x100d8dd8
|
||||
// SIZE 0x20
|
||||
class LegoMouseController : public MxCore {
|
||||
public:
|
||||
LegoMouseController();
|
||||
virtual ~LegoMouseController() override;
|
||||
|
||||
virtual void LeftDown(int, int); // vtable+0x14
|
||||
virtual void LeftDrag(int, int); // vtable+0x18
|
||||
virtual void LeftUp(int, int); // vtable+0x1c
|
||||
virtual void RightDown(int, int); // vtable+0x20
|
||||
virtual void RightDrag(int, int); // vtable+0x24
|
||||
virtual void RightUp(int, int); // vtable+0x28
|
||||
|
||||
private:
|
||||
BOOL m_isButtonDown; // 0x08
|
||||
undefined4 m_unk0xc; // 0x0c
|
||||
MxDouble m_buttonX; // 0x10
|
||||
MxDouble m_buttonY; // 0x18
|
||||
};
|
||||
|
||||
// VTABLE: LEGO1 0x100d8e08
|
||||
// SIZE 0x38
|
||||
class LegoPointOfViewController : public LegoMouseController {
|
||||
public:
|
||||
LegoPointOfViewController();
|
||||
virtual ~LegoPointOfViewController() override;
|
||||
|
||||
virtual MxResult Tickle() override; // vtable+0x08
|
||||
virtual void LeftDown(int p_x, int p_y) override; // vtable+0x0c
|
||||
virtual void LeftDrag(int p_x, int p_y) override; // vtable+0x10
|
||||
|
||||
// FUNCTION: LEGO1 0x10011e40
|
||||
virtual void LeftUp(int p_x, int p_y) override
|
||||
{
|
||||
LegoMouseController::LeftUp(p_x, p_y);
|
||||
AffectPointOfView();
|
||||
}
|
||||
// vtable+0x14
|
||||
|
||||
// FUNCTION: LEGO1 0x10011e60
|
||||
virtual void RightDown(int p_x, int p_y) override
|
||||
{
|
||||
LegoMouseController::RightDown(p_x, p_y);
|
||||
AffectPointOfView();
|
||||
}
|
||||
// vtable+0x20
|
||||
|
||||
// FUNCTION: LEGO1 0x10011e80
|
||||
virtual void RightDrag(int p_x, int p_y) override
|
||||
{
|
||||
LegoMouseController::RightDrag(p_x, p_y);
|
||||
AffectPointOfView();
|
||||
}
|
||||
// vtable+0x24
|
||||
|
||||
// FUNCTION: LEGO1 0x10011ea0
|
||||
virtual void RightUp(int p_x, int p_y) override
|
||||
{
|
||||
LegoMouseController::RightUp(p_x, p_y);
|
||||
AffectPointOfView();
|
||||
} // vtable+0x28
|
||||
virtual void SetEntity(LegoEntity* p_entity); // vtable+0x2c
|
||||
|
||||
MxResult Create(Lego3DView* p_lego3DView);
|
||||
|
||||
inline LegoEntity* GetEntity() { return m_entity; }
|
||||
|
||||
protected:
|
||||
void AffectPointOfView();
|
||||
|
||||
Lego3DView* m_lego3DView; // 0x20
|
||||
LegoEntity* m_entity; // 0x24
|
||||
MxDouble m_entityOffsetUp; // 0x28
|
||||
LegoNavController* m_nav; // 0x30
|
||||
};
|
||||
|
||||
#endif /* LEGOPOINTOFVIEWCONTROLLER_H */
|
||||
Reference in New Issue
Block a user