2023-06-11 21:03:54 -04:00
|
|
|
#ifndef LEGONAVCONTROLLER_H
|
|
|
|
#define LEGONAVCONTROLLER_H
|
|
|
|
|
2024-03-13 13:46:20 -04:00
|
|
|
#include "decomp.h"
|
2023-06-13 14:17:20 -04:00
|
|
|
#include "mxcore.h"
|
2023-06-19 04:34:58 -04:00
|
|
|
#include "mxtimer.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
|
|
|
|
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:
|
2024-01-24 21:16:29 -05:00
|
|
|
static void GetDefaults(
|
2023-10-24 19:38:27 -04:00
|
|
|
int* p_mouseDeadzone,
|
|
|
|
float* p_movementMaxSpeed,
|
|
|
|
float* p_turnMaxSpeed,
|
|
|
|
float* p_movementMaxAccel,
|
|
|
|
float* p_turnMaxAccel,
|
|
|
|
float* p_movementDecel,
|
|
|
|
float* p_turnDecel,
|
|
|
|
float* p_movementMinAccel,
|
|
|
|
float* p_turnMinAccel,
|
|
|
|
float* p_rotationSensitivity,
|
|
|
|
MxBool* p_turnUseVelocity
|
|
|
|
);
|
2024-01-24 21:16:29 -05:00
|
|
|
static void SetDefaults(
|
2023-10-24 19:38:27 -04:00
|
|
|
int p_mouseDeadzone,
|
|
|
|
float p_movementMaxSpeed,
|
|
|
|
float p_turnMaxSpeed,
|
|
|
|
float p_movementMaxAccel,
|
|
|
|
float p_turnMaxAccel,
|
|
|
|
float p_movementDecel,
|
|
|
|
float p_turnDecel,
|
|
|
|
float p_movementMinAccel,
|
|
|
|
float p_turnMinAccel,
|
|
|
|
float p_rotationSensitivity,
|
|
|
|
MxBool p_turnUseVelocity
|
|
|
|
);
|
2023-06-19 04:34:58 -04:00
|
|
|
|
2023-10-24 19:38:27 -04:00
|
|
|
LegoNavController();
|
2024-02-01 15:42:10 -05:00
|
|
|
~LegoNavController() override; // vtable+0x00
|
|
|
|
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 SetControlMax(int p_hMax, int p_vMax);
|
|
|
|
void ResetToDefault();
|
|
|
|
void SetTargets(int p_hPos, int p_vPos, MxBool p_accel);
|
2024-02-24 08:55:00 -05:00
|
|
|
static void SetLocation(MxU32 p_location);
|
2023-10-24 19:38:27 -04:00
|
|
|
float CalculateNewTargetSpeed(int p_pos, int p_center, float p_maxSpeed);
|
|
|
|
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);
|
2024-03-13 13:46:20 -04:00
|
|
|
MxBool CalculateNewPosDir(
|
|
|
|
const Vector3& p_curPos,
|
|
|
|
const Vector3& p_curDir,
|
|
|
|
Vector3& p_newPos,
|
|
|
|
Vector3& p_newDir,
|
|
|
|
undefined* p_und
|
|
|
|
);
|
2023-06-13 14:17:20 -04:00
|
|
|
|
2024-01-09 04:43:21 -05:00
|
|
|
inline void SetTrackDefaultParams(MxBool p_trackDefault) { m_trackDefault = p_trackDefault; }
|
|
|
|
|
2024-01-18 08:34:14 -05:00
|
|
|
// SYNTHETIC: LEGO1 0x10054c10
|
|
|
|
// LegoNavController::`scalar deleting destructor'
|
|
|
|
|
2023-06-13 14:17:20 -04:00
|
|
|
private:
|
2023-10-24 19:38:27 -04:00
|
|
|
int m_hMax;
|
|
|
|
int m_vMax;
|
|
|
|
int m_mouseDeadzone;
|
|
|
|
float m_zeroThreshold;
|
2023-12-13 05:48:14 -05:00
|
|
|
float m_unk0x18;
|
|
|
|
float m_unk0x1c;
|
2023-10-24 19:38:27 -04:00
|
|
|
float m_targetMovementSpeed;
|
|
|
|
float m_targetTurnSpeed;
|
|
|
|
float m_movementMaxSpeed;
|
|
|
|
float m_turnMaxSpeed;
|
|
|
|
float m_movementAccel;
|
|
|
|
float m_turnAccel;
|
|
|
|
float m_movementMaxAccel;
|
|
|
|
float m_turnMaxAccel;
|
|
|
|
float m_movementMinAccel;
|
|
|
|
float m_turnMinAccel;
|
|
|
|
float m_movementDecel;
|
|
|
|
float m_turnDecel;
|
|
|
|
float m_turnSensitivity;
|
|
|
|
MxBool m_turnUseVelocity;
|
|
|
|
int m_time;
|
|
|
|
MxBool m_trackDefault;
|
2023-12-13 05:48:14 -05:00
|
|
|
MxBool m_unk0x5d;
|
|
|
|
char m_unk0x5e[2];
|
|
|
|
int m_unk0x60;
|
|
|
|
int m_unk0x64;
|
|
|
|
int m_unk0x68;
|
|
|
|
MxBool m_unk0x6c;
|
2023-06-11 21:03:54 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // LEGONAVCONTROLLER_H
|