From c86122f63eba0e1790335d356fcc46dcda2739d8 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Mon, 27 Mar 2023 17:42:55 +0200 Subject: [PATCH] Add collision types to SDK Merged from branch 'collision_debug'. --- r5dev/public/cmodel.h | 40 +++++++++++++++++++++++++++++++++++++++- r5dev/public/gametrace.h | 18 ++++++++++++++++++ 2 files changed, 57 insertions(+), 1 deletion(-) diff --git a/r5dev/public/cmodel.h b/r5dev/public/cmodel.h index 0c3729e4..7263055e 100644 --- a/r5dev/public/cmodel.h +++ b/r5dev/public/cmodel.h @@ -76,4 +76,42 @@ struct cplanetrace_t float dist; }; -#endif // CMODEL_H \ No newline at end of file +struct dsurfaceproperty_t +{ + __int16 unk; + byte unk2; + byte contentMaskOffset; + int surfaceNameOffset; +}; + +struct dbvhnode_t +{ + __int16 mins_x[4]; + __int16 mins_y[4]; + __int16 mins_z[4]; + __int16 maxs_x[4]; + __int16 maxs_y[4]; + __int16 maxs_z[4]; + int index_child01_types; + int index_child23_types; + int index_cm; + int index_pad; +}; + +struct bspmodel_t +{ + dbvhnode_t* bvhnodes; + dsurfaceproperty_t* surfaceproperties; + int* bvhleafdata; + void* vertices; + int* contentmasks; + char* texdatastringdata; + int unk; + int unk2; + float unk_f1; + float unk_f2; + float unk_f3; + float unk_f4; +}; + +#endif // CMODEL_H diff --git a/r5dev/public/gametrace.h b/r5dev/public/gametrace.h index b8ec6490..201870a2 100644 --- a/r5dev/public/gametrace.h +++ b/r5dev/public/gametrace.h @@ -41,4 +41,22 @@ public: static_assert(sizeof(CGameTrace) == 0x180); typedef CGameTrace trace_t; +//----------------------------------------------------------------------------- +// Purpose: A collision query +//----------------------------------------------------------------------------- +struct CollisionQuery_t +{ + bspmodel_t* pModel; + char* pVertices; + char unk_10[16]; + int trace_contents; + char unk[556]; + void** func_table; + void* funcs_250[6]; + char unk_288[80]; + trace_t* trace; + char unk_2D8[54]; +}; +static_assert(sizeof(CollisionQuery_t) == 0x318); + #endif // GAMETRACE_H