Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
movetypes.qh File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define GAMEPLAYFIX_DELAYPROJECTILES(s)
#define GAMEPLAYFIX_DOWNTRACEONGROUND(s)
#define GAMEPLAYFIX_EASIERWATERJUMP(s)
#define GAMEPLAYFIX_GRAVITYUNAFFECTEDBYTICRATE   (boolean(moveflags & MOVEFLAG_GRAVITYUNAFFECTEDBYTICRATE))
#define GAMEPLAYFIX_GRENADEBOUNCESLOPES(s)
#define GAMEPLAYFIX_NOAIRBORNCORPSE(s)
#define GAMEPLAYFIX_NOGRAVITYONGROUND   (boolean(moveflags & MOVEFLAG_NOGRAVITYONGROUND))
#define GAMEPLAYFIX_Q2AIRACCELERATE   (boolean(moveflags & MOVEFLAG_Q2AIRACCELERATE))
#define GAMEPLAYFIX_SLIDEMOVEPROJECTILES(s)
#define GAMEPLAYFIX_STEPDOWN(s)
#define GAMEPLAYFIX_STEPDOWN_MAXSPEED(s)
#define GAMEPLAYFIX_STEPMULTIPLETIMES(s)
#define GAMEPLAYFIX_UNSTICKPLAYERS(s)
#define GAMEPLAYFIX_WATERTRANSITION(s)
#define IS_ONGROUND(s)
#define IS_ONSLICK(s)
#define moveflags   STAT(MOVEFLAGS)
#define NOAIRBORNCORPSE_ALLOWSUSPENDED(s)
#define PHYS_ENTGRAVITY(s)
#define PHYS_GRAVITY(s)
#define PHYS_JUMPSTEP(s)
#define PHYS_NOSTEP(s)
#define PHYS_STEPHEIGHT(s)
#define PHYS_WALLCLIP(s)
#define PHYS_WALLFRICTION(s)
#define SET_ONGROUND(s)
#define SET_ONSLICK(s)
#define TICRATE   ticrate
#define UNSET_ONGROUND(s)
#define UNSET_ONSLICK(s)
#define UPWARD_VELOCITY_CLEARS_ONGROUND(s)

Functions

void _Movetype_CheckStuck (entity this)
float _Movetype_CheckWater (entity ent)
void _Movetype_CheckWaterTransition (entity ent)
vector _Movetype_ClipVelocity (vector vel, vector norm, float f)
int _Movetype_FlyMove (entity this, float dt, bool applygravity, bool applystepnormal, float stepheight)
void _Movetype_LinkEdict (entity this, float touch_triggers)
void _Movetype_LinkEdict_TouchAreaGrid (entity this)
bool _Movetype_NudgeOutOfSolid_PivotIsKnownGood (entity this, vector pivot)
bool _Movetype_PushEntity (entity this, vector push, bool dolink)
void _Movetype_PushEntityTrace (entity this, vector push)
int _Movetype_UnstickEntity (entity this)
void _Movetype_WallFriction (entity this, vector stepnormal)
void Movetype_Physics_MatchServer (entity this, bool sloppy)
void Movetype_Physics_MatchTicrate (entity this, float tr, bool sloppy)
void Movetype_Physics_NoMatchServer (entity this)
void Movetype_Physics_NoMatchTicrate (entity this, float movedt, bool isclient)
void set_movetype (entity this, int mt)
 void (float, float) contentstransition

Variables

entity aiment
bool autocvar_physics_ode
float bouncefactor
float bouncestop
entity groundentity
const int MAX_CLIP_PLANES = 5
float move_didgravity
float move_movetype
float move_nomonsters
vector move_stepnormal
float move_suspendedinair
float move_time
const int MOVEFLAG_GRAVITYUNAFFECTEDBYTICRATE = BIT(2)
const int MOVEFLAG_NOGRAVITYONGROUND = BIT(1)
const int MOVEFLAG_Q2AIRACCELERATE = BIT(0)
const int MOVEFLAG_VALID = BIT(23)
const int MOVETYPE_ANGLECLIP = 2
const int MOVETYPE_ANGLENOCLIP = 1
const int MOVETYPE_BOUNCE = 10
const int MOVETYPE_BOUNCEMISSILE = 11
const int MOVETYPE_FAKEPUSH = 13
const int MOVETYPE_FLY = 5
const int MOVETYPE_FLY_WORLDONLY = 33
const int MOVETYPE_FLYMISSILE = 9
const int MOVETYPE_FOLLOW = 12
const int MOVETYPE_NOCLIP = 8
const int MOVETYPE_NONE = 0
const int MOVETYPE_PHYSICS = 32
const int MOVETYPE_PUSH = 7
const int MOVETYPE_QCENTITY = 151
const int MOVETYPE_QCPLAYER = 150
const int MOVETYPE_STEP = 4
const int MOVETYPE_TOSS = 6
const int MOVETYPE_WALK = 3
float pm_time
vector punchangle
const int UNSTICK_FINE = 0
const int UNSTICK_FIXED = 1
const int UNSTICK_STUCK = 2
bool use_engine_physics
const int WATERLEVEL_NONE = 0
const int WATERLEVEL_SUBMERGED = 3
const int WATERLEVEL_SWIMMING = 2
const int WATERLEVEL_WETFEET = 1

Macro Definition Documentation

◆ GAMEPLAYFIX_DELAYPROJECTILES

#define GAMEPLAYFIX_DELAYPROJECTILES ( s)
Value:
#define STAT(...)
Definition stats.qh:82
#define GAMEPLAYFIX_DELAYPROJECTILES(s)
Definition movetypes.qh:35

Definition at line 35 of file movetypes.qh.

Referenced by Movetype_Physics_NoMatchTicrate().

◆ GAMEPLAYFIX_DOWNTRACEONGROUND

#define GAMEPLAYFIX_DOWNTRACEONGROUND ( s)
Value:
#define GAMEPLAYFIX_DOWNTRACEONGROUND(s)
Definition movetypes.qh:23

Definition at line 23 of file movetypes.qh.

Referenced by _Movetype_Physics_Walk().

◆ GAMEPLAYFIX_EASIERWATERJUMP

#define GAMEPLAYFIX_EASIERWATERJUMP ( s)
Value:
#define GAMEPLAYFIX_EASIERWATERJUMP(s)
Definition movetypes.qh:24

Definition at line 24 of file movetypes.qh.

Referenced by _Movetype_FlyMove().

◆ GAMEPLAYFIX_GRAVITYUNAFFECTEDBYTICRATE

#define GAMEPLAYFIX_GRAVITYUNAFFECTEDBYTICRATE   (boolean(moveflags & MOVEFLAG_GRAVITYUNAFFECTEDBYTICRATE))

◆ GAMEPLAYFIX_GRENADEBOUNCESLOPES

#define GAMEPLAYFIX_GRENADEBOUNCESLOPES ( s)
Value:
#define GAMEPLAYFIX_GRENADEBOUNCESLOPES(s)
Definition movetypes.qh:31

Definition at line 31 of file movetypes.qh.

Referenced by _Movetype_Physics_Toss().

◆ GAMEPLAYFIX_NOAIRBORNCORPSE

#define GAMEPLAYFIX_NOAIRBORNCORPSE ( s)
Value:
#define GAMEPLAYFIX_NOAIRBORNCORPSE(s)
Definition movetypes.qh:32

Definition at line 32 of file movetypes.qh.

Referenced by _Movetype_Physics_Toss().

◆ GAMEPLAYFIX_NOGRAVITYONGROUND

#define GAMEPLAYFIX_NOGRAVITYONGROUND   (boolean(moveflags & MOVEFLAG_NOGRAVITYONGROUND))

Definition at line 50 of file movetypes.qh.

Referenced by _Movetype_FlyMove().

◆ GAMEPLAYFIX_Q2AIRACCELERATE

