Xonotic
player_skeleton.qh File Reference
#include <common/util.qh>
+ Include dependency graph for player_skeleton.qh:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

 classfield (Skeleton) .float bone_upperbody
 
 entityclass (Skeleton)
 
void free_skeleton_from_frames (entity e)
 
void skeleton_from_frames (entity e, float is_dead)
 
void skeleton_loadinfo (entity e)
 

Function Documentation

◆ classfield()

classfield ( Skeleton  )

◆ entityclass()

entityclass ( Skeleton  )

◆ free_skeleton_from_frames()

void free_skeleton_from_frames ( entity  e)

Definition at line 105 of file player_skeleton.qc.

Referenced by CSQCModel_Hook_PreDraw().

106 {
107  if(e.skeletonindex)
108  {
109  skel_delete(e.skeletonindex);
110  e.skeletonindex = 0;
111  }
112 }
+ Here is the caller graph for this function:

◆ skeleton_from_frames()

void skeleton_from_frames ( entity  e,
float  is_dead 
)

◆ skeleton_loadinfo()

void skeleton_loadinfo ( entity  e)

Definition at line 19 of file player_skeleton.qc.

References get_model_parameters(), get_model_parameters_bone_aim, get_model_parameters_bone_aimweight, get_model_parameters_bone_upperbody, get_model_parameters_bone_weapon, get_model_parameters_fixbone, gettagindex, LOG_TRACE, MAX_AIM_BONES, MUTATOR_CALLHOOK, and string_null.

Referenced by CSQCModel_AutoTagIndex_Apply(), and CSQCModel_Hook_PreDraw().

20 {
21  int i;
22  if(e.skeleton_info_modelindex == e.modelindex && e.skeleton_info_skin == e.skin)
23  return;
24  e.bone_upperbody = 0;
25  e.bone_weapon = gettagindex(e, "weapon");
26  if(!e.bone_weapon)
27  e.bone_weapon = gettagindex(e, "tag_weapon");
28  if(!e.bone_weapon)
29  e.bone_weapon = gettagindex(e, "bip01 r hand");
30  MUTATOR_CALLHOOK(Skeleton_CheckBones, e);
31  for(i = 0; i < MAX_AIM_BONES; ++i)
32  {
33  e.(bone_aim[i]) = 0;
34  e.(bone_aimweight[i]) = 0;
35  }
36  e.fixbone = 0;
37  if(get_model_parameters(e.model, e.skin))
38  {
40  e.bone_upperbody = gettagindex(e, get_model_parameters_bone_upperbody);
41  if(e.bone_upperbody)
42  e.fixbone = get_model_parameters_fixbone;
45  MUTATOR_CALLHOOK(Skeleton_CheckModel, e);
46  for(i = 0; i < MAX_AIM_BONES; ++i)
47  {
49  e.(bone_aim[i]) = gettagindex(e, get_model_parameters_bone_aim[i]);
50  if(e.bone_aim[i])
51  e.(bone_aimweight[i]) = get_model_parameters_bone_aimweight[i];
52  }
53  }
54  else
55  LOG_TRACE("No model parameters for ", e.model);
56  //dprint(e.model, " uses ", ftos(e.bone_upperbody), " ", ftos(e.fixbone), "\n");
58  e.skeleton_info_modelindex = e.modelindex;
59  e.skeleton_info_skin = e.skin;
60  if(e.skeletonindex)
61  {
62  skel_delete(e.skeletonindex);
63  e.skeletonindex = 0;
64  }
65 }
string string_null
Definition: nil.qh:9
float get_model_parameters(string m, float sk)
Definition: util.qc:1258
const int MAX_AIM_BONES
Definition: util.qh:148
float get_model_parameters_fixbone
Definition: util.qh:151
#define gettagindex
Definition: dpextensions.qh:16
string get_model_parameters_bone_aim[MAX_AIM_BONES]
Definition: util.qh:149
string get_model_parameters_bone_weapon
Definition: util.qh:147
string get_model_parameters_bone_upperbody
Definition: util.qh:146
#define LOG_TRACE(...)
Definition: log.qh:81
#define MUTATOR_CALLHOOK(id,...)
Definition: base.qh:140
float get_model_parameters_bone_aimweight[MAX_AIM_BONES]
Definition: util.qh:150
+ Here is the call graph for this function:
+ Here is the caller graph for this function: