Xonotic
cl_model.qh File Reference
#include "common.qh"
+ Include dependency graph for cl_model.qh:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define CSQCMODEL_ENDIF
 
#define CSQCMODEL_IF(cond)
 
#define CSQCMODEL_PROPERTY(flag, t, r, w, f)   .t f;
 
#define CSQCMODEL_PROPERTY_SCALED(flag, t, r, w, f, s, mi, ma)   .t f;
 

Functions

void CSQCModel_InterpolateAnimation_1To2_Do (entity this)
 
void CSQCModel_InterpolateAnimation_1To2_Note (entity this, int sf, float set_times)
 
void CSQCModel_InterpolateAnimation_1To2_PreNote (entity this, int sf)
 
void CSQCModel_InterpolateAnimation_2To4_Do (entity this)
 
void CSQCModel_InterpolateAnimation_2To4_Note (entity this, int sf, float set_times)
 
void CSQCModel_InterpolateAnimation_2To4_PreNote (entity this, int sf)
 
ALLPROPERTIES entity CSQCModel_server2csqc (int i)
 

Variables

float csqcmodel_teleported
 

Macro Definition Documentation

◆ CSQCMODEL_ENDIF

#define CSQCMODEL_ENDIF

Definition at line 27 of file cl_model.qh.

◆ CSQCMODEL_IF

#define CSQCMODEL_IF (   cond)

Definition at line 26 of file cl_model.qh.

◆ CSQCMODEL_PROPERTY

#define CSQCMODEL_PROPERTY (   flag,
  t,
  r,
  w,
 
)    .t f;

Definition at line 28 of file cl_model.qh.

◆ CSQCMODEL_PROPERTY_SCALED

#define CSQCMODEL_PROPERTY_SCALED (   flag,
  t,
  r,
  w,
  f,
  s,
  mi,
  ma 
)    .t f;

Definition at line 30 of file cl_model.qh.

Function Documentation

◆ CSQCModel_InterpolateAnimation_1To2_Do()

void CSQCModel_InterpolateAnimation_1To2_Do ( entity  this)

Definition at line 156 of file cl_model.qc.

References autocvar_cl_lerpanim_maxdelta_framegroups, autocvar_cl_nolerp, bound(), frame1time, frame2time, lerpfrac, and time.

Referenced by CSQCModel_InterpolateAnimation_Do().

157 {
159  {
160  this.lerpfrac = 0;
161  }
162  else
163  {
164  if(this.frame2time == 0) // if frame2 was not previously displayed, only frame1 can make sense
165  this.lerpfrac = 0;
166  else
168  }
169 }
float frame2time
start time of framegroup animation
Definition: anim.qh:24
float lerpfrac
strength of framegroup blend
Definition: anim.qh:15
float autocvar_cl_lerpanim_maxdelta_framegroups
Definition: cl_model.qc:29
float autocvar_cl_nolerp
Definition: cl_model.qc:30
float time
Definition: csprogsdefs.qc:16
float frame1time
start time of framegroup animation
Definition: anim.qh:22
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CSQCModel_InterpolateAnimation_1To2_Note()

void CSQCModel_InterpolateAnimation_1To2_Note ( entity  this,
int  sf,
float  set_times 
)

◆ CSQCModel_InterpolateAnimation_1To2_PreNote()

void CSQCModel_InterpolateAnimation_1To2_PreNote ( entity  this,
int  sf 
)

Definition at line 56 of file cl_model.qc.

References CSQCMODEL_PROPERTY_FRAME, frame, frame1time, frame2, and frame2time.

Referenced by CSQCModel_InterpolateAnimation_PreNote().

57 {
59  {
60  this.frame2 = this.frame;
61  this.frame2time = this.frame1time;
62  }
63 }
float frame2
secondary framegroup animation (strength = lerpfrac)
Definition: anim.qh:8
float frame2time
start time of framegroup animation
Definition: anim.qh:24
const int CSQCMODEL_PROPERTY_FRAME
Definition: common.qh:61
float frame
primary framegroup animation (strength = 1 - lerpfrac - lerpfrac3 - lerpfrac4)
Definition: anim.qh:6
float frame1time
start time of framegroup animation
Definition: anim.qh:22
+ Here is the caller graph for this function:

◆ CSQCModel_InterpolateAnimation_2To4_Do()

void CSQCModel_InterpolateAnimation_2To4_Do ( entity  this)

Definition at line 109 of file cl_model.qc.

References autocvar_cl_lerpanim_maxdelta_framegroups, autocvar_cl_nolerp, bound(), csqcmodel_lerpfrac, csqcmodel_lerpfrac2, csqcmodel_lerpfrac2time, csqcmodel_lerpfractime, frame1time, frame2time, frame3time, frame4time, lerpfrac, lerpfrac3, lerpfrac4, and time.

Referenced by CSQCModel_Hook_PreDraw(), and CSQCModel_InterpolateAnimation_Do().