#define GAMEPLAYFIX_Q2AIRACCELERATE   (boolean(moveflags & MOVEFLAG_Q2AIRACCELERATE))

Definition at line 51 of file movetypes.qh.

Referenced by PM_Accelerate().

◆ GAMEPLAYFIX_SLIDEMOVEPROJECTILES

#define GAMEPLAYFIX_SLIDEMOVEPROJECTILES ( s)
Value:
#define GAMEPLAYFIX_SLIDEMOVEPROJECTILES(s)
Definition movetypes.qh:30

Definition at line 30 of file movetypes.qh.

Referenced by _Movetype_Physics_Toss().

◆ GAMEPLAYFIX_STEPDOWN

#define GAMEPLAYFIX_STEPDOWN ( s)
Value:
#define GAMEPLAYFIX_STEPDOWN(s)
Definition movetypes.qh:25

Definition at line 25 of file movetypes.qh.

Referenced by _Movetype_Physics_Walk().

◆ GAMEPLAYFIX_STEPDOWN_MAXSPEED

#define GAMEPLAYFIX_STEPDOWN_MAXSPEED ( s)
Value:
#define GAMEPLAYFIX_STEPDOWN_MAXSPEED(s)
Definition movetypes.qh:26

Definition at line 26 of file movetypes.qh.

Referenced by _Movetype_Physics_Walk().

◆ GAMEPLAYFIX_STEPMULTIPLETIMES

#define GAMEPLAYFIX_STEPMULTIPLETIMES ( s)
Value:
#define GAMEPLAYFIX_STEPMULTIPLETIMES(s)
Definition movetypes.qh:27

Definition at line 27 of file movetypes.qh.

Referenced by _Movetype_Physics_Walk().

◆ GAMEPLAYFIX_UNSTICKPLAYERS

#define GAMEPLAYFIX_UNSTICKPLAYERS ( s)
Value:
#define GAMEPLAYFIX_UNSTICKPLAYERS(s)
Definition movetypes.qh:28

Definition at line 28 of file movetypes.qh.

Referenced by _Movetype_Physics_ClientFrame(), and _Movetype_Physics_Walk().

◆ GAMEPLAYFIX_WATERTRANSITION

#define GAMEPLAYFIX_WATERTRANSITION ( s)
Value:
#define GAMEPLAYFIX_WATERTRANSITION(s)
Definition movetypes.qh:29

Definition at line 29 of file movetypes.qh.

Referenced by _Movetype_CheckWaterTransition().

◆ IS_ONGROUND

#define IS_ONGROUND ( s)

◆ IS_ONSLICK

#define IS_ONSLICK ( s)
Value:
const int FL_ONSLICK
Definition constants.qh:90

Definition at line 19 of file movetypes.qh.

Referenced by _Movetype_Physics_Walk(), sys_phys_simulate(), and sys_phys_update().

◆ moveflags

#define moveflags   STAT(MOVEFLAGS)

Definition at line 161 of file movetypes.qh.

◆ NOAIRBORNCORPSE_ALLOWSUSPENDED

#define NOAIRBORNCORPSE_ALLOWSUSPENDED ( s)
Value:
#define NOAIRBORNCORPSE_ALLOWSUSPENDED(s)
Definition movetypes.qh:33

Definition at line 33 of file movetypes.qh.

Referenced by _Movetype_Physics_Toss().

◆ PHYS_ENTGRAVITY

#define PHYS_ENTGRAVITY ( s)
Value:
STAT(MOVEVARS_ENTGRAVITY, s)

Definition at line 55 of file movetypes.qh.

Referenced by sys_phys_update().

◆ PHYS_GRAVITY

◆ PHYS_JUMPSTEP

#define PHYS_JUMPSTEP ( s)
Value:
STAT(MOVEVARS_JUMPSTEP)

Definition at line 40 of file movetypes.qh.

Referenced by _Movetype_Physics_Walk().

◆ PHYS_NOSTEP

#define PHYS_NOSTEP ( s)
Value:
STAT(NOSTEP)

Definition at line 39 of file movetypes.qh.

Referenced by _Movetype_Physics_Walk().

◆ PHYS_STEPHEIGHT

#define PHYS_STEPHEIGHT ( s)
Value:
STAT(MOVEVARS_STEPHEIGHT)

Definition at line 38 of file movetypes.qh.

Referenced by _Movetype_Physics_Walk(), CSQCModel_ApplyStairSmoothing(), and CSQCPlayer_ApplySmoothing().

◆ PHYS_WALLCLIP

#define PHYS_WALLCLIP ( s)
Value:
STAT(MOVEVARS_WALLCLIP)

Definition at line 43 of file movetypes.qh.

Referenced by _Movetype_FlyMove(), and _Movetype_Physics_Walk().

◆ PHYS_WALLFRICTION

#define PHYS_WALLFRICTION ( s)
Value:
STAT(MOVEVARS_WALLFRICTION)

Definition at line 41 of file movetypes.qh.

Referenced by _Movetype_Physics_Walk().

◆ SET_ONGROUND

#define SET_ONGROUND ( s)

◆ SET_ONSLICK

#define SET_ONSLICK ( s)
Value:
((s).flags |= FL_ONSLICK)

Definition at line 20 of file movetypes.qh.

Referenced by PM_check_slick().

◆ TICRATE

#define TICRATE   ticrate

Definition at line 57 of file movetypes.qh.

Referenced by Movetype_Physics_MatchServer().

◆ UNSET_ONGROUND

◆ UNSET_ONSLICK

#define UNSET_ONSLICK ( s)
Value:
((s).flags &= ~FL_ONSLICK)

Definition at line 21 of file movetypes.qh.

Referenced by PlayerJump(), and PM_check_slick().

◆ UPWARD_VELOCITY_CLEARS_ONGROUND

#define UPWARD_VELOCITY_CLEARS_ONGROUND ( s)
Value:
STAT(GAMEPLAYFIX_UPVELOCITYCLEARSONGROUND)

Definition at line 34 of file movetypes.qh.

Referenced by _Movetype_Physics_Step(), and _Movetype_Physics_Toss().

Function Documentation

◆ _Movetype_CheckStuck()

void _Movetype_CheckStuck ( entity this)

Definition at line 620 of file movetypes.qc.

621{
622 int unstick = _Movetype_UnstickEntity(this); // sets test position entity
623 switch(unstick)
624 {
625 case UNSTICK_FINE:
626 this.oldorigin = this.origin;
627 break;
628 case UNSTICK_FIXED:
629 break; // already sorted
630 case UNSTICK_STUCK:
631 vector offset = this.oldorigin - this.origin;
633 _Movetype_LinkEdict(this, false);
634 // couldn't unstick, should we warn about this?
635 break;
636 }
637}
vector origin
vector oldorigin
void _Movetype_LinkEdict(entity this, bool touch_triggers)
Definition movetypes.qc:516
bool _Movetype_TestEntityPosition(vector ofs)
Definition movetypes.qc:555
int _Movetype_UnstickEntity(entity this)
Definition movetypes.qc:593
const int UNSTICK_FINE
Definition movetypes.qh:98
const int UNSTICK_STUCK
Definition movetypes.qh:100
const int UNSTICK_FIXED
Definition movetypes.qh:99
vector
Definition self.qh:92

References _Movetype_LinkEdict(), _Movetype_TestEntityPosition(), _Movetype_UnstickEntity(), entity(), oldorigin, origin, UNSTICK_FINE, UNSTICK_FIXED, UNSTICK_STUCK, and vector.

Referenced by _Movetype_Physics_ClientFrame(), and _Movetype_Physics_Walk().

◆ _Movetype_CheckWater()

float _Movetype_CheckWater ( entity ent)

Definition at line 334 of file movetypes.qc.

