2024-03-15 11:33:32 -04:00
|
|
|
#ifndef __LEGONAVCONTROLLER_H
|
|
|
|
#define __LEGONAVCONTROLLER_H
|
2023-06-11 21:03:54 -04:00
|
|
|
|
2024-03-13 13:46:20 -04:00
|
|
|
#include "decomp.h"
|
2023-06-13 14:17:20 -04:00
|
|
|
#include "mxcore.h"
|
2023-06-27 22:04:07 -04:00
|
|
|
#include "mxtypes.h"
|
2024-03-13 13:46:20 -04:00
|
|
|
#include "realtime/vector.h"
|
2023-06-13 14:17:20 -04:00
|
|
|
|
2024-03-15 11:33:32 -04:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// LegoMouseController
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// VTABLE: LEGO1 0x100d85b8
|
2023-06-29 04:10:08 -04:00
|
|
|
// SIZE 0x70
|
2023-10-24 19:38:27 -04:00
|
|
|
class LegoNavController : public MxCore {
|
2023-06-11 21:03:54 -04:00
|
|
|
public:
|
2023-10-24 19:38:27 -04:00
|
|
|
LegoNavController();
|
2024-03-15 11:33:32 -04:00
|
|
|
~LegoNavController() override;
|
|
|
|
|
2024-02-01 15:42:10 -05:00
|
|
|
MxLong Notify(MxParam& p_param) override; // vtable+0x04
|
2023-06-29 04:10:08 -04:00
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x10054b80
|
2024-01-29 16:17:17 -05:00
|
|
|
inline const char* ClassName() const override // vtable+0x0c
|
2023-10-24 19:38:27 -04:00
|
|
|
{
|
2023-12-27 15:59:42 -05:00
|
|
|
// STRING: LEGO1 0x100f66d8
|
2023-10-24 19:38:27 -04:00
|
|
|
return "LegoNavController";
|
|
|
|
}
|
2023-06-29 04:10:08 -04:00
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x10054b90
|
2023-12-13 05:48:14 -05:00
|
|
|
inline MxBool IsA(const char* p_name) const override // vtable+0x10
|
2023-10-24 19:38:27 -04:00
|
|
|
{
|
2023-12-13 05:48:14 -05:00
|
|
|
return !strcmp(p_name, ClassName()) || MxCore::IsA(p_name);
|
2023-10-24 19:38:27 -04:00
|
|
|
}
|
2023-06-19 04:34:58 -04:00
|
|
|
|
2023-10-24 19:38:27 -04:00
|
|
|
void SetTargets(int p_hPos, int p_vPos, MxBool p_accel);
|
2024-03-15 11:33:32 -04:00
|
|
|
void SetControlMax(int p_hMax, int p_vMax);
|
|
|
|
void SetTrackDefaultParams(MxBool p_state) { m_trackDefault = p_state; }
|
|
|
|
void SetToDefaultParams();
|
2024-03-13 13:46:20 -04:00
|
|
|
MxBool CalculateNewPosDir(
|
|
|
|
const Vector3& p_curPos,
|
|
|
|
const Vector3& p_curDir,
|
|
|
|
Vector3& p_newPos,
|
|
|
|
Vector3& p_newDir,
|
2024-03-15 11:33:32 -04:00
|
|
|
const Vector3* p_und
|
2024-03-13 13:46:20 -04:00
|
|
|
);
|
2023-06-13 14:17:20 -04:00
|
|
|
|
2024-03-15 11:33:32 -04:00
|
|
|
static void GetDefaults(
|
|
|
|
int* p_dz,
|
|
|
|
float* p_lv,
|
|
|
|
float* p_rv,
|
|
|
|
float* p_la,
|
|
|
|
float* p_ra,
|
|
|
|
float* p_ld,
|
|
|
|
float* p_rd,
|
|
|
|
float* p_lmina,
|
|
|
|
float* p_rmina,
|
|
|
|
float* p_rs,
|
|
|
|
MxBool* p_urs
|
|
|
|
);
|
|
|
|
static void SetDefaults(
|
|
|
|
int p_dz,
|
|
|
|
float p_lv,
|
|
|
|
float p_rv,
|
|
|
|
float p_la,
|
|
|
|
float p_ra,
|
|
|
|
float p_ld,
|
|
|
|
float p_rd,
|
|
|
|
float p_lmina,
|
|
|
|
float p_rmina,
|
|
|
|
float p_rs,
|
|
|
|
MxBool p_urs
|
|
|
|
);
|
2024-03-23 14:00:34 -04:00
|
|
|
static MxResult UpdateCameraLocation(MxU32 p_location);
|
2024-03-23 12:10:12 -04:00
|
|
|
static MxResult UpdateCameraLocation(const char* p_location);
|
2024-04-14 10:43:07 -04:00
|
|
|
inline void SetLinearVel(MxFloat p_linearVel) { m_linearVel = p_linearVel; }
|
|
|
|
inline MxFloat GetLinearVel() { return m_linearVel; }
|
2024-04-12 07:02:32 -04:00
|
|
|
inline MxFloat GetMaxLinearVel() { return m_maxLinearVel; }
|
|
|
|
inline void ResetLinearVel(MxFloat p_maxLinearVel)
|
|
|
|
{
|
|
|
|
m_maxLinearVel = p_maxLinearVel;
|
|
|
|
m_trackDefault = 0;
|
|
|
|
}
|
2024-01-09 04:43:21 -05:00
|
|
|
|
2024-01-18 08:34:14 -05:00
|
|
|
// SYNTHETIC: LEGO1 0x10054c10
|
|
|
|
// LegoNavController::`scalar deleting destructor'
|
|
|
|
|
2024-03-15 11:33:32 -04:00
|
|
|
protected:
|
|
|
|
float CalculateNewVel(float p_targetVel, float p_currentVel, float p_accel, float p_time);
|
|
|
|
float CalculateNewTargetVel(int p_pos, int p_center, float p_max);
|
|
|
|
float CalculateNewAccel(int p_pos, int p_center, float p_max, int p_min);
|
|
|
|
|
2024-03-24 10:30:12 -04:00
|
|
|
MxResult ProcessJoystickInput(MxBool& p_und);
|
|
|
|
MxResult ProcessKeyboardInput();
|
2024-03-15 11:33:32 -04:00
|
|
|
|
|
|
|
int m_hMax; // 0x08
|
|
|
|
int m_vMax; // 0x0c
|
|
|
|
int m_deadZone; // 0x10
|
|
|
|
float m_zeroThreshold; // 0x14
|
|
|
|
float m_linearVel; // 0x18
|
|
|
|
float m_rotationalVel; // 0x1c
|
|
|
|
float m_targetLinearVel; // 0x20
|
|
|
|
float m_targetRotationalVel; // 0x24
|
|
|
|
float m_maxLinearVel; // 0x28
|
|
|
|
float m_maxRotationalVel; // 0x2c
|
|
|
|
float m_linearAccel; // 0x30
|
|
|
|
float m_rotationalAccel; // 0x34
|
|
|
|
float m_maxLinearAccel; // 0x38
|
|
|
|
float m_maxRotationalAccel; // 0x3c
|
|
|
|
float m_minLinearAccel; // 0x40
|
|
|
|
float m_minRotationalAccel; // 0x44
|
|
|
|
float m_maxLinearDeccel; // 0x48
|
|
|
|
float m_maxRotationalDeccel; // 0x4c
|
|
|
|
float m_rotSensitivity; // 0x50
|
|
|
|
MxBool m_useRotationalVel; // 0x54
|
|
|
|
MxTime m_lastTime; // 0x58
|
|
|
|
MxBool m_trackDefault; // 0x5c
|
|
|
|
MxBool m_unk0x5d; // 0x5d
|
|
|
|
float m_unk0x60; // 0x60
|
|
|
|
float m_unk0x64; // 0x64
|
|
|
|
float m_unk0x68; // 0x68
|
|
|
|
MxBool m_unk0x6c; // 0x6c
|
|
|
|
|
|
|
|
// one copy of defaults (these can be set by App.)
|
|
|
|
static int g_defdeadZone;
|
|
|
|
static float g_defzeroThreshold;
|
|
|
|
static float g_defmaxLinearVel;
|
|
|
|
static float g_defmaxRotationalVel;
|
|
|
|
static float g_defmaxLinearAccel;
|
|
|
|
static float g_defmaxRotationalAccel;
|
|
|
|
static float g_defminLinearAccel;
|
|
|
|
static float g_defminRotationalAccel;
|
|
|
|
static float g_defmaxLinearDeccel;
|
|
|
|
static float g_defmaxRotationalDeccel;
|
|
|
|
static float g_defrotSensitivity;
|
|
|
|
static MxBool g_defuseRotationalVel;
|
2023-06-11 21:03:54 -04:00
|
|
|
};
|
|
|
|
|
2024-03-15 11:33:32 -04:00
|
|
|
#endif // __LEGOPOVCONTROLLER_H
|