110 {
112  {
113  this.lerpfrac = this.csqcmodel_lerpfrac;
114  this.lerpfrac3 = 0;
115  this.lerpfrac4 = 0;
116  }
117  else
118  {
119  float l13, l24, llf;
120  float l24_13;
121 
122  if(this.frame3time == 0) // if frame1/3 were not previously displayed, only frame1 can make sense
123  l13 = 1;
124  else
126 
127  if(this.frame4time == 0) // if frame2/4 were not previously displayed, only frame2 can make sense
128  l24 = 1;
129  else
131 
132  if(this.csqcmodel_lerpfrac2time == 0) // if there is no old lerpfrac (newly displayed model), only lerpfrac makes sense
133  llf = 1;
134  else
136 
137  l24_13 = this.csqcmodel_lerpfrac * llf + this.csqcmodel_lerpfrac2 * (1 - llf);
138 
139  this.lerpfrac = l24 * l24_13;
140  this.lerpfrac4 = (1 - l24) * l24_13;
141  this.lerpfrac3 = (1 - l13) * (1 - l24_13);
142 
143  if(l24_13 == 0) // if frames 2/4 are not displayed, clear their frametime
144  {
145  this.frame2time = 0;
146  this.frame4time = 0;
147  }
148 
149  if(l24_13 == 1) // if frames 1/3 are not displayed, clear their frametime
150  {
151  this.frame1time = 0;
152  this.frame3time = 0;
153  }
154  }
155 }
float frame2time
start time of framegroup animation
Definition: anim.qh:24
float csqcmodel_lerpfractime
Definition: cl_model.qc:34
float csqcmodel_lerpfrac2time
Definition: cl_model.qc:35
float csqcmodel_lerpfrac2
Definition: cl_model.qc:33
float frame3time
start time of framegroup animation
Definition: anim.qh:26
float lerpfrac
strength of framegroup blend
Definition: anim.qh:15
float lerpfrac4
strength of framegroup blend
Definition: anim.qh:19
float autocvar_cl_lerpanim_maxdelta_framegroups
Definition: cl_model.qc:29
float frame4time
start time of framegroup animation
Definition: anim.qh:28
float csqcmodel_lerpfrac
Definition: cl_model.qc:32
float autocvar_cl_nolerp
Definition: cl_model.qc:30
float time
Definition: csprogsdefs.qc:16
float frame1time
start time of framegroup animation
Definition: anim.qh:22
float lerpfrac3
strength of framegroup blend
Definition: anim.qh:17
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CSQCModel_InterpolateAnimation_2To4_Note()

void CSQCModel_InterpolateAnimation_2To4_Note ( entity  this,
int  sf,
float  set_times 
)

◆ CSQCModel_InterpolateAnimation_2To4_PreNote()

void CSQCModel_InterpolateAnimation_2To4_PreNote ( entity  this,
int  sf 
)

Definition at line 37 of file cl_model.qc.

References csqcmodel_lerpfrac, csqcmodel_lerpfrac2, csqcmodel_lerpfrac2time, csqcmodel_lerpfractime, CSQCMODEL_PROPERTY_FRAME, CSQCMODEL_PROPERTY_FRAME2, CSQCMODEL_PROPERTY_LERPFRAC, frame, frame1time, frame2, frame2time, frame3, frame3time, frame4, frame4time, and lerpfrac.

Referenced by CSQCModel_Hook_PreDraw(), and CSQCModel_InterpolateAnimation_PreNote().

38 {
40  {
41  this.frame3 = this.frame;
42  this.frame3time = this.frame1time;
43  }
45  {
46  this.frame4 = this.frame2;
47  this.frame4time = this.frame2time;
48  }
50  {
53  this.lerpfrac = this.csqcmodel_lerpfrac;
54  }
55 }
float frame2
secondary framegroup animation (strength = lerpfrac)
Definition: anim.qh:8
float frame4
quaternary framegroup animation (strength = lerpfrac4)
Definition: anim.qh:12
float frame3
tertiary framegroup animation (strength = lerpfrac3)
Definition: anim.qh:10
float frame2time
start time of framegroup animation
Definition: anim.qh:24
float csqcmodel_lerpfractime
Definition: cl_model.qc:34
const int CSQCMODEL_PROPERTY_FRAME2
Definition: common.qh:67
float csqcmodel_lerpfrac2time
Definition: cl_model.qc:35
float csqcmodel_lerpfrac2
Definition: cl_model.qc:33
float frame3time
start time of framegroup animation
Definition: anim.qh:26
float lerpfrac
strength of framegroup blend
Definition: anim.qh:15
const int CSQCMODEL_PROPERTY_LERPFRAC
Definition: common.qh:68
float frame4time
start time of framegroup animation
Definition: anim.qh:28
float csqcmodel_lerpfrac
Definition: cl_model.qc:32
const int CSQCMODEL_PROPERTY_FRAME
Definition: common.qh:61
float frame
primary framegroup animation (strength = 1 - lerpfrac - lerpfrac3 - lerpfrac4)
Definition: anim.qh:6
float frame1time
start time of framegroup animation
Definition: anim.qh:22
+ Here is the caller graph for this function:

◆ CSQCModel_server2csqc()

ALLPROPERTIES entity CSQCModel_server2csqc ( int  i)
Parameters
izero indexed player

Definition at line 314 of file cl_model.qc.

References CSQCModel_players, entnum, findfloat(), LOG_DEBUGF, maxclients, and NULL.

Referenced by CSQC_UpdateView(), CSQCPlayer_SetCamera(), Hud_Dynamic_Frame(), HUD_StrafeHUD(), viewloc_PlayerPhysics(), viewmodel_animate(), viewmodel_draw(), and W_Model().

315 {
316  if (i < maxclients) return CSQCModel_players[i];
317  ++i;
318  LOG_DEBUGF("player out of bounds: %d", i);
319  return findfloat(NULL, entnum, i);
320 }
float maxclients
Definition: csprogsdefs.qc:21
#define NULL
Definition: post.qh:17
entity CSQCModel_players[255]
Definition: cl_model.qc:216
float entnum
Definition: csprogsdefs.qc:94
#define LOG_DEBUGF(...)
Definition: log.qh:86
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ csqcmodel_teleported