335{
336 vector point = this.origin;
337 point.z += this.mins.z + 1;
338
339 int nativecontents = pointcontents(point);
340 if(this.watertype && this.watertype != nativecontents)
341 {
342 // dprintf("_Movetype_CheckWater(): Original: '%d', New: '%d'\n", this.watertype, nativecontents);
343 if(this.contentstransition)
344 this.contentstransition(this.watertype, nativecontents);
345 }
346
349
350 int supercontents = Mod_Q1BSP_SuperContentsFromNativeContents(nativecontents);
351 if(supercontents & DPCONTENTS_LIQUIDSMASK)
352 {
353 this.watertype = nativecontents;
355 point.z = this.origin.z + (this.mins.z + this.maxs.z) * 0.5;
357 {
359 point.z = this.origin.z + this.view_ofs.z;
362 }
363 }
364
365 return this.waterlevel > 1;
366}
float watertype
Definition player.qh:225
float waterlevel
Definition player.qh:226
int Mod_Q1BSP_SuperContentsFromNativeContents(int nativecontents)
Definition util.qc:1923
vector mins
float DPCONTENTS_LIQUIDSMASK
vector maxs
const float CONTENT_EMPTY
const int WATERLEVEL_SWIMMING
Definition movetypes.qh:13
const int WATERLEVEL_WETFEET
Definition movetypes.qh:12
const int WATERLEVEL_SUBMERGED
Definition movetypes.qh:14
const int WATERLEVEL_NONE
Definition movetypes.qh:11
vector view_ofs
Definition progsdefs.qc:151

References CONTENT_EMPTY, DPCONTENTS_LIQUIDSMASK, entity(), maxs, mins, Mod_Q1BSP_SuperContentsFromNativeContents(), origin, vector, view_ofs, waterlevel, WATERLEVEL_NONE, WATERLEVEL_SUBMERGED, WATERLEVEL_SWIMMING, WATERLEVEL_WETFEET, and watertype.

Referenced by _Movetype_Physics_ClientFrame(), _Movetype_Physics_Frame(), _Movetype_Physics_Walk(), PM_ClientMovement_UpdateStatus(), and StrafeHUD_DetermineWaterLevel().

◆ _Movetype_CheckWaterTransition()

void _Movetype_CheckWaterTransition ( entity ent)

Definition at line 368 of file movetypes.qc.

369{
370 int contents = pointcontents(ent.origin);
371
372 if(!ent.watertype)
373 {
374 // just spawned here
376 {
377 ent.watertype = contents;
378 ent.waterlevel = 1;
379 return;
380 }
381 }
382 else if(ent.watertype != contents)
383 {
384 // dprintf("_Movetype_CheckWaterTransition(): Origin: %s, Direct: '%d', Original: '%d', New: '%d'\n", vtos(ent.origin), pointcontents(ent.origin), ent.watertype, contents);
385 if(ent.contentstransition)
386 ent.contentstransition(ent.watertype, contents);
387 }
388
389 if(contents <= CONTENT_WATER)
390 {
391 ent.watertype = contents;
392 ent.waterlevel = 1;
393 }
394 else
395 {
396 ent.watertype = CONTENT_EMPTY;
397 ent.waterlevel = (GAMEPLAYFIX_WATERTRANSITION(ent) ? 0 : contents);
398 }
399}
const float CONTENT_WATER

References CONTENT_EMPTY, CONTENT_WATER, entity(), and GAMEPLAYFIX_WATERTRANSITION.

Referenced by _Movetype_Physics_Step(), and _Movetype_Physics_Toss().

◆ _Movetype_ClipVelocity()

vector _Movetype_ClipVelocity ( vector vel,
vector norm,
float f )

Definition at line 639 of file movetypes.qc.

640{
641 vel -= ((vel * norm) * norm) * f;
642
643 if(vel.x > -0.1 && vel.x < 0.1) vel.x = 0;
644 if(vel.y > -0.1 && vel.y < 0.1) vel.y = 0;
645 if(vel.z > -0.1 && vel.z < 0.1) vel.z = 0;
646
647 return vel;
648}

References vector.

Referenced by _Movetype_FlyMove(), and _Movetype_Physics_Toss().

◆ _Movetype_FlyMove()

int _Movetype_FlyMove ( entity this,
float dt,
bool applygravity,
bool applystepnormal,
float stepheight )

Definition at line 120 of file movetypes.qc.

