Store bone positions inside array from StudioRenderModel

This commit is contained in:
8dcc 2023-07-30 15:11:01 +02:00
parent 04720aa4a3
commit 1d7d974d88
3 changed files with 12 additions and 0 deletions

View File

@ -10,6 +10,9 @@
enum game_id this_game_id = HL;
/* Bone origins of each player, updated in studiorendermodel */
vec3_t g_bones[64][128];
void* hw;
void** h_client;
DECL_INTF(cl_enginefunc_t, engine);

View File

@ -81,6 +81,14 @@ int h_HUD_Redraw(float time, int intermission) {
/*----------------------------------------------------------------------------*/
void h_StudioRenderModel(void* this_ptr) {
/* Update bones array */
cl_entity_t* ent = i_enginestudio->GetCurrentEntity();
bone_matrix* mat = (bone_matrix*)i_enginestudio->StudioGetBoneTransform();
for (int i = 0; i < 128; i++) {
const vec3_t bone_orig = matrix_3x4_origin((*mat)[i]);
vec_copy(g_bones[ent->index][i], bone_orig);
}
if (!chams(this_ptr))
ORIGINAL(StudioRenderModel, this_ptr);
}

View File

@ -34,6 +34,7 @@ enum game_id {
/*----------------------------------------------------------------------------*/
extern game_id this_game_id;
extern vec3_t g_bones[64][128];
extern void* hw;
extern void** h_client; /* hClientDLL hander */