Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
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)
#define CSQCMODEL_PROPERTY_SCALED(flag, t, r, w, f, s, mi, ma)

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,
f )
Value:
.t f;

Definition at line 28 of file cl_model.qh.

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

◆ CSQCMODEL_PROPERTY_SCALED

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

Definition at line 30 of file cl_model.qh.

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

Function Documentation

◆ CSQCModel_InterpolateAnimation_1To2_Do()

void CSQCModel_InterpolateAnimation_1To2_Do ( entity this)

Definition at line 156 of file cl_model.qc.

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 frame1time
start time of framegroup animation
Definition anim.qh:22
float frame2time
start time of framegroup animation
Definition anim.qh:24
float lerpfrac
strength of framegroup blend
Definition anim.qh:15
float autocvar_cl_nolerp
Definition cl_model.qc:30
float autocvar_cl_lerpanim_maxdelta_framegroups
Definition cl_model.qc:29
float time
float bound(float min, float value, float max)

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

Referenced by CSQCModel_InterpolateAnimation_Do().

◆ CSQCModel_InterpolateAnimation_1To2_Note()

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

References entity().

◆ CSQCModel_InterpolateAnimation_1To2_PreNote()

void CSQCModel_InterpolateAnimation_1To2_PreNote ( entity this,
int sf )

Definition at line 56 of file cl_model.qc.

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 frame
primary framegroup animation (strength = 1 - lerpfrac - lerpfrac3 - lerpfrac4)
Definition anim.qh:6
const int CSQCMODEL_PROPERTY_FRAME
Definition common.qh:61

References CSQCMODEL_PROPERTY_FRAME, entity(), frame, frame1time, frame2, and frame2time.

Referenced by CSQCModel_InterpolateAnimation_PreNote().

◆ CSQCModel_InterpolateAnimation_2To4_Do()

void CSQCModel_InterpolateAnimation_2To4_Do ( entity this)

Definition at line 109 of file cl_model.qc.

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 frame3time
start time of framegroup animation
Definition anim.qh:26
float lerpfrac4
strength of framegroup blend
Definition anim.qh:19
float frame4time
start time of framegroup animation
Definition anim.qh:28
float lerpfrac3
strength of framegroup blend
Definition anim.qh:17
float csqcmodel_lerpfrac
Definition cl_model.qc:32
float csqcmodel_lerpfractime
Definition cl_model.qc:34
float csqcmodel_lerpfrac2time
Definition cl_model.qc:35
float csqcmodel_lerpfrac2
Definition cl_model.qc:33

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

Referenced by CSQCModel_Hook_PreDraw(), and CSQCModel_InterpolateAnimation_Do().

◆ CSQCModel_InterpolateAnimation_2To4_Note()

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

References entity().

◆ CSQCModel_InterpolateAnimation_2To4_PreNote()

void CSQCModel_InterpolateAnimation_2To4_PreNote ( entity this,
int sf )

Definition at line 37 of file cl_model.qc.

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 frame3
tertiary framegroup animation (strength = lerpfrac3)
Definition anim.qh:10
float frame4
quaternary framegroup animation (strength = lerpfrac4)
Definition anim.qh:12
const int CSQCMODEL_PROPERTY_FRAME2
Definition common.qh:67
const int CSQCMODEL_PROPERTY_LERPFRAC
Definition common.qh:68

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

Referenced by CSQCModel_Hook_PreDraw(), and CSQCModel_InterpolateAnimation_PreNote().

◆ CSQCModel_server2csqc()

ALLPROPERTIES entity CSQCModel_server2csqc ( int i)
Parameters
izero indexed player

Definition at line 314 of file cl_model.qc.

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}
entity CSQCModel_players[255]
Definition cl_model.qc:216
float maxclients
float entnum
#define LOG_DEBUGF(...)
Definition log.qh:81
entity findfloat(entity start,.float field, float match)
#define NULL
Definition post.qh:14

Variable Documentation

◆ csqcmodel_teleported