121{
122 move_stepnormal = '0 0 0';
123
124 if(dt <= 0)
125 return 0;
126
127 int blockedflag = 0;
128 int numplanes = 0;
129 float time_left = dt, grav = 0;
130 vector push;
131 vector primal_velocity, original_velocity;
132 vector restore_velocity = this.velocity;
133
134 for(int j = 0; j < MAX_CLIP_PLANES; ++j)
135 planes[j] = '0 0 0';
136
137 if(applygravity)
138 {
139 this.move_didgravity = 1;
140 grav = dt * (this.gravity ? this.gravity : 1) * PHYS_GRAVITY(this);
141
143 {
145 this.velocity_z -= grav * 0.5;
146 else
147 this.velocity_z -= grav;
148 }
149 }
150
151 original_velocity = primal_velocity = this.velocity;
152
153 for(int bumpcount = 0;bumpcount < MAX_CLIP_PLANES; ++bumpcount)
154 {
155 if(this.velocity == '0 0 0')
156 break;
157
158 push = this.velocity * time_left;
159 if(!_Movetype_PushEntity(this, push, false))
160 {
161 // we got teleported by a touch function
162 // let's abort the move
163 blockedflag |= 8;
164 break;
165 }
166
167 // this code is used by MOVETYPE_WALK and MOVETYPE_STEP and SV_UnstickEntity
168 // abort move if we're stuck in the world (and didn't make it out)
170 {
171 this.velocity = restore_velocity;
172 return 3;
173 }
174
175 if(trace_fraction == 1)
176 break;
177
178 time_left *= 1 - trace_fraction;
179
180 float my_trace_fraction = trace_fraction;
181 vector my_trace_plane_normal = trace_plane_normal;
182
184 {
185 if(trace_plane_normal.z > 0.7)
186 {
187 // floor
188 blockedflag |= 1;
189
190 if(!trace_ent)
191 {
192 //dprint("_Movetype_FlyMove: !trace_ent\n");
193 trace_ent = NULL;
194 }
195
196 SET_ONGROUND(this);
197 this.groundentity = trace_ent;
198 }
199 }
200 else if(stepheight)
201 {
202 // step - handle it immediately
203 vector org = this.origin;
204 vector steppush = vec3(0, 0, stepheight);
205 push = this.velocity * time_left;
206
207 if(!_Movetype_PushEntity(this, steppush, false))
208 {
209 blockedflag |= 8;
210 break;
211 }
212 if(!_Movetype_PushEntity(this, push, false))
213 {
214 blockedflag |= 8;
215 break;
216 }
217 float trace2_fraction = trace_fraction;
218 steppush = vec3(0, 0, org.z - this.origin_z);
219 if(!_Movetype_PushEntity(this, steppush, false))
220 {
221 blockedflag |= 8;
222 break;
223 }
224
225 // accept the new position if it made some progress...
226 // previously this checked if absolute distance >= 0.03125 which made stepping up unreliable
227 if(this.origin_x - org.x || this.origin_y - org.y)
228 {
229 trace_endpos = this.origin;
230 time_left *= 1 - trace2_fraction;
231 numplanes = 0;
232 continue;
233 }
234 else
235 this.origin = org;
236 }
237 else
238 {
239 // step - return it to caller
240 blockedflag |= 2;
241 // save the trace for player extrafriction
242 if(applystepnormal)
244 }
245
246 if(my_trace_fraction >= 0.001)
247 {
248 // actually covered some distance
249 original_velocity = this.velocity;
250 numplanes = 0;
251 }
252
253 // clipped to another plane
254 if(numplanes >= MAX_CLIP_PLANES)
255 {
256 // this shouldn't really happen
257 this.velocity = '0 0 0';
258 blockedflag = 3;
259 break;
260 }
261
262 planes[numplanes] = my_trace_plane_normal;
263 numplanes++;
264
265 // modify original_velocity so it parallels all of the clip planes
266 vector new_velocity = '0 0 0';
267 int plane;
268 for (plane = 0;plane < numplanes; ++plane)
269 {
270 int newplane;
271 new_velocity = _Movetype_ClipVelocity(original_velocity, planes[plane], 1);
272 for (newplane = 0;newplane < numplanes; ++newplane)
273 {
274 if(newplane != plane)
275 {
276 // not ok
277 if((new_velocity * planes[newplane]) < 0)
278 break;
279 }
280 }
281 if(newplane == numplanes)
282 break;
283 }
284
285 if(plane != numplanes)
286 {
287 // go along this plane
288 this.velocity = new_velocity;
289 }
290 else
291 {
292 // go along the crease
293 if(numplanes != 2)
294 {
295 this.velocity = '0 0 0';
296 blockedflag = 7;
297 break;
298 }
299 vector dir = cross(planes[0], planes[1]);
300 // LordHavoc: thanks to taniwha of QuakeForge for pointing out this fix for slowed falling in corners
301 dir = normalize(dir);
302 float d = (dir * this.velocity);
303 this.velocity = dir * d;
304 }
305
306 // if current velocity is against the original velocity,
307 // stop dead to avoid tiny occilations in sloping corners
308 if((this.velocity * primal_velocity) <= 0)
309 {
310 this.velocity = '0 0 0';
311 break;
312 }
313 }
314
315 // LordHavoc: this came from QW and allows you to get out of water more easily
316 if(GAMEPLAYFIX_EASIERWATERJUMP(this) && (this.flags & FL_WATERJUMP) && !(blockedflag & 8))
317 this.velocity = primal_velocity;
318
319 if(PHYS_WALLCLIP(this) && this.pm_time && !(this.flags & FL_WATERJUMP) && !(blockedflag & 8))
320 this.velocity = primal_velocity;
321
322 if(applygravity)
323 {
325 {
327 this.velocity_z -= grav * 0.5f;
328 }
329 }
330
331 return blockedflag;
332}
float gravity
Definition items.qh:17
const int FL_WATERJUMP
Definition constants.qh:80
entity trace_ent
vector velocity
vector trace_endpos
float trace_startsolid
float trace_fraction
float trace_allsolid
vector trace_plane_normal
vector normalize(vector v)
vector planes[MAX_CLIP_PLANES]
Definition movetypes.qc:119
vector _Movetype_ClipVelocity(vector vel, vector norm, float f)
Definition movetypes.qc:639
bool _Movetype_PushEntity(entity this, vector push, bool dolink)
Definition movetypes.qc:668
#define GAMEPLAYFIX_NOGRAVITYONGROUND
Definition movetypes.qh:50
const int MAX_CLIP_PLANES
Definition movetypes.qh:126
#define PHYS_WALLCLIP(s)
Definition movetypes.qh:43
#define PHYS_GRAVITY(s)
Definition movetypes.qh:53
float pm_time
Definition movetypes.qh:74
entity groundentity
Definition movetypes.qh:93
#define SET_ONGROUND(s)
Definition movetypes.qh:17
vector move_stepnormal
Definition movetypes.qh:103
float move_didgravity
Definition movetypes.qh:95
#define GAMEPLAYFIX_GRAVITYUNAFFECTEDBYTICRATE
Definition movetypes.qh:49
#define IS_ONGROUND(s)
Definition movetypes.qh:16
#define NULL
Definition post.qh:14
vector org
Definition self.qh:92
int dir
Definition impulse.qc:89
#define cross(a, b)
Definition vector.qh:25
#define vec3(_x, _y, _z)
Definition vector.qh:95

References _Movetype_ClipVelocity(), _Movetype_PushEntity(), cross, dir, entity(), FL_WATERJUMP, flags, GAMEPLAYFIX_EASIERWATERJUMP, GAMEPLAYFIX_GRAVITYUNAFFECTEDBYTICRATE, GAMEPLAYFIX_NOGRAVITYONGROUND, gravity, groundentity, IS_ONGROUND, MAX_CLIP_PLANES, move_didgravity, move_stepnormal, normalize(), NULL, org, origin, PHYS_GRAVITY, PHYS_WALLCLIP, planes, pm_time, SET_ONGROUND, trace_allsolid, trace_endpos, trace_ent, trace_fraction, trace_plane_normal, trace_startsolid, vec3, vector, and velocity.

Referenced by _Movetype_Physics_Step(), and _Movetype_Physics_Walk().

◆ _Movetype_LinkEdict()

void _Movetype_LinkEdict ( entity this,
float touch_triggers )

References entity(), and vector.

◆ _Movetype_LinkEdict_TouchAreaGrid()

void _Movetype_LinkEdict_TouchAreaGrid ( entity this)

Definition at line 449 of file movetypes.qc.

450{
451 if(this.solid == SOLID_NOT)
452 return;
453
454 // due to a lack of pointers in QC, we must save the trace values and restore them for other functions
455 bool save_trace_allsolid = trace_allsolid;
456 bool save_trace_startsolid = trace_startsolid;
457 float save_trace_fraction = trace_fraction;
458 bool save_trace_inwater = trace_inwater;
459 bool save_trace_inopen = trace_inopen;
460 vector save_trace_endpos = trace_endpos;
461 vector save_trace_plane_normal = trace_plane_normal;
462 float save_trace_plane_dist = trace_plane_dist;
463 entity save_trace_ent = trace_ent;
464 int save_trace_dpstartcontents = trace_dpstartcontents;
465 int save_trace_dphitcontents = trace_dphitcontents;
466 int save_trace_dphitq3surfaceflags = trace_dphitq3surfaceflags;
467 string save_trace_dphittexturename = trace_dphittexturename;
468
469 vector emin = this.absmin, emax = this.absmax;
470 // Xonotic and Nexuiz maps assume triggers will be activated by adjacent players
471 // prior to sv_legacy_bbox_expand 0 DP always did this for SVQC and never for CSQC
472 // we also need this for zero-size bboxes because radius == 0 returns nothing
473 // see also: WarpZoneLib_ExactTrigger_Touch()
474 emin -= '1 1 1';
475 emax += '1 1 1';
476
477 FOREACH_ENTITY_RADIUS_ORDERED(0.5 * (this.absmin + this.absmax), 0.5 * vlen(emin - emax), true, {
478 if (it.solid == SOLID_TRIGGER && it != this)
479 if (it.move_nomonsters != MOVE_NOMONSTERS && it.move_nomonsters != MOVE_WORLDONLY)
480 if (gettouch(it) && boxesoverlap(it.absmin, it.absmax, emin, emax))
481 {
482 trace_allsolid = false;
483 trace_startsolid = false;
484 trace_fraction = 1;
485 trace_inwater = false;
486 trace_inopen = true;
487 trace_endpos = it.origin;
488 trace_plane_normal = '0 0 1';
490 trace_ent = this;
495
496 gettouch(it)(it, this);
497 }
498 });
499
500 trace_allsolid = save_trace_allsolid;
501 trace_startsolid = save_trace_startsolid;
502 trace_fraction = save_trace_fraction;
503 trace_inwater = save_trace_inwater;
504 trace_inopen = save_trace_inopen;
505 trace_endpos = save_trace_endpos;
506 trace_plane_normal = save_trace_plane_normal;
507 trace_plane_dist = save_trace_plane_dist;
508 trace_ent = save_trace_ent;
509 trace_dpstartcontents = save_trace_dpstartcontents;
510 trace_dphitcontents = save_trace_dphitcontents;
511 trace_dphitq3surfaceflags = save_trace_dphitq3surfaceflags;
512 trace_dphittexturename = save_trace_dphittexturename;
513}
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
const float MOVE_NOMONSTERS
float trace_dphitcontents
const float SOLID_TRIGGER
float trace_dpstartcontents
const float SOLID_NOT
string trace_dphittexturename
float trace_inopen
float MOVE_WORLDONLY
float trace_dphitq3surfaceflags
vector absmax
vector absmin
float trace_plane_dist
float trace_inwater
solid
Definition ent_cs.qc:165
#define FOREACH_ENTITY_RADIUS_ORDERED(org, dist, cond, body)
Definition iter.qh:164
float vlen(vector v)
string string_null
Definition nil.qh:9
#define gettouch(e)
Definition self.qh:74
ERASEABLE float boxesoverlap(vector m1, vector m2, vector m3, vector m4)
requires that m2>m1 in all coordinates, and that m4>m3
Definition vector.qh:73

