Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
cl_player.qc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2011 Rudolf Polzer
3 * Copyright (c) 2015 Micah Talkiewicz
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a copy
6 * of this software and associated documentation files (the "Software"), to
7 * deal in the Software without restriction, including without limitation the
8 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
9 * sell copies of the Software, and to permit persons to whom the Software is
10 * furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21 * IN THE SOFTWARE.
22 */
23#include "cl_player.qh"
24
25#include "cl_model.qh"
26#include "common.qh"
27#include "interpolate.qh"
28
31
32// engine stuff
33float pmove_onground; // weird engine flag we shouldn't really use but have to for now
34
43
49
55
56void CSQCPlayer_SetPredictionError(vector o, vector v, float onground_diff)
57{
58 // error too big to compensate, we LIKELY hit a teleport or a
59 // jumppad, or it's a jump time disagreement that'll get fixed
60 // next frame
61
62 // FIXME we sometimes have disagreement in order of jump velocity. Do not act on them!
63 /*
64 // commented out as this one did not help
65 if(onground_diff)
66 {
67 printf("ONGROUND MISMATCH: %d x=%v v=%v\n", onground_diff, o, v);
68 return;
69 }
70 */
71 if(vdist(o, >, 32) || vdist(v, >, 192))
72 {
73 //printf("TOO BIG: x=%v v=%v\n", o, v);
74 return;
75 }
76
78 {
80 return;
81 }
82
87}
88
90{
92 if (csqcplayer_status != CSQCPLAYERSTATUS_PREDICTED) LOG_FATALF("Cannot unpredict in current status (%d)", csqcplayer_status);
95 csqcplayer_moveframe = csqcplayer_sequence + 1; // + 1 because the recieved frame has the move already done (server side)
96 this.flags = player_pmflags;
97}
98
100{
101 if (IS_DUCKED(this) || !(this.isplayermodel & ISPLAYER_PLAYER))
102 {
103 this.mins = PHYS_PL_CROUCH_MIN(this);
104 this.maxs = PHYS_PL_CROUCH_MAX(this);
105 this.view_ofs = PHYS_PL_CROUCH_VIEWOFS(this);
106 }
107 else
108 {
109 this.mins = PHYS_PL_MIN(this);
110 this.maxs = PHYS_PL_MAX(this);
111 if(IS_DEAD(this))
112 {
113 float h = ceil((this.mins.z + this.maxs.z) * PL_CORPSE_SCALE * 10) / 10;
114 this.maxs.z = max(h, this.mins.z + 1);
115 }
116 this.view_ofs = PHYS_PL_VIEWOFS(this);
117 }
118}
119
128
130
132{
133 if(!autocvar_cl_movement) { return; }
134
135 //_Movetype_CheckWater(this); // we apparently need to check water *before* physics so it can use this for water jump
136
137 vector oldv_angle = this.v_angle;
138 vector oldangles = this.angles; // we need to save these, as they're abused by other code
139 this.v_angle = PHYS_INPUT_ANGLES(this);
140 this.angles = PHYS_WORLD_ANGLES(this);
141
143
145
146 view_angles = this.v_angle;
147 input_angles = this.angles;
148 this.v_angle = oldv_angle;
149 this.angles = oldangles;
150
151 this.pmove_flags =
152 ((IS_DUCKED(this)) ? PMF_DUCKED : 0) |
153 ((IS_JUMP_HELD(this)) ? PMF_JUMP_HELD : 0) |
154 ((IS_ONGROUND(this)) ? PMF_ONGROUND : 0);
155}
156
157void CSQCPlayer_PredictTo(entity this, float endframe, bool apply_error)
158{
160 if (apply_error)
161 {
164 }
166
168
169#if 0
170 // we don't need this
171 // darkplaces makes servercommandframe == 0 in these cases anyway
172 if (STAT(HEALTH) <= 0)
173 {
175 getinputstate(csqcplayer_moveframe-1);
176 LOG_INFO("the Weird code path got hit");
177 return;
178 }
179#endif
180
181 if (csqcplayer_moveframe >= endframe)
182 {
183 getinputstate(csqcplayer_moveframe - 1);
184 }
185 else
186 {
187 do
188 {
189 if (!getinputstate(csqcplayer_moveframe)) break;
190 /*if (input_timelength > 0.0005)
191 {
192 if (input_timelength > 0.05)
193 {
194 input_timelength /= 2;
195 CSQCPlayer_Physics(this);
196 }
197 CSQCPlayer_Physics(this);
198 }*/
199 CSQCPlayer_Physics(this);
202 }
203 while (csqcplayer_moveframe < endframe);
204 }
205
206 // add in anything that was applied after (for low packet rate protocols)
208}
209
211{
212 return (this == csqcplayer);
213}
214
221{
222 float smoothtime = bound(0, time - smooth_prevtime, 0.1);
223 smooth_prevtime = max(smooth_prevtime, drawtime); // drawtime is the previous frame's time at this point
224
226 stairsmoothz = v.z;
227 else
228 {
229 if(stairsmoothz < v.z)
230 v.z = stairsmoothz = bound(v.z - PHYS_STEPHEIGHT(this), stairsmoothz + smoothtime * autocvar_cl_stairsmoothspeed, v.z);
231 else if(stairsmoothz > v.z)
232 v.z = stairsmoothz = bound(v.z, stairsmoothz - smoothtime * autocvar_cl_stairsmoothspeed, v.z + PHYS_STEPHEIGHT(this));
233 }
234
235 float viewheight = bound(0, (time - smooth_prevtime) / max(0.0001, autocvar_cl_smoothviewheight), 1);
236 viewheightavg = viewheightavg * (1 - viewheight) + this.view_ofs.z * viewheight;
237 v.z += viewheightavg;
238
240
241 return v;
242}
243
244// simplified copy of CSQCPlayer_ApplySmoothing for use on player models
247.float stairsmooth_drawtime; // holds the previous draw time
249{
250 float smoothtime = bound(0, time - this.stairsmooth_prevtime, 0.1);
251 this.stairsmooth_prevtime = max(this.stairsmooth_prevtime, this.stairsmooth_drawtime); // stairsmooth_drawtime is the previous frame's time at this point
252
253 if(this.csqcmodel_teleported || !isonground || autocvar_cl_stairsmoothspeed <= 0 || this.ground_networkentity)
254 this.stairsmooth_offset = v.z;
255 else
256 {
257 if(this.stairsmooth_offset < v.z)
258 v.z = this.stairsmooth_offset = bound(v.z - PHYS_STEPHEIGHT(this), this.stairsmooth_offset + smoothtime * autocvar_cl_stairsmoothspeed, v.z);
259 else if(this.stairsmooth_offset > v.z)
260 v.z = this.stairsmooth_offset = bound(v.z, this.stairsmooth_offset - smoothtime * autocvar_cl_stairsmoothspeed, v.z + PHYS_STEPHEIGHT(this));
261 }
262
265
266 return v;
267}
268
272{
274 return;
275 // incompatible with cl_eventchase_death 2 because tilting is applied while the corpse is
276 // in the air and immediately turned off when it touches the ground
278 return;
280}
281
290{
292 return;
296 //setproperty(VF_CL_VIEWANGLES, view_angles); // update view angles as well so we can aim
297}
298
315{
316 if(this.csqcmodel_isdead || PHYS_INVEHICLE(this) || !(this.isplayermodel & ISPLAYER_PLAYER))
317 return v;
318
319 // bounded XY speed, used by several effects below
320 float bob, cycle;
321
322 // vertical view bobbing code
324 {
325 float bob_limit = autocvar_cl_bob_limit;
326
328 {
329 // use traces to determine what range the view can bob in, and scale down the bob as needed
330 vector bob_height_check_dest = v;
331 bob_height_check_dest.z += autocvar_cl_bob_limit * 1.1;
332 traceline(v, bob_height_check_dest, MOVE_NOMONSTERS, NULL);
333 float trace1fraction = trace_fraction;
334
335 bob_height_check_dest = v;
336 bob_height_check_dest.z += autocvar_cl_bob_limit * -0.5;
337 traceline(v, bob_height_check_dest, MOVE_NOMONSTERS, NULL);
338 float trace2fraction = trace_fraction;
339
340 bob_limit *= min(trace1fraction, trace2fraction);
341 }
342
343 // LordHavoc: figured out bobup: the time at which the sin is at 180
344 // degrees (which allows lengthening or squishing the peak or valley)
345 cycle = time / autocvar_cl_bobcycle;
346 cycle -= rint(cycle);
347 if(cycle < autocvar_cl_bobup)
348 cycle = sin(M_PI * cycle / autocvar_cl_bobup);
349 else
350 cycle = sin(M_PI + M_PI * (cycle - autocvar_cl_bobup) / (1.0 - autocvar_cl_bobup));
351 // bob is proportional to velocity in the xy plane
352 // (don't count Z, or jumping messes it up)
353 float xyspeed = bound(0, sqrt(this.velocity.x * this.velocity.x + this.velocity.y * this.velocity.y), autocvar_cl_bob_velocity_limit);
354 bob = xyspeed * autocvar_cl_bob;
355 bob = bound(0, bob, bob_limit);
356 bob = bob * 0.3 + bob * 0.7 * cycle;
357 v.z += bob;
358 }
359
360 // horizontal view bobbing code
362 {
363 cycle = time / autocvar_cl_bob2cycle;
364 cycle -= rint(cycle);
365 if(cycle < 0.5)
366 cycle = cos(M_PI * cycle / 0.5); // cos looks better here with the other view bobbing using sin
367 else
368 cycle = cos(M_PI + M_PI * (cycle - 0.5) / 0.5);
369 bob = autocvar_cl_bob2 * cycle;
370
371 // this value slowly decreases from 1 to 0 when we stop touching the ground.
372 // The cycle is later multiplied with it so the view smooths back to normal
373 if(IS_ONGROUND(this) && !(input_buttons & BIT(1))) // also block the effect while the jump button is pressed, to avoid twitches when bunny-hopping
374 bob2_smooth = 1;
375 else
376 {
377 if(bob2_smooth > 0)
379 else
380 bob2_smooth = 0;
381 }
382
383 // calculate the front and side of the player between the X and Y axes
385 // now get the speed based on those angles. The bounds should match the same value as xyspeed's
388 v_forward = v_forward * bob;
389 v_right = v_right * bob;
390 // we use side with forward and front with right, so the bobbing goes
391 // to the side when we walk forward and to the front when we strafe
392 vector bob2vel;
393 bob2vel.x = side * v_forward.x + front * v_right.x + 0 * v_up.x;
394 bob2vel.y = side * v_forward.y + front * v_right.y + 0 * v_up.y;
395 bob2vel.z = side * v_forward.z + front * v_right.z + 0 * v_up.z;
396 v.x += bob2vel.x;
397 v.y += bob2vel.y;
398 }
399
400 // fall bobbing code
401 // causes the view to swing down and back up when touching the ground
403 {
404 if(!IS_ONGROUND(this))
405 {
406 bobfall_speed = bound(-400, this.velocity.z, 0) * bound(0, autocvar_cl_bobfall, 0.1);
408 bobfall_swing = 1;
409 else
410 bobfall_swing = 0; // really?
411 }
412 else
413 {
415 float bobfall = sin(M_PI * bobfall_swing) * bobfall_speed;
416 v.z += bobfall;
417 }
418 }
419
420 return v;
421}
422
426{
427 if (!autocvar_cl_rollangle) return 0;
428
430 float side = (this.velocity * v_right);
431 float sign = (side < 0) ? -1 : 1;
432 side = fabs(side);
433
434 if(side < autocvar_cl_rollspeed)
436 else
438
439 return side * sign;
440}
441
447{
448 vector forward;
449 vector chase_dest;
450
452 {
453 view_angles.x = 0;
455 forward = v_forward;
456 vector up = v_up;
457 // trace a little further so it hits a surface more consistently (to avoid 'snapping' on the edge of the range)
458 chase_dest.x = v.x - forward.x * autocvar_chase_back + up.x * autocvar_chase_up;
459 chase_dest.y = v.y - forward.y * autocvar_chase_back + up.y * autocvar_chase_up;
460 chase_dest.z = v.z - forward.z * autocvar_chase_back + up.z * autocvar_chase_up;
461
462 // trace from first person view location to our chosen third person view location
463 traceline(v, chase_dest, MOVE_NOMONSTERS, NULL);
464
465 vector bestvieworg = trace_endpos;
466 vector offset = '0 0 0';
467 for(offset.x = -16; offset.x <= 16; offset.x += 8)
468 {
469 for(offset.y = -16; offset.y <= 16; offset.y += 8)
470 {
472 up = v_up;
473 chase_dest.x = v.x - forward.x * autocvar_chase_back + up.x * autocvar_chase_up + offset.x;
474 chase_dest.y = v.y - forward.y * autocvar_chase_back + up.y * autocvar_chase_up + offset.y;
475 chase_dest.z = v.z - forward.z * autocvar_chase_back + up.z * autocvar_chase_up + offset.z;
476 traceline(v, chase_dest, MOVE_NOMONSTERS, NULL);
477 if(bestvieworg.z > trace_endpos.z)
478 bestvieworg.z = trace_endpos.z;
479 }
480 }
481 bestvieworg.z -= 8;
482 v = bestvieworg;
483
485 //setproperty(VF_CL_VIEWANGLES, view_angles); // update view angles as well so we can aim
486 }
487 else
488 {
490 forward = v_forward;
492 forward = normalize(forward * -1);
493 // trace a little further so it hits a surface more consistently (to avoid 'snapping' on the edge of the range)
494 float cdist = -autocvar_chase_back - 8;
495 chase_dest.x = v.x + forward.x * cdist;
496 chase_dest.y = v.y + forward.y * cdist;
497 chase_dest.z = v.z + forward.z * cdist + autocvar_chase_up;
498 if (this.move_movetype == MOVETYPE_NOCLIP)
499 {
500 // as if traceline hasn't hit anything
501 trace_endpos = chase_dest;
502 trace_plane_normal = '0 0 0';
503 }
504 else
505 {
506 traceline(v, chase_dest, MOVE_NOMONSTERS, NULL);
507 }
508 v.x = 1 * trace_endpos.x + 8 * forward.x + 4 * trace_plane_normal.x;
509 v.y = 1 * trace_endpos.y + 8 * forward.y + 4 * trace_plane_normal.y;
510 v.z = 1 * trace_endpos.z + 8 * forward.z + 4 * trace_plane_normal.z;
511
513 {
514 // now flip the view so the player is looking at themselves
515 vector newang = vectoangles(forward);
516 view_angles.x = view_angles.x * -1; // inverse up-down looking direction
517 view_angles.y = newang.y;
518 }
519 }
520
521#if 0
522 tracebox(v, '-4 -4 -4', '4 4 4', v - v_forward * autocvar_chase_back, MOVE_NORMAL, this);
523 v = trace_endpos;
524 tracebox(v, '-4 -4 -4', '4 4 4', v + v_up * autocvar_chase_up, MOVE_NORMAL, this);
525 v = trace_endpos;
526#endif
527 return v;
528}
529
531{
533 {
534 int refdefflags = 0;
535 if (this.csqcmodel_teleported) refdefflags |= REFDEFFLAG_TELEPORTED;
536 if (input_buttons & BIT(1)) refdefflags |= REFDEFFLAG_JUMPING;
537 // note: these two only work in WIP2, but are harmless in WIP1
538 if (PHYS_HEALTH(NULL) <= 0 && PHYS_HEALTH(NULL) != -666 && PHYS_HEALTH(NULL) != -2342) refdefflags |= REFDEFFLAG_DEAD;
539 if (intermission) refdefflags |= REFDEFFLAG_INTERMISSION;
540 V_CalcRefdef(this, refdefflags); // TODO? uses .health stat in the engine when this isn't called here, may be broken!
541 return;
542 }
543
544 vector vieworg = this.origin;
545 if(intermission)
546 {
547 // just update view offset, don't need to do anything else
548 vieworg.z += this.view_ofs.z;
549 }
550 else
551 {
552 vieworg = CSQCPlayer_ApplySmoothing(this, vieworg);
554 vieworg = CSQCPlayer_ApplyChase(this, vieworg);
555 else
556 {
557 // angles
561 // TODO? we don't have damage time accessible here
562 // origin
563 vieworg = vieworg + view_punchvector;
564 vieworg = CSQCPlayer_ApplyBobbing(this, vieworg);
565 }
567 }
568 setproperty(VF_ORIGIN, vieworg);
569 setproperty(VF_ANGLES, view_angles);
570}
571
574{
575 vector v0 = ((intermission && !autocvar_cl_movement_intermissionrunning) ? '0 0 0' : pmove_vel); // TRICK: pmove_vel is set by the engine when we get here. No need to network velocity
576 float vh = PHYS_VIEWHEIGHT(NULL);
577 vector pl_viewofs = PHYS_PL_VIEWOFS(NULL);
578 vector pl_viewofs_crouch = PHYS_PL_CROUCH_VIEWOFS(NULL);
579 entity e = csqcplayer;
580 if (e)
581 {
582 if (servercommandframe == 0 || clientcommandframe == 0)
583 {
585 e.view_ofs = '0 0 1' * vh;
586
587 // get crouch state from the server
588 if (vh == pl_viewofs.z) e.flags &= ~FL_DUCKED;
589 else if (vh == pl_viewofs_crouch.z) e.flags |= FL_DUCKED;
590
591 // get onground state from the server
592 e.flags = BITSET(e.flags, FL_ONGROUND, pmove_onground);
593
595
596 // override it back just in case
597 e.view_ofs = '0 0 1' * vh;
598
599 // set velocity
600 e.velocity = v0;
601 }
602 else
603 {
604 int flg = e.iflags; e.iflags &= ~(IFLAG_ORIGIN | IFLAG_ANGLES);
606 e.iflags = flg;
607
609 {
610 vector o = e.origin;
613 CSQCPlayer_SetPredictionError(e.origin - o, e.velocity - v0, pmove_onground - IS_ONGROUND(e));
614 e.origin = o;
615 e.velocity = v0;
616
617 // get crouch state from the server
618 if (vh == pl_viewofs.z) e.flags &= ~FL_DUCKED;
619 else if(vh == pl_viewofs_crouch.z) e.flags |= FL_DUCKED;
620
621 // get onground state from the server
622 e.flags = BITSET(e.flags, FL_ONGROUND, pmove_onground);
623
625 }
627
628#ifdef CSQCMODEL_SERVERSIDE_CROUCH
629 // get crouch state from the server (LAG)
630 if (vh == pl_viewofs.z) e.flags &= ~FL_DUCKED;
631 else if (vh == pl_viewofs_crouch.z) e.flags |= FL_DUCKED;
632#endif
634
635 if (!IS_DEAD(e))
636 e.angles.y = input_angles.y;
637 }
638
639 // relink
640 e.stairsmooth_drawtime = drawtime; // since drawtime is a frame old at this point, copy it now to avoid using a drawtime 2 frames old!
641 e.origin = CSQCModel_ApplyStairSmoothing(e, (e.pmove_flags & PMF_ONGROUND), e.origin);
642 setorigin(e, e.origin);
643 }
644
646 if (view)
647 {
648 if (view != csqcplayer)
649 {
651 view.view_ofs = '0 0 1' * vh;
652 }
654 }
655 else
656 {
657 // FIXME by CSQC spec we have to do this:
658 // but it breaks chase cam
659 /*
660 setproperty(VF_ORIGIN, pmove_org + '0 0 1' * vh);
661 setproperty(VF_ANGLES, view_angles);
662 */
663 }
665}
666
668{
670 cvar_settemp("cl_movement_replay", "1");
671}
672
674{
675 if (this != csqcplayer) return false;
677 return true;
678}
679
681{
682 if (this.entnum != player_localnum + 1) return false;
683 csqcplayer = this;
685 if (cvar("cl_movement_replay"))
686 cvar_settemp("cl_movement_replay", "0");
687 this.entremove = CSQCPlayer_Remove;
688 return true;
689}
#define BIT(n)
Only ever assign into the first 24 bits in QC (so max is BIT(23)).
Definition bits.qh:8
#define BITSET(var, mask, flag)
Definition bits.qh:11
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
float csqcmodel_teleported
Definition cl_model.qh:39
float autocvar_cl_bob_limit
Definition cl_player.qc:301
float autocvar_v_idlescale
Definition cl_player.qc:282
float autocvar_cl_smoothviewheight
Definition cl_player.qc:217
void CSQCPlayer_SetCamera()
Called once per CSQC_UpdateView()
Definition cl_player.qc:573
float autocvar_v_ipitch_cycle
Definition cl_player.qc:283
float autocvar_cl_movement_errorcompensation
Definition cl_player.qc:29
vector csqcplayer_predictionerrorv
Definition cl_player.qc:40
vector CSQCPlayer_ApplySmoothing(entity this, vector v)
Definition cl_player.qc:220
float csqcplayer_sequence
Definition cl_player.qc:36
float stairsmooth_prevtime
Definition cl_player.qc:246
vector CSQCPlayer_GetPredictionErrorO()
Definition cl_player.qc:44
float pmove_onground
Definition cl_player.qc:33
vector csqcplayer_origin
Definition cl_player.qc:35
vector csqcplayer_predictionerroro
Definition cl_player.qc:39
float autocvar_cl_bobcycle
Definition cl_player.qc:300
float autocvar_cl_stairsmoothspeed
Definition cl_player.qc:216
float autocvar_cl_bob2smooth
Definition cl_player.qc:310
float autocvar_cl_bob_limit_heightcheck
Definition cl_player.qc:302
float autocvar_cl_bob2cycle
Definition cl_player.qc:309
void CSQCPlayer_SetPredictionError(vector o, vector v, float onground_diff)
Definition cl_player.qc:56
float autocvar_cl_bobup
Definition cl_player.qc:304
float CSQCPlayer_CalcRoll(entity this)
Definition cl_player.qc:425
float autocvar_v_ipitch_level
Definition cl_player.qc:286
float autocvar_cl_rollangle
Definition cl_player.qc:423
float autocvar_v_deathtiltangle
Definition cl_player.qc:270
float autocvar_v_iyaw_level
Definition cl_player.qc:287
bool autocvar_cl_movement_intermissionrunning
Definition cl_player.qc:30
void CSQCPlayer_Physics(entity this)
Definition cl_player.qc:131
float bobfall_speed
Definition cl_player.qc:312
float autocvar_cl_bobfall
Definition cl_player.qc:305
float autocvar_cl_bob
Definition cl_player.qc:299
float stairsmooth_drawtime
Definition cl_player.qc:247
vector CSQCModel_ApplyStairSmoothing(entity this, bool isonground, vector v)
Definition cl_player.qc:248
void CSQCPlayer_ApplyIdleScaling(entity this)
Definition cl_player.qc:289
float autocvar_v_iyaw_cycle
Definition cl_player.qc:284
float autocvar_v_iroll_cycle
Definition cl_player.qc:285
void CSQCPlayer_CalcRefdef(entity this)
Definition cl_player.qc:530
int player_pmflags
Definition cl_player.qc:37
float autocvar_cl_rollspeed
Definition cl_player.qc:424
float csqcplayer_moveframe
Definition cl_player.qc:38
float bobfall_swing
Definition cl_player.qc:311
float autocvar_chase_pitchangle
Definition cl_player.qc:445
float autocvar_chase_back
Definition cl_player.qc:442
float stairsmooth_offset
Definition cl_player.qc:245
void CSQCPlayer_Unpredict(entity this)
Definition cl_player.qc:89
bool CSQCPlayer_PreUpdate(entity this)
Definition cl_player.qc:673
vector csqcplayer_velocity
Definition cl_player.qc:35
float autocvar_cl_bob2
Definition cl_player.qc:308
vector CSQCPlayer_ApplyChase(entity this, vector v)
Definition cl_player.qc:446
float bob2_smooth
Definition cl_player.qc:313
float stairsmoothz
Definition cl_player.qc:215
void CSQCPlayer_PredictTo(entity this, float endframe, bool apply_error)
Definition cl_player.qc:157
bool autocvar_v_deathtilt
Definition cl_player.qc:269
float autocvar_cl_bobfallcycle
Definition cl_player.qc:306
void CSQCPlayer_SavePrediction(entity this)
Definition cl_player.qc:120
bool CSQCPlayer_PostUpdate(entity this)
Definition cl_player.qc:680
bool CSQCPlayer_IsLocalPlayer(entity this)
Definition cl_player.qc:210
bool autocvar_chase_overhead
Definition cl_player.qc:444
vector CSQCPlayer_ApplyBobbing(entity this, vector v)
Definition cl_player.qc:314
float autocvar_cl_bob_velocity_limit
Definition cl_player.qc:303
float autocvar_chase_up
Definition cl_player.qc:443
vector CSQCPlayer_GetPredictionErrorV()
Definition cl_player.qc:50
void CSQC_ClientMovement_PlayerMove_Frame(entity this)
float csqcplayer_predictionerrorfactor
Definition cl_player.qc:42
void CSQCPlayer_SetMinsMaxs(entity this)
Definition cl_player.qc:99
void CSQCPlayer_Remove(entity this)
Definition cl_player.qc:667
float csqcplayer_predictionerrortime
Definition cl_player.qc:41
float autocvar_v_iroll_level
Definition cl_player.qc:288
float viewheightavg
Definition cl_player.qc:219
void CSQCPlayer_ApplyDeathTilt(entity this)
Definition cl_player.qc:271
float smooth_prevtime
Definition cl_player.qc:218
float autocvar_cl_bobfallminspeed
Definition cl_player.qc:307
const int CSQCPLAYERSTATUS_UNPREDICTED
Definition cl_player.qh:28
bool use_engine_refdef
Definition cl_player.qh:32
const int PMF_JUMP_HELD
Definition cl_player.qh:36
entity csqcplayer
Definition cl_player.qh:26
const int CSQCPLAYERSTATUS_PREDICTED
Definition cl_player.qh:30
bool autocvar_cl_movement
Definition cl_player.qh:24
int pmove_flags
Definition cl_player.qh:35
const int CSQCPLAYERSTATUS_FROMSERVER
Definition cl_player.qh:29
float csqcplayer_status
Definition cl_player.qh:27
int spectatee_status
the -1 disables HUD panels before CSQC receives necessary data
Definition main.qh:197
float ticrate
Definition main.qh:209
#define PHYS_PL_CROUCH_VIEWOFS(s)
Definition player.qh:89
#define PHYS_INPUT_TIMELENGTH
Definition player.qh:254
#define IS_DEAD(s)
Definition player.qh:245
#define PHYS_WORLD_ANGLES(s)
Definition player.qh:252
#define PHYS_PL_VIEWOFS(s)
Definition player.qh:88
#define PHYS_PL_CROUCH_MAX(s)
Definition player.qh:85
vector v_angle
Definition player.qh:237
#define PHYS_INVEHICLE(s)
Definition player.qh:280
#define PHYS_PL_MIN(s)
Definition player.qh:84
#define PHYS_INPUT_ANGLES(s)
Definition player.qh:250
#define PHYS_PL_CROUCH_MIN(s)
Definition player.qh:86
#define IS_JUMP_HELD(s)
Definition player.qh:203
#define IS_DUCKED(s)
Definition player.qh:210
#define PHYS_VIEWHEIGHT(s)
Definition player.qh:91
#define PHYS_PL_MAX(s)
Definition player.qh:83
#define PHYS_HEALTH(s)
Definition player.qh:92
float cvar_settemp(string tmp_cvar, string tmp_value)
Definition util.qc:811
const float PL_CORPSE_SCALE
Definition constants.qh:60
const int FL_ONGROUND
Definition constants.qh:78
const int FL_DUCKED
Definition constants.qh:89
vector v_up
float clientcommandframe
float REFDEFFLAG_JUMPING
float flags
const float MOVE_NOMONSTERS
float REFDEFFLAG_DEAD
vector pmove_vel
vector input_angles
float PMF_DUCKED
const float VF_ORIGIN
float frametime
vector view_punchangle
float player_localnum
const float MOVE_NORMAL
vector mins
vector velocity
vector view_angles
float time
vector v_right
vector trace_endpos
vector maxs
float input_buttons
float REFDEFFLAG_INTERMISSION
float REFDEFFLAG_TELEPORTED
const float VF_ANGLES
float player_localentnum
float intermission
vector v_forward
float entnum
vector origin
float PMF_ONGROUND
float trace_fraction
float servercommandframe
vector view_punchvector
vector trace_plane_normal
float death_time
bool csqcmodel_isdead
int isplayermodel
float ground_networkentity
#define CSQCPLAYER_HOOK_POSTCAMERASETUP()
ent angles
Definition ent_cs.qc:121
entity CSQCModel_server2csqc(int i)
Definition cl_model.qc:314
void InterpolateOrigin_Do(entity this)
set origin based on iorigin1 (old pos), iorigin2 (desired pos), and time
const int IFLAG_ANGLES
const int IFLAG_ORIGIN
const int ISPLAYER_PLAYER
Definition common.qh:59
#define STAT(...)
Definition stats.qh:82
#define LOG_FATALF(...)
Definition log.qh:54
#define LOG_INFO(...)
Definition log.qh:65
#define M_PI
Definition mathlib.qh:108
float ceil(float f)
float bound(float min, float value, float max)
float cvar(string name)
float cos(float f)
vector vectoangles(vector v)
float sqrt(float f)
float sin(float f)
float min(float f,...)
float rint(float f)
vector normalize(vector v)
float fabs(float f)
float max(float f,...)
void Movetype_Physics_NoMatchTicrate(entity this, float movedt, bool isclient)
Definition movetypes.qc:779
#define PHYS_STEPHEIGHT(s)
Definition movetypes.qh:38
float move_movetype
Definition movetypes.qh:76
const int MOVETYPE_NOCLIP
Definition movetypes.qh:137
#define IS_ONGROUND(s)
Definition movetypes.qh:16
#define NULL
Definition post.qh:14
#define makevectors
Definition post.qh:21
vector view_ofs
Definition progsdefs.qc:151
vector
Definition self.qh:92
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt()
Definition vector.qh:8
int autocvar_chase_active
Definition view.qh:17
bool autocvar_chase_front
Definition view.qh:18
int autocvar_cl_eventchase_death
Definition view.qh:88
float drawtime
Definition view.qh:119