mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-05-01 18:13:57 +00:00
Some checks failed
CI / clang-format (push) Has been cancelled
CI / ${{ matrix.name }} (false, --toolchain /usr/local/vitasdk/share/vita.toolchain.cmake, false, false, Ninja, Vita, ubuntu-latest, true, true) (push) Has been cancelled
CI / ${{ matrix.name }} (false, -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0.26100.0, false, false, Visual Studio 17 2022, true, Xbox One, windows-latest, amd64, false, true) (push) Has been cancelled
CI / ${{ matrix.name }} (false, -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/3DS.cmake, false, devkitpro/devkitarm:latest, false, Ninja, true, Nintendo 3DS, ubuntu-latest, true) (push) Has been cancelled
CI / ${{ matrix.name }} (false, -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/Switch.cmake, false, devkitpro/devkita64:latest, false, Ninja, Nintendo Switch, true, ubuntu-latest, true) (push) Has been cancelled
CI / ${{ matrix.name }} (false, emcmake, false, false, true, Ninja, Emscripten, ubuntu-latest, true) (push) Has been cancelled
CI / ${{ matrix.name }} (false, false, false, Ninja, true, MSVC (arm64), windows-latest, amd64_arm64, false) (push) Has been cancelled
CI / ${{ matrix.name }} (false, false, true, Ninja, true, MSVC (x86), windows-latest, amd64_x86, false) (push) Has been cancelled
CI / ${{ matrix.name }} (false, true, false, Ninja, true, MSVC (x64), windows-latest, amd64, false) (push) Has been cancelled
CI / ${{ matrix.name }} (false, true, true, false, Ninja, true, MSVC (x64 Debug), windows-latest, amd64, false) (push) Has been cancelled
CI / ${{ matrix.name }} (true, false, -DCMAKE_SYSTEM_NAME=iOS, false, false, Xcode, true, iOS, macos-15, true) (push) Has been cancelled
CI / ${{ matrix.name }} (true, false, false, false, Ninja, Android, ubuntu-latest, true) (push) Has been cancelled
CI / ${{ matrix.name }} (true, false, true, false, Ninja, macOS, macos-latest, true) (push) Has been cancelled
CI / ${{ matrix.name }} (true, true, false, Ninja, true, mingw-w64-x86_64, mingw64, msys2 mingw64, windows-latest, msys2 {0}, true) (push) Has been cancelled
CI / ${{ matrix.name }} (true, true, true, false, Ninja, true, Linux (Debug), ubuntu-latest, true) (push) Has been cancelled
CI / ${{ matrix.name }} (true, true, true, false, Ninja, true, Linux, ubuntu-latest, true) (push) Has been cancelled
CI / Flatpak (${{ matrix.arch }}) (aarch64, ubuntu-22.04-arm) (push) Has been cancelled
CI / Flatpak (${{ matrix.arch }}) (x86_64, ubuntu-latest) (push) Has been cancelled
CI / C++ (push) Has been cancelled
Docker / Publish web port (push) Has been cancelled
CI / Release (push) Has been cancelled
Introduces a third person camera system with orbit camera, input handling (mouse/keyboard/touch/gamepad), display actor cloning, and camera-relative movement. Includes shared character utilities (animator, cloner, customizer) and an IExtraAnimHandler interface for optional animation extensions. Also includes generic base game fixes and extension system improvements.
180 lines
4.9 KiB
C++
180 lines
4.9 KiB
C++
#ifndef __LEGONAVCONTROLLER_H
|
|
#define __LEGONAVCONTROLLER_H
|
|
|
|
#include "decomp.h"
|
|
#include "extensions/fwd.h"
|
|
#include "mxcore.h"
|
|
#include "mxtypes.h"
|
|
|
|
struct LegoLocation;
|
|
class Vector3;
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
//
|
|
// LegoMouseController
|
|
|
|
// VTABLE: LEGO1 0x100d85b8
|
|
// VTABLE: BETA10 0x101bcc80
|
|
// SIZE 0x70
|
|
class LegoNavController : public MxCore {
|
|
public:
|
|
LegoNavController();
|
|
~LegoNavController() override;
|
|
|
|
MxLong Notify(MxParam& p_param) override; // vtable+0x04
|
|
|
|
// FUNCTION: LEGO1 0x10054b80
|
|
// FUNCTION: BETA10 0x1009e5f0
|
|
const char* ClassName() const override // vtable+0x0c
|
|
{
|
|
// STRING: LEGO1 0x100f66d8
|
|
return "LegoNavController";
|
|
}
|
|
|
|
// FUNCTION: LEGO1 0x10054b90
|
|
MxBool IsA(const char* p_name) const override // vtable+0x10
|
|
{
|
|
return !strcmp(p_name, ClassName()) || MxCore::IsA(p_name);
|
|
}
|
|
|
|
void SetTargets(int p_hPos, int p_vPos, MxBool p_accel);
|
|
void SetControlMax(int p_hMax, int p_vMax);
|
|
void SetToDefaultParams();
|
|
MxBool CalculateNewPosDir(
|
|
const Vector3& p_curPos,
|
|
const Vector3& p_curDir,
|
|
Vector3& p_newPos,
|
|
Vector3& p_newDir,
|
|
const Vector3* p_up
|
|
);
|
|
|
|
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 MxResult UpdateLocation(MxU32 p_location);
|
|
static MxResult UpdateLocation(const char* p_location);
|
|
static MxS32 GetNumLocations();
|
|
static LegoLocation* GetLocation(MxU32 p_location);
|
|
|
|
// FUNCTION: BETA10 0x100b0f40
|
|
void SetLinearVel(MxFloat p_linearVel) { m_linearVel = p_linearVel; }
|
|
|
|
// FUNCTION: BETA10 0x100c99e0
|
|
void SetDeadZone(MxS32 p_deadZone) { m_deadZone = p_deadZone; }
|
|
|
|
// FUNCTION: BETA10 0x100c7880
|
|
void SetTrackDefault(MxS32 p_trackDefault) { m_trackDefault = p_trackDefault; }
|
|
|
|
// FUNCTION: BETA10 0x100178a0
|
|
void Reset()
|
|
{
|
|
m_trackDefault = TRUE;
|
|
SetToDefaultParams();
|
|
}
|
|
|
|
MxFloat GetLinearVel() { return m_linearVel; }
|
|
MxFloat GetRotationalVel() { return m_rotationalVel; }
|
|
MxFloat GetMaxLinearVel() { return m_maxLinearVel; }
|
|
MxFloat GetMaxLinearAccel() { return m_maxLinearAccel; }
|
|
MxFloat GetMaxLinearDeccel() { return m_maxLinearDeccel; }
|
|
void ResetMaxLinearVel(MxFloat p_maxLinearVel)
|
|
{
|
|
m_maxLinearVel = p_maxLinearVel;
|
|
m_trackDefault = FALSE;
|
|
}
|
|
void ResetMaxLinearAccel(MxFloat p_maxLinearAccel)
|
|
{
|
|
m_maxLinearAccel = p_maxLinearAccel;
|
|
m_trackDefault = FALSE;
|
|
}
|
|
void ResetMaxLinearDeccel(MxFloat p_maxLinearDeccel)
|
|
{
|
|
m_maxLinearDeccel = p_maxLinearDeccel;
|
|
m_trackDefault = FALSE;
|
|
}
|
|
|
|
// FUNCTION: BETA10 0x100c9a10
|
|
int GetDefaultDeadZone() { return g_defdeadZone; }
|
|
|
|
// SYNTHETIC: LEGO1 0x10054c10
|
|
// LegoNavController::`scalar deleting destructor'
|
|
|
|
protected:
|
|
friend class Extensions::ThirdPersonCamera::OrbitCamera;
|
|
friend class Extensions::ThirdPersonCamera::Controller;
|
|
|
|
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);
|
|
|
|
MxResult ProcessJoystickInput(MxBool& p_rotatedY);
|
|
MxResult ProcessKeyboardInput();
|
|
|
|
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_keyPressed; // 0x5d
|
|
float m_additionalHeightOffset; // 0x60
|
|
float m_additionalScale; // 0x64
|
|
float m_additionalRotationY; // 0x68
|
|
MxBool m_isAccelerating; // 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
|