References absmax, absmin, boxesoverlap(), entity(), FOREACH_ENTITY_RADIUS_ORDERED, gettouch, MOVE_NOMONSTERS, MOVE_WORLDONLY, solid, SOLID_NOT, SOLID_TRIGGER, string_null, trace_allsolid, trace_dphitcontents, trace_dphitq3surfaceflags, trace_dphittexturename, trace_dpstartcontents, trace_endpos, trace_ent, trace_fraction, trace_inopen, trace_inwater, trace_plane_dist, trace_plane_normal, trace_startsolid, vector, and vlen().

Referenced by _Movetype_LinkEdict().

◆ _Movetype_NudgeOutOfSolid_PivotIsKnownGood()

bool _Movetype_NudgeOutOfSolid_PivotIsKnownGood ( entity this,
vector pivot )

Definition at line 19 of file movetypes.qc.

20{
21 vector stuckorigin = this.origin;
22 vector goodmins = pivot, goodmaxs = pivot;
23 for(int bump = 0; bump < 6; ++bump)
24 {
25 int coord = 2 - (bump >> 1);
26 int dir = (bump & 1);
27
28 for(int subbump = 0; ; ++subbump)
29 {
30 vector testorigin = stuckorigin;
31 if(dir)
32 {
33 // pushing maxs
34 switch(coord)
35 {
36 case 0: testorigin.x += this.maxs_x - goodmaxs.x; break;
37 case 1: testorigin.y += this.maxs_y - goodmaxs.y; break;
38 case 2: testorigin.z += this.maxs_z - goodmaxs.z; break;
39 }
40 }
41 else
42 {
43 // pushing mins
44 switch(coord)
45 {
46 case 0: testorigin.x += this.mins_x - goodmins.x; break;
47 case 1: testorigin.y += this.mins_y - goodmins.y; break;
48 case 2: testorigin.z += this.mins_z - goodmins.z; break;
49 }
50 }
51
52 tracebox(stuckorigin, goodmins, goodmaxs, testorigin, MOVE_NOMONSTERS, this);
53 if(trace_startsolid && trace_ent.solid == SOLID_BSP) // NOTE: this checks for bmodelstartsolid in the engine
54 {
55 // BAD BAD, can't fix that
56 return false;
57 }
58
59 if(trace_fraction >= 1)
60 break; // it WORKS!
61
62 if(subbump >= 10)
63 {
64 // BAD BAD, can't fix that
65 return false;
66 }
67
68 // we hit something... let's move out of it
69 vector move = trace_endpos - testorigin;
70 float nudge = (trace_plane_normal * move) + 0.03125; // FIXME cvar this constant
71 stuckorigin = stuckorigin + nudge * trace_plane_normal;
72 }
73
74 if(dir)
75 {
76 // pushing maxs
77 switch(coord)
78 {
79 case 0: goodmaxs.x = this.maxs_x; break;
80 case 1: goodmaxs.y = this.maxs_y; break;
81 case 2: goodmaxs.z = this.maxs_z; break;
82 }
83 }
84 else
85 {
86 // pushing mins
87 switch(coord)
88 {
89 case 0: goodmins.x = this.mins_x; break;
90 case 1: goodmins.y = this.mins_y; break;
91 case 2: goodmins.z = this.mins_z; break;
92 }
93 }
94 }
95
96 // WE WIN
97 this.origin = stuckorigin;
98
99 return true;
100}
const float SOLID_BSP

References dir, entity(), MOVE_NOMONSTERS, origin, SOLID_BSP, trace_endpos, trace_ent, trace_fraction, trace_plane_normal, trace_startsolid, and vector.

Referenced by _Movetype_PushMove().

◆ _Movetype_PushEntity()

bool _Movetype_PushEntity ( entity this,
vector push,
bool dolink )

Definition at line 668 of file movetypes.qc.

669{
670 _Movetype_PushEntityTrace(this, push);
671
672 // NOTE: this is a workaround for the QC's lack of a worldstartsolid trace parameter
674 {
675 int oldtype = this.move_nomonsters;
677 _Movetype_PushEntityTrace(this, push);
678 this.move_nomonsters = oldtype;
680 {
681 trace_fraction = 0;
682 return true;
683 }
684 }
685
686 this.origin = trace_endpos;
687
688 vector last_origin = this.origin;
689
690 _Movetype_LinkEdict(this, dolink);
691
692 if((this.solid >= SOLID_TRIGGER && trace_fraction < 1 && (!IS_ONGROUND(this) || this.groundentity != trace_ent)))
694
695 return (this.origin == last_origin); // false if teleported by touch
696}
void _Movetype_PushEntityTrace(entity this, vector push)
Definition movetypes.qc:650
void _Movetype_Impact(entity this, entity toucher)
Definition movetypes.qc:401
float move_nomonsters
Definition movetypes.qh:88

References _Movetype_Impact(), _Movetype_LinkEdict(), _Movetype_PushEntityTrace(), entity(), groundentity, IS_ONGROUND, move_nomonsters, MOVE_WORLDONLY, origin, solid, SOLID_TRIGGER, trace_endpos, trace_ent, trace_fraction, trace_startsolid, and vector.

Referenced by _Movetype_FlyMove(), _Movetype_Physics_Toss(), _Movetype_Physics_Walk(), and _Movetype_PushMove().

◆ _Movetype_PushEntityTrace()

void _Movetype_PushEntityTrace ( entity this,
vector push )

Definition at line 650 of file movetypes.qc.

651{
652 vector end = this.origin + push;
653 int type;
654 if(this.move_nomonsters)
655 type = max(0, this.move_nomonsters);
656 else if(this.move_movetype == MOVETYPE_FLYMISSILE)
657 type = MOVE_MISSILE;
659 type = MOVE_WORLDONLY;
660 else if(this.solid == SOLID_TRIGGER || this.solid == SOLID_NOT)
661 type = MOVE_NOMONSTERS;
662 else
663 type = MOVE_NORMAL;
664
665 tracebox(this.origin, this.mins, this.maxs, end, type, this);
666}
const float MOVE_NORMAL
const float MOVE_MISSILE
float max(float f,...)
const int MOVETYPE_FLYMISSILE
Definition movetypes.qh:138
const int MOVETYPE_FLY_WORLDONLY
Definition movetypes.qh:143
float move_movetype
Definition movetypes.qh:76

References entity(), max(), maxs, mins, MOVE_MISSILE, move_movetype, MOVE_NOMONSTERS, move_nomonsters, MOVE_NORMAL, MOVE_WORLDONLY, MOVETYPE_FLY_WORLDONLY, MOVETYPE_FLYMISSILE, origin, solid, SOLID_NOT, SOLID_TRIGGER, and vector.

Referenced by _Movetype_PushEntity(), and Movetype_Physics_MatchTicrate().

◆ _Movetype_UnstickEntity()

int _Movetype_UnstickEntity ( entity this)

Definition at line 593 of file movetypes.qc.

