Fixed alignment of GamerHandle to match the game's. (#163)

Added some of the classes I ported from Phantom for the game's camera.
This commit is contained in:
gir489 2024-03-27 16:01:52 -04:00 committed by GitHub
parent f91b409aac
commit a3031a8978
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 61 additions and 21 deletions

View File

@ -4,9 +4,14 @@
class CCameraAngles class CCameraAngles
{ {
private:
char pad_0000[704]; //0x0000
public: public:
char pad_0000[960]; //0x0000 CPlayerAngles* m_vehicle; //0x02C0
CPlayerAngles* angles; //0x03C0 CPlayerAngles* m_vehicle_two; //0x02C8
char pad_03C8[60]; //0x03C8 private:
}; //Size: 0x0408 char pad_02D0[240]; //0x02D0
static_assert(sizeof(CCameraAngles) == 0x408); public:
CPlayerAngles* m_player_first_person; //0x03C0
}; //Size: 0x03C8
static_assert(sizeof(CCameraAngles) == 0x3C8);

Binary file not shown.

View File

@ -3,19 +3,46 @@
#include "../rage/vector.hpp" #include "../rage/vector.hpp"
#include "CPlayerCameraData.hpp" #include "CPlayerCameraData.hpp"
#pragma pack(push, 4)
class CPlayerAngles class CPlayerAngles
{ {
private:
char pad_0000[16]; //0x0000
public: public:
char pad_0000[16]; //0x0000 CPlayerCameraData* m_cam_data; //0x0010
CPlayerCameraData* m_cam_data; //0x0010 private:
char pad_0018[24]; //0x0018 char pad_0018[24]; //0x0018
rage::fvector3 m_right; //0x0030 public:
char pad_003C[4]; //0x003C rage::fvector3 m_theta_angles; //0x0030
rage::fvector3 m_forward; //0x0040 private:
char pad_004C[4]; //0x004C char pad_003C[4]; //0x003C
rage::fvector3 m_up; //0x0050 public:
char pad_005C[4]; //0x005C rage::fvector3 m_camera_rotation_first_person; //0x0040
rage::fvector3 m_position; //0x0060 private:
char pad_006C[36]; //0x006C char pad_004C[4]; //0x004C
}; //Size: 0x0090 public:
static_assert(sizeof(CPlayerAngles) == 0x90); rage::fvector3 m_omega_angles; //0x0050
private:
char pad_005C[4]; //0x005C
public:
rage::fvector3 m_location; //0x0060
private:
char pad_006C[36]; //0x006C
public:
float m_fov; //0x0090
private:
char pad_0094[828]; //0x0094
public:
rage::fvector3 m_camera_rotation; //0x03D0
void set_camera(rage::fvector3 new_angles)
{
m_camera_rotation = new_angles;
}
void set_fps_camera(rage::fvector3 new_angles)
{
m_camera_rotation_first_person = new_angles;
}
}; //Size: 0x03DC
#pragma pack(pop)
static_assert(sizeof(CPlayerAngles) == 0x3DC, "CPlayerAngles is not properly sized!");

View File

@ -4,20 +4,28 @@
namespace rage namespace rage
{ {
enum rlPlatforms : uint8_t
{
UNK0,
XBOX,
PLAYSTATION,
PC,
};
#pragma pack(push,8) #pragma pack(push,8)
class rlGamerHandle class rlGamerHandle
{ {
public: public:
uint64_t m_rockstar_id; //0x0000 uint64_t m_rockstar_id; //0x0000
uint8_t m_platform; //0x0008 uint8_t m_platform; //0x0008
uint8_t unk_0009; //0x0009 uint8_t m_padding; //0x0009
inline rlGamerHandle() = default; inline rlGamerHandle() = default;
inline rlGamerHandle(uint64_t rockstar_id) : inline rlGamerHandle(uint64_t rockstar_id) :
m_rockstar_id(rockstar_id), m_rockstar_id(rockstar_id),
m_platform(3), m_platform(rlPlatforms::PC),
unk_0009(0) m_padding(0)
{ {
} }
}; //Size: 0x0010 }; //Size: 0x0010