isle-portable/LEGO1/lego/legoomni/include/legonavcontroller.h

131 lines
3.5 KiB
C
Raw Normal View History

#ifndef __LEGONAVCONTROLLER_H
#define __LEGONAVCONTROLLER_H
#include "decomp.h"
#include "mxcore.h"
#include "mxtypes.h"
#include "realtime/vector.h"
//////////////////////////////////////////////////////////////////////////////
//
// LegoMouseController
(Proposal) Adjustments to "decomp" language (#308) * Adjustments to "decomp" language * Fix a comment * Fix accidental clang-formatting * Fix order * Fix order * Remove junk * Fix OFFSET * Adjustments based on new suggestions * Annotate globals * Globals in ISLE * More globals * Merge from parser2 branch * Allow prepending space for exact marker match * To eliminate noise, require the 0x prefix on offset for marker match * fix test from previous * Count tab stops for indented functions to reduce MISSED_END_OF_FUNCTION noise * FUNCTION to SYNTHETIC where needed * Missed marker conversion on SetAtomId * pylint cleanup, remove unused code * Fix unexpected function end, add more unit tests * Be more strict about synthetic name syntax * Revert "Missed marker conversion on SetAtomId" This reverts commit d87d665127fae7dd6e5bd48d9af14a0a829bf9e2. * Revert "FUNCTION to SYNTHETIC where needed" This reverts commit 8c815418d261ba8c5f67a9a2cae349fe4ac92db8. * Implicit lookup by name for functions * Fix VTABLE SYNTHETIC and other decomp markers * Get vtable class name * Vtable marker should identify struct * No colon for SIZE comment * Update README.md * Update README.md * Update CONTRIBUTING.md * Update README.md * Update README.md * Update CONTRIBUTING.md * Update README.md * Update CONTRIBUTING.md * Fix destructor/annotation * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md --------- Co-authored-by: disinvite <disinvite@users.noreply.github.com>
2023-12-06 07:10:45 -05:00
// VTABLE: LEGO1 0x100d85b8
// SIZE 0x70
2023-10-24 19:38:27 -04:00
class LegoNavController : public MxCore {
public:
2023-10-24 19:38:27 -04:00
LegoNavController();
~LegoNavController() override;
MxLong Notify(MxParam& p_param) override; // vtable+0x04
(Proposal) Adjustments to "decomp" language (#308) * Adjustments to "decomp" language * Fix a comment * Fix accidental clang-formatting * Fix order * Fix order * Remove junk * Fix OFFSET * Adjustments based on new suggestions * Annotate globals * Globals in ISLE * More globals * Merge from parser2 branch * Allow prepending space for exact marker match * To eliminate noise, require the 0x prefix on offset for marker match * fix test from previous * Count tab stops for indented functions to reduce MISSED_END_OF_FUNCTION noise * FUNCTION to SYNTHETIC where needed * Missed marker conversion on SetAtomId * pylint cleanup, remove unused code * Fix unexpected function end, add more unit tests * Be more strict about synthetic name syntax * Revert "Missed marker conversion on SetAtomId" This reverts commit d87d665127fae7dd6e5bd48d9af14a0a829bf9e2. * Revert "FUNCTION to SYNTHETIC where needed" This reverts commit 8c815418d261ba8c5f67a9a2cae349fe4ac92db8. * Implicit lookup by name for functions * Fix VTABLE SYNTHETIC and other decomp markers * Get vtable class name * Vtable marker should identify struct * No colon for SIZE comment * Update README.md * Update README.md * Update CONTRIBUTING.md * Update README.md * Update README.md * Update CONTRIBUTING.md * Update README.md * Update CONTRIBUTING.md * Fix destructor/annotation * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md --------- Co-authored-by: disinvite <disinvite@users.noreply.github.com>
2023-12-06 07:10:45 -05:00
// FUNCTION: LEGO1 0x10054b80
inline const char* ClassName() const override // vtable+0x0c
2023-10-24 19:38:27 -04:00
{
// STRING: LEGO1 0x100f66d8
2023-10-24 19:38:27 -04:00
return "LegoNavController";
}
(Proposal) Adjustments to "decomp" language (#308) * Adjustments to "decomp" language * Fix a comment * Fix accidental clang-formatting * Fix order * Fix order * Remove junk * Fix OFFSET * Adjustments based on new suggestions * Annotate globals * Globals in ISLE * More globals * Merge from parser2 branch * Allow prepending space for exact marker match * To eliminate noise, require the 0x prefix on offset for marker match * fix test from previous * Count tab stops for indented functions to reduce MISSED_END_OF_FUNCTION noise * FUNCTION to SYNTHETIC where needed * Missed marker conversion on SetAtomId * pylint cleanup, remove unused code * Fix unexpected function end, add more unit tests * Be more strict about synthetic name syntax * Revert "Missed marker conversion on SetAtomId" This reverts commit d87d665127fae7dd6e5bd48d9af14a0a829bf9e2. * Revert "FUNCTION to SYNTHETIC where needed" This reverts commit 8c815418d261ba8c5f67a9a2cae349fe4ac92db8. * Implicit lookup by name for functions * Fix VTABLE SYNTHETIC and other decomp markers * Get vtable class name * Vtable marker should identify struct * No colon for SIZE comment * Update README.md * Update README.md * Update CONTRIBUTING.md * Update README.md * Update README.md * Update CONTRIBUTING.md * Update README.md * Update CONTRIBUTING.md * Fix destructor/annotation * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md --------- Co-authored-by: disinvite <disinvite@users.noreply.github.com>
2023-12-06 07:10:45 -05:00
// FUNCTION: LEGO1 0x10054b90
inline MxBool IsA(const char* p_name) const override // vtable+0x10
2023-10-24 19:38:27 -04:00
{
return !strcmp(p_name, ClassName()) || MxCore::IsA(p_name);
2023-10-24 19:38:27 -04:00
}
2023-10-24 19:38:27 -04:00
void SetTargets(int p_hPos, int p_vPos, MxBool p_accel);
void SetControlMax(int p_hMax, int p_vMax);
void SetTrackDefaultParams(MxBool p_state) { m_trackDefault = p_state; }
void SetToDefaultParams();
MxBool CalculateNewPosDir(
const Vector3& p_curPos,
const Vector3& p_curDir,
Vector3& p_newPos,
Vector3& p_newDir,
const Vector3* p_und
);
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
);
static void SetLocation(MxU32 p_location);
static void UpdateCameraLocation(const char* p_location);
// SYNTHETIC: LEGO1 0x10054c10
// LegoNavController::`scalar deleting destructor'
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);
int FUN_10055750(MxBool& p_und);
int FUN_100558b0();
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;
};
#endif // __LEGOPOVCONTROLLER_H