594{
596 if (!_Movetype_TestEntityPosition(' 0 0 0')) {
597 return UNSTICK_FINE;
598 }
599 #define X(v) if (_Movetype_TestEntityPosition(v))
600 X('0 0 -1') X(' 0 0 1')
601 X('-1 0 0') X(' 1 0 0')
602 X(' 0 -1 0') X(' 0 1 0')
603 X('-1 -1 0') X(' 1 -1 0')
604 X('-1 1 0') X(' 1 1 0')
605 #undef X
606 {
607 if(_Movetype_TestEntityPosition_Offset(rint((this.maxs.z - this.mins.z) * 0.36)))
608 {
609 LOG_DEBUGF("Can't unstick an entity (edict: %d, classname: %s, origin: %s)",
610 etof(this), this.classname, vtos(this.origin));
611 return UNSTICK_STUCK;
612 }
613 }
614 LOG_DEBUGF("Sucessfully unstuck an entity (edict: %d, classname: %s, origin: %s)",
615 etof(this), this.classname, vtos(this.origin));
616 _Movetype_LinkEdict(this, false);
617 return UNSTICK_FIXED;
618}
string classname
#define X()
#define LOG_DEBUGF(...)
Definition log.qh:81
string vtos(vector v)
float rint(float f)
#define etof(e)
Definition misc.qh:25
entity _Movetype_TestEntityPosition_ent
Definition movetypes.qc:554
#define X(v)
bool _Movetype_TestEntityPosition_Offset(int offset)
Definition movetypes.qc:576

References _Movetype_LinkEdict(), _Movetype_TestEntityPosition(), _Movetype_TestEntityPosition_ent, _Movetype_TestEntityPosition_Offset(), classname, entity(), etof, LOG_DEBUGF, maxs, origin, rint(), UNSTICK_FINE, UNSTICK_FIXED, UNSTICK_STUCK, vtos(), and X.

Referenced by _Movetype_CheckStuck(), and _Movetype_Physics_Toss().

◆ _Movetype_WallFriction()

void _Movetype_WallFriction ( entity this,
vector stepnormal )

Definition at line 102 of file movetypes.qc.

103{
104 /*float d, i;
105 vector into, side;
106 makevectors(this.v_angle);
107 d = (stepnormal * v_forward) + 0.5;
108
109 if(d < 0)
110 {
111 i = (stepnormal * this.velocity);
112 into = i * stepnormal;
113 side = this.velocity - into;
114 this.velocity_x = side.x * (1 * d);
115 this.velocity_y = side.y * (1 * d);
116 }*/
117}

References entity(), and vector.

Referenced by _Movetype_Physics_Walk().

◆ Movetype_Physics_MatchServer()

void Movetype_Physics_MatchServer ( entity this,
bool sloppy )

Definition at line 817 of file movetypes.qc.

818{
820}
void Movetype_Physics_MatchTicrate(entity this, float tr, bool sloppy)
Definition movetypes.qc:835
#define TICRATE
Definition movetypes.qh:57

References entity(), Movetype_Physics_MatchTicrate(), and TICRATE.

Referenced by Projectile_Draw().

◆ Movetype_Physics_MatchTicrate()

void Movetype_Physics_MatchTicrate ( entity this,
float tr,
bool sloppy )

Definition at line 835 of file movetypes.qc.

