-
Notifications
You must be signed in to change notification settings - Fork 0
/
scene.h
142 lines (134 loc) · 4.93 KB
/
scene.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
#pragma once
#include "player.h"
#include "fire_system.h"
#include "physics_system.h"
#include "entities/tag.h"
#include "entities/entity.h"
#include "entities/joint.h"
#include "entities/light.h"
#include "entities/screen.h"
#include "entities/shape.h"
#include "entities/trigger.h"
#include "entities/vehicle.h"
#include "entities/water.h"
#include "entities/wheel.h"
namespace Teardown {
#pragma pack(push, 1)
struct Scene {
struct RaycastFilter
{
int32_t m_Mask;
int32_t m_Allowed;
int32_t m_Ignored;
bool m_RejectTransparent;
uint8_t m_Pad[3];
small_vector<Entities::Body*> m_IgnoredBodies;
Entities::Body* m_IgnoredBodiesMemory[4]; // small_vector should support pre-reserved buffers... not going to add that right now.
small_vector<Entities::Shape*> m_IgnoredShapes;
};
struct JointInfo
{
Entities::Joint* m_Joint;
Entities::Joint::Type m_Type;
Transform m_Transform;
bool m_Collide; uint8_t pad_29[3];
float m_Size;
float m_Stiffness;
float m_Springiness;
Vector3_f32 m_Position0;
Vector3_f32 m_Position1;
Vector4_f32 m_Color;
float m_Slack;
float m_Strength;
float m_MaxStretch;
Vector2_f32 m_Limits;
bool m_Sound; uint8_t pad_75[3];
};
int64_t vftptr_0;
PhysicsSystem* m_PhysicsSystem;
uint64_t qword_10;
uint32_t dword_18;
uint32_t dword_1C;
uint64_t qword_20;
uint8_t gap_28[24];
small_vector<JointInfo> m_PendingJoints;
uint8_t gap_38[24];
uint64_t qword_68;
uint64_t qword_70;
uint64_t qword_78;
uint64_t qword_80;
uint64_t qword_88;
uint64_t qword_90;
uint64_t qword_98;
Player* m_Player;
FireSystem* m_FireSystem;
uint64_t qword_B0;
uint64_t qword_B8;
uint64_t qword_C0;
Transform m_SpawnPoint;
uint8_t gap_E4[12];
uint64_t qword_F0;
uint8_t byte_F8; uint8_t pad_F9[7];
uint64_t qword_100;
uint64_t qword_108;
uint64_t qword_110;
uint64_t qword_118;
Entities::Vehicle* m_ActiveVehicle;
Entities::Screen* m_ActiveScreen;
uint64_t qword_130;
uint32_t dword_138;
uint32_t dword_13C;
uint64_t qword_140;
uint8_t byte_148; uint8_t pad_149[3];
uint32_t dword_14C;
uint64_t dword_150;
uint64_t qword_158;
small_vector<Entities::Entity*> m_EntityLists[12];
small_vector<Entities::Entity*> m_RootEntities;
small_vector<Entities::Body*>* m_Bodies;
small_vector<Entities::Shape*>* m_Shapes;
small_vector<Entities::Light*>* m_Lights;
small_vector<Entities::Entity*>* m_Locations;
small_vector<Entities::Water*>* m_Waters;
small_vector<Entities::Entity*>* m_Enemies;
small_vector<Entities::Joint*>* m_Joints;
small_vector<Entities::Vehicle*>* m_Vehicles;
small_vector<Entities::Wheel*>* m_Wheels;
small_vector<Entities::Screen*>* m_Screens;
small_vector<Entities::Trigger*>* m_Triggers;
small_vector<Entities::Entity*>* m_Scripts;
uint64_t qword_290;
uint64_t qword_298;
uint64_t qword_2A0;
uint64_t qword_2A8;
small_vector<Entities::Tag> m_EntityTags;
uint32_t m_NextEntityId;
uint32_t dword_2C4;
uint8_t gap_2C8[616];
small_vector<Vector2_f32> m_BoundaryVertices;
uint8_t gap_540[512];
uint32_t dword_740;
bool m_CanQuickLoad;
uint8_t gap_745[3];
uint64_t qword_748;
uint64_t qword_750;
uint64_t qword_758;
uint64_t qword_760;
uint64_t qword_768;
uint64_t qword_770;
uint64_t qword_778;
uint32_t dword_780;
uint32_t dword_784;
uint64_t qword_788;
uint8_t gap_790[128];
inline static function_signature<bool(__fastcall*)(Scene* ptr, Vector3_f32* pos, Vector3_f32* dir, float dist, RaycastFilter* f, float* out_dist, Vector3_f32* out_pos, Entities::Shape** out_shape, VoxelsPaletteInfo* out_palette)> Raycast = { "\x48\x8B\xC4\x4C\x89\x40\x18\x48\x89\x50\x10\x55\x56\x57\x41\x54\x41\x55\x41\x56\x41\x57\x48\x8D\xA8\x38\xFC\xFF\xFF" };
inline static function_signature<bool(__fastcall*)(Scene* ptr, small_vector<Entities::Shape*>* out_hit, Vector3_f32* pos, Vector3_f32* dir, RaycastFilter* f)> RaycastIntersect = { "\x4C\x8B\xDC\x57\x41\x56\x41\x57\x48\x81\xEC\x50\x0C\x00\x00\x48\xC7\x44\x24\x20\xFE\xFF\xFF\xFF\x49\x89\x5B\x08\x49\x89\x6B\x10\x49\x89\x73\x18\x49\x8B\xF1" };
inline static function_signature<bool(__fastcall*)(Scene* ptr, Vector3_f32* pos, float* out_depth, Entities::Water** out_water)> IsPointInWater = { "\x48\x89\x5C\x24\x18\x48\x89\x54\x24\x10\x55\x56\x57\x41\x54\x41\x55\x41\x56\x41\x57\x48\x83\xEC\x40\x48\x8B\x81\x50\x02\x00\x00" };
inline static function_signature<bool(__fastcall*)(Scene* ptr, Vector3_f32* pos, float radius)> CreateExplosion = { "\x48\x8B\xC4\xF3\x0F\x11\x50\x18\x55" };
inline static function_signature<bool(__fastcall*)(Scene* ptr, Vector3_f32* pos, Vector3_f32* dir, __int32 type)> CreateProjectile = { "\x48\x89\x5C\x24\x08\x57\x48\x81\xEC\x80\x00\x00\x00" };
};
static_assert(sizeof(Scene::RaycastFilter) == 0x50u, "Scene::RaycastFilter size is incorrect!");
static_assert(sizeof(Scene::JointInfo) == 0x78u, "Scene::JointInfo size incorrect!");
static_assert(sizeof(Scene) == 0x810u, "Scene size is incorrect!");
#pragma pack(pop)
}