836{
837 // this hack exists to contain the physics feature
838 // (so entities can place themselves in the world and not need to update .tic_* themselves)
839#define X(s) \
840 if(this.(s) != this.tic_saved_##s) \
841 this.tic_##s = this.(s)
842
843 X(origin);
844 X(velocity);
845 X(flags);
846 X(avelocity);
847 X(angles);
848#undef X
849
850 this.flags = this.tic_flags;
851 this.velocity = this.tic_velocity;
852 setorigin(this, this.tic_origin);
853 this.avelocity = this.tic_avelocity;
854 this.angles = this.tic_angles;
855
856 if(tr <= 0)
857 {
859
860 this.tic_saved_flags = this.tic_flags = this.flags;
861 this.tic_saved_velocity = this.tic_velocity = this.velocity;
862 this.tic_saved_origin = this.tic_origin = this.origin;
864 this.tic_saved_angles = this.tic_angles = this.angles;
865 return;
866 }
867
868 float dt = time - this.move_time;
869
870 int n = bound(0, floor(dt / tr), 32); // limit the number of frames to 32 (CL_MAX_USERCMDS, using DP_SMALLMEMORY value for consideration of QC's limitations)
871 dt -= n * tr;
872 this.move_time += n * tr;
873
874 if(!this.move_didgravity)
876
877 for (int j = 0; j < n; ++j)
878 {
879 _Movetype_Physics_Frame(this, tr);
880 if(wasfreed(this))
881 return;
882 }
883
884 // update the physics fields
885 this.tic_origin = this.origin;
886 this.tic_velocity = this.velocity;
887 this.tic_avelocity = this.avelocity;
888 this.tic_angles = this.angles;
889 this.tic_flags = this.flags;
890
891 // restore their actual values
892 this.flags = this.tic_saved_flags;
893 this.velocity = this.tic_saved_velocity;
894 setorigin(this, this.tic_saved_origin);
895 //this.avelocity = this.tic_saved_avelocity;
896 this.angles = this.tic_saved_angles;
897
898 this.avelocity = this.tic_avelocity;
899
900 if(dt > 0 && this.move_movetype != MOVETYPE_NONE && !(this.tic_flags & FL_ONGROUND))
901 {
902 // now continue the move from move_time to time
903 this.velocity = this.tic_velocity;
904
905 if(this.move_didgravity > 0)
906 {
907 this.velocity_z -= (GAMEPLAYFIX_GRAVITYUNAFFECTEDBYTICRATE ? 0.5 : 1)
908 * dt
909 * ((this.gravity) ? this.gravity : 1)
910 * PHYS_GRAVITY(this);
911 }
912
913 this.angles = this.tic_angles + dt * this.avelocity;
914
915 if(sloppy || this.move_movetype == MOVETYPE_NOCLIP)
916 {
917 setorigin(this, this.tic_origin + dt * this.velocity);
918 }
919 else
920 {
921 setorigin(this, this.tic_origin);
922 _Movetype_PushEntityTrace(this, dt * this.velocity);
924 setorigin(this, trace_endpos);
925 else
926 setorigin(this, this.tic_saved_origin);
927 }
928
930 this.velocity_z -= 0.5 * dt * ((this.gravity) ? this.gravity : 1) * PHYS_GRAVITY(this);
931 }
932 else
933 {
934 this.velocity = this.tic_velocity;
935 this.angles = this.tic_angles;
936 setorigin(this, this.tic_origin);
937 }
938
939 this.flags = this.tic_flags;
940
941 this.tic_saved_flags = this.flags;
942 this.tic_saved_velocity = this.velocity;
943 this.tic_saved_origin = this.origin;
944 this.tic_saved_avelocity = this.avelocity;
945 this.tic_saved_angles = this.angles;
946}
vector avelocity
float time
ent angles
Definition ent_cs.qc:121
float bound(float min, float value, float max)
float floor(float f)
vector tic_angles
Definition movetypes.qc:827
int tic_flags
Definition movetypes.qc:825
vector tic_saved_angles
Definition movetypes.qc:834
vector tic_avelocity
Definition movetypes.qc:826
vector tic_origin
Definition movetypes.qc:823
vector tic_saved_origin
Definition movetypes.qc:830
vector tic_saved_avelocity
Definition movetypes.qc:833
void _Movetype_Physics_Frame(entity this, float movedt)
Definition movetypes.qc:698
vector tic_velocity
Definition movetypes.qc:824
void Movetype_Physics_NoMatchServer(entity this)
Definition movetypes.qc:805
int tic_saved_flags
Definition movetypes.qc:832
vector tic_saved_velocity
Definition movetypes.qc:831
const int MOVETYPE_NONE
Definition movetypes.qh:129
float move_time
Definition movetypes.qh:77
const int MOVETYPE_NOCLIP
Definition movetypes.qh:137
const int MOVETYPE_TOSS
Definition movetypes.qh:135
const int MOVETYPE_BOUNCE
Definition movetypes.qh:139

References _Movetype_Physics_Frame(), _Movetype_PushEntityTrace(), angles, avelocity, bound(), entity(), FL_ONGROUND, flags, floor(), GAMEPLAYFIX_GRAVITYUNAFFECTEDBYTICRATE, gravity, move_didgravity, move_movetype, move_time, MOVETYPE_BOUNCE, MOVETYPE_NOCLIP, MOVETYPE_NONE, Movetype_Physics_NoMatchServer(), MOVETYPE_TOSS, origin, PHYS_GRAVITY, tic_angles, tic_avelocity, tic_flags, tic_origin, tic_saved_angles, tic_saved_avelocity, tic_saved_flags, tic_saved_origin, tic_saved_velocity, tic_velocity, time, trace_endpos, trace_startsolid, velocity, and X.

Referenced by Casing_Draw(), Gib_Draw(), Movetype_Physics_MatchServer(), RaptorCBShellfragDraw(), and turret_gib_draw().

◆ Movetype_Physics_NoMatchServer()

void Movetype_Physics_NoMatchServer ( entity this)

Definition at line 805 of file movetypes.qc.

806{
807 float movedt = time - this.move_time;
808 this.move_time = time;
809
810 _Movetype_Physics_Frame(this, movedt);
811 if(wasfreed(this))
812 return;
813
814 setorigin(this, this.origin);
815}

References _Movetype_Physics_Frame(), entity(), move_time, origin, and time.

Referenced by Movetype_Physics_MatchTicrate(), and Projectile_Draw().

◆ Movetype_Physics_NoMatchTicrate()

void Movetype_Physics_NoMatchTicrate ( entity this,
float movedt,
bool isclient )

Definition at line 779 of file movetypes.qc.

780{
781 bool didmove = (this.move_time != 0);
782 this.move_time = time;
783
784 if(isclient)
785 _Movetype_Physics_ClientFrame(this, movedt);
786 else
787 {
788 // this doesn't apply to clients, and only applies to unmatched entities
789 // don't run think/move on newly spawned projectiles as it messes up
790 // movement interpolation and rocket trails, and is inconsistent with
791 // respect to entities spawned in the same frame
792 // (if an ent spawns a higher numbered ent, it moves in the same frame,
793 // but if it spawns a lower numbered ent, it doesn't - this never moves
794 // ents in the first frame regardless)
795 if(!didmove && GAMEPLAYFIX_DELAYPROJECTILES(this) > 0)
796 return;
797 _Movetype_Physics_Frame(this, movedt);
798 }
799 if(wasfreed(this))
800 return;
801
802 setorigin(this, this.origin);
803}
void _Movetype_Physics_ClientFrame(entity this, float movedt)
Definition movetypes.qc:737

References _Movetype_Physics_ClientFrame(), _Movetype_Physics_Frame(), entity(), GAMEPLAYFIX_DELAYPROJECTILES, move_time, origin, and time.

Referenced by CSQCPlayer_Physics(), ItemDraw(), Physics_Frame(), and Player_Physics().

◆ set_movetype()

void set_movetype ( entity this,
int mt )

Definition at line 4 of file movetypes.qc.

5{
6 this.move_movetype = mt;
8 if(!IL_CONTAINS(g_moveables, this))
9 IL_PUSH(g_moveables, this); // add it to the moveable entities list (even if it doesn't move!) logic: if an object never sets its movetype, we assume it never does anything notable
10 this.movetype = (this.move_qcphysics) ? MOVETYPE_QCENTITY : mt;
11}
float movetype
bool move_qcphysics
Definition physics.qh:25
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
ERASEABLE bool IL_CONTAINS(IntrusiveList this, entity it)
const int MOVETYPE_PHYSICS
Definition movetypes.qh:142
const int MOVETYPE_QCENTITY
Definition movetypes.qh:151
bool use_engine_physics
Definition movetypes.qh:7
IntrusiveList g_moveables
Definition world.qh:157

References entity(), g_moveables, IL_CONTAINS(), IL_PUSH(), move_movetype, move_qcphysics, movetype, MOVETYPE_PHYSICS, MOVETYPE_QCENTITY, and use_engine_physics.

Referenced by buff_Init(), buff_Respawn(), bumblebee_exit(), bumblebee_gunner_enter(), bumblebee_gunner_exit(), bumblebee_pilot_frame(), CheatCommand(), CopyBody(), cpicon_construct(), ctf_CaptureShield_Spawn(), ctf_FlagSetup(), ctf_FlagThink(), ctf_Handle_Drop(), ctf_Handle_Pickup(), ctf_Handle_Retrieve(), ctf_Handle_Throw(), ctf_RespawnFlag(), door_spawnfield(), Drag_Begin(), Drag_Finish(), DropBall(), dynlight_find_aiment(), electro_orb_setup(), findtrajectorywithleading(), FireGrapplingHook(), follow_init(), follow_sameorigin(), g_clientmodel_init(), g_model_init(), generator_construct(), GiveBall(), GrapplingHook_Stop(), GrapplingHookThink(), InitBall(), InitMovingBrushTrigger(), InitSolidBSPTrigger(), InitTrigger(), jumppad_push(), ka_DropEvent(), ka_RespawnBall(), ka_SpawnBalls(), ka_TouchEvent(), kh_Key_Attach(), kh_Key_Detach(), LaunchDebris(), M_Golem_Attack_Lightning(), M_Golem_Attack_Lightning_Explode(), M_Mage_Attack_Spike(), M_Spider_Attack_Web(), Monster_Dead(), Monster_Move(), Monster_Spawn(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), nade_darkness_boom(), nade_ice_boom(), nade_napalm_ball(), nade_napalm_boom(), nade_spawn_boom(), NET_HANDLE(), NET_HANDLE(), NET_HANDLE(), ObserverOrSpectatorThink(), ons_CaptureShield_Spawn(), ons_ControlPoint_Setup(), ons_generator_ray_spawn(), ons_GeneratorSetup(), orb_setup(), physical_item_think(), plat_spawn_inside_trigger(), player_clear_minigame(), PlayerDamage(), PutObserverInServer(), PutPlayerInServer(), RaceCarPhysics(), racer_blowup(), racer_exit(), racer_frame(), raptor_blowup(), raptor_bomb_burst(), raptor_bombdrop(), raptor_frame(), raptor_land(), RaptorCBShellfragToss(), RemoveGrapplingHooks(), RemoveHook(), ResetBall(), respawn(), sandbox_ObjectAttach_Set(), sandbox_ObjectPort_Load(), sandbox_ObjectSpawn(), SetMovetypeFollow(), spawn_item_key(), SpawnBall(), spawnfunc(), spawnfunc(), spawnfunc(), spawnfunc(), SpectateSet(), spiderbot_blowup(), spiderbot_exit(), spiderbot_frame(), spiderbot_rocket_do(), StartItem(), SUB_CalcMove_Bezier(), SUB_Stop(), SV_OnEntityPreSpawnFunction(), sys_phys_pregame_hold(), tka_DropEvent(), tka_RespawnBall(), tka_SpawnBalls(), tka_TouchEvent(), toss_nade(), TossGib(), turret_construct(), turret_gibtoss(), turret_hk_missile_think(), turret_initialize(), turret_projectile(), UnsetMovetypeFollow(), vehicle_tossgib(), vehicles_enter(), vehicles_exit(), vehicles_projectile(), vehicles_spawn(), W_Arc_Attack_Bolt(), W_Arc_Beam(), W_Blaster_Think(), W_Crylink_Attack(), W_Crylink_Attack2(), W_Devastator_Attack(), W_Electro_Attack_Bolt(), W_Electro_Attack_Orb(), W_Electro_Orb_ExplodeOverTime(), W_Electro_Orb_Follow_Think(), W_Electro_Orb_Stick(), W_Fireball_Attack1(), W_Fireball_Attack2(), W_Hagar_Attack(), W_Hagar_Attack2(), W_Hagar_Attack2_Load_Release(), W_HLAC_Attack(), W_HLAC_Attack2(), W_Hook_Attack2(), W_Hook_Explode2(), W_MineLayer_Attack(), W_MineLayer_Damage(), W_MineLayer_Stick(), W_MineLayer_Think(), W_Mortar_Attack(), W_Mortar_Attack2(), W_Mortar_Grenade_Touch1(), W_Mortar_Grenade_Touch2(), W_Nexball_Attack2(), W_OverkillRocketPropelledChainsaw_Attack(), W_Porto_Attack(), W_RocketMinsta_Attack(), W_Seeker_Fire_Flac(), W_Seeker_Fire_Missile(), W_Seeker_Fire_Tag(), walker_fire_rocket(), and WarpZoneLib_ExactTrigger_Init().

◆ void()

void ( float ,
float  )

Variable Documentation

◆ aiment

◆ autocvar_physics_ode

bool autocvar_physics_ode

Definition at line 5 of file movetypes.qh.

Referenced by g_clientmodel_init(), g_model_init(), and REGISTER_MUTATOR().

◆ bouncefactor

◆ bouncestop

◆ groundentity

◆ MAX_CLIP_PLANES

const int MAX_CLIP_PLANES = 5

Definition at line 126 of file movetypes.qh.

Referenced by _Movetype_FlyMove().

◆ move_didgravity

◆ move_movetype

◆ move_nomonsters

float move_nomonsters

◆ move_stepnormal

vector move_stepnormal

Definition at line 103 of file movetypes.qh.

Referenced by _Movetype_FlyMove(), and _Movetype_Physics_Walk().

◆ move_suspendedinair

float move_suspendedinair

Definition at line 94 of file movetypes.qh.

Referenced by _Movetype_Physics_Toss(), and DropToFloor_QC().

◆ move_time

◆ MOVEFLAG_GRAVITYUNAFFECTEDBYTICRATE

const int MOVEFLAG_GRAVITYUNAFFECTEDBYTICRATE = BIT(2)

Definition at line 158 of file movetypes.qh.

Referenced by REGISTER_STAT().

◆ MOVEFLAG_NOGRAVITYONGROUND

const int MOVEFLAG_NOGRAVITYONGROUND = BIT(1)

Definition at line 157 of file movetypes.qh.

Referenced by REGISTER_STAT().

◆ MOVEFLAG_Q2AIRACCELERATE

const int MOVEFLAG_Q2AIRACCELERATE = BIT(0)

Definition at line 156 of file movetypes.qh.

Referenced by REGISTER_STAT().

◆ MOVEFLAG_VALID

const int MOVEFLAG_VALID = BIT(23)

Definition at line 155 of file movetypes.qh.

Referenced by REGISTER_STAT().

◆ MOVETYPE_ANGLECLIP

const int MOVETYPE_ANGLECLIP = 2

Definition at line 131 of file movetypes.qh.

◆ MOVETYPE_ANGLENOCLIP

const int MOVETYPE_ANGLENOCLIP = 1

Definition at line 130 of file movetypes.qh.

◆ MOVETYPE_BOUNCE

◆ MOVETYPE_BOUNCEMISSILE

◆ MOVETYPE_FAKEPUSH

const int MOVETYPE_FAKEPUSH = 13

◆ MOVETYPE_FLY

◆ MOVETYPE_FLY_WORLDONLY

◆ MOVETYPE_FLYMISSILE

◆ MOVETYPE_FOLLOW

◆ MOVETYPE_NOCLIP

◆ MOVETYPE_NONE

const int MOVETYPE_NONE = 0

Definition at line 129 of file movetypes.qh.

Referenced by _Movetype_Physics_ClientFrame(), _Movetype_Physics_Frame(), _Movetype_PushMove(), buff_Init(), bumblebee_pilot_frame(), ctf_FlagSetup(), ctf_Handle_Pickup(), ctf_Handle_Retrieve(), ctf_RespawnFlag(), door_spawnfield(), electro_orb_setup(), findtrajectorywithleading(), GiveBall(), GrapplingHook_Stop(), InitSolidBSPTrigger(), InitTrigger(), ka_TouchEvent(), kh_Key_Attach(), M_Golem_Attack_Lightning_Explode(), Movetype_Physics_MatchTicrate(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), nade_spawn_boom(), NET_HANDLE(), ons_ControlPoint_Setup(), ons_generator_ray_spawn(), ons_GeneratorSetup(), orb_setup(), physical_item_think(), Physics_Frame(), plat_spawn_inside_trigger(), Projectile_Draw(), racer_blowup(), racer_frame(), raptor_blowup(), raptor_frame(), ResetBall(), skeleton_from_frames(), spawn_item_key(), spawnfunc(), spawnfunc(), spawnfunc(), SpectateSet(), spiderbot_blowup(), spiderbot_frame(), StartItem(), SUB_CalcMove_Bezier(), SUB_Stop(), sys_phys_pregame_hold(), sys_phys_update(), teleport_findtarget(), tka_TouchEvent(), trigger_push_test(), W_Arc_Beam(), W_Electro_Orb_ExplodeOverTime(), W_Electro_Orb_Stick(), W_Hook_Explode2(), W_MineLayer_DoRemoteExplode(), W_MineLayer_Stick(), W_MineLayer_Think(), W_MineLayer_Touch(), W_Mortar_Grenade_Explode(), W_Mortar_Grenade_Explode2(), W_Mortar_Grenade_Touch1(), W_Mortar_Grenade_Touch2(), WarpZone_Touch(), and WarpZoneLib_ExactTrigger_Init().

◆ MOVETYPE_PHYSICS

◆ MOVETYPE_PUSH

◆ MOVETYPE_QCENTITY

const int MOVETYPE_QCENTITY = 151

Definition at line 151 of file movetypes.qh.

Referenced by Physics_Frame(), and set_movetype().

◆ MOVETYPE_QCPLAYER

const int MOVETYPE_QCPLAYER = 150

Definition at line 150 of file movetypes.qh.

Referenced by Player_Physics().

◆ MOVETYPE_STEP

const int MOVETYPE_STEP = 4

◆ MOVETYPE_TOSS

◆ MOVETYPE_WALK

◆ pm_time

float pm_time

Definition at line 74 of file movetypes.qh.

Referenced by _Movetype_FlyMove(), and _Movetype_Physics_Walk().

◆ punchangle

vector punchangle

Definition at line 91 of file movetypes.qh.

◆ UNSTICK_FINE

const int UNSTICK_FINE = 0

Definition at line 98 of file movetypes.qh.

Referenced by _Movetype_CheckStuck(), and _Movetype_UnstickEntity().

◆ UNSTICK_FIXED

const int UNSTICK_FIXED = 1

Definition at line 99 of file movetypes.qh.

Referenced by _Movetype_CheckStuck(), and _Movetype_UnstickEntity().

◆ UNSTICK_STUCK

const int UNSTICK_STUCK = 2

Definition at line 100 of file movetypes.qh.

Referenced by _Movetype_CheckStuck(), and _Movetype_UnstickEntity().

◆ use_engine_physics

bool use_engine_physics

Definition at line 7 of file movetypes.qh.

Referenced by set_movetype().

◆ WATERLEVEL_NONE

const int WATERLEVEL_NONE = 0

◆ WATERLEVEL_SUBMERGED

const int WATERLEVEL_SUBMERGED = 3

◆ WATERLEVEL_SWIMMING

◆ WATERLEVEL_WETFEET