25 PHYS_CS(
this).movement_old = PHYS_CS(
this).movement;
26 PHYS_CS(
this).v_angle_old = this.
v_angle;
50 float maxspeed_mod = 1;
58 maxspeed_mod = STAT(SPECTATORSPEED,
this);
65 int cont = pointcontents(midpoint);
91 this.velocity_x = this.
movedir.x;
92 this.velocity_y = this.
movedir.y;
94 this.
flags &= ~FL_WATERJUMP;
121 if (PHYS_ENTGRAVITY(
this)) { this.
com_phys_gravity *= PHYS_ENTGRAVITY(
this); }
128 }
else if (
ITEMS_STAT(
this) & IT_USING_JETPACK) {
132 emit(phys_land,
this);
139 if (PHYS_ENTGRAVITY(
this)) { this.
com_phys_gravity *= PHYS_ENTGRAVITY(
this); }
186 this.velocity_z += grav / 2;
188 this.velocity_z += grav / 2;
197 vector forward, right, up;
198 MAKE_VECTORS(yawangles, forward, right, up);
207 this.velocity_z = 310;
215 vector forward, right, up;
218 vector wishvel = forward * PHYS_CS(
this).movement.x
219 + right * PHYS_CS(
this).movement.y
236 }
else if (wishvel ==
'0 0 0') {
243 wishvel.z = PHYS_CS(
this).movement_old.x;
246 float f =
vlen(wishvel);
253 if ((this.origin_z + this.view_ofs_z) < f) {
255 }
else if ((this.origin_z + (this.mins_z + this.maxs_z) * 0.5) < f) {
257 }
else if ((this.origin_z + this.mins_z + 1) < f) {
273 float wishspeed0 = wishspeed;
275 wishspeed =
min(wishspeed, maxairspd);
281 float accelerating = (this.
velocity * wishdir > 0);
282 float wishspeed2 = wishspeed;
318 PM_Accelerate(
this, dt, wishdir, wishspeed, wishspeed0, airaccel, airaccelqw,
338 f = wishspeed - this.
velocity * wishdir;
341 this.
velocity += accelspeed * wishdir;
351 this.velocity_z = 200;
358 const float addspeed = wishspeed - this.
velocity * wishdir;
361 this.
velocity += accelspeed * wishdir;
380 f = 1 - dt * realfriction
407 const float addspeed = wishspeed - this.
velocity * wishdir;
410 this.
velocity += accelspeed * wishdir;
440 for (
int i = 0; i < MAX_CLIP_PLANES && movetime > 0; i++) {
441 vector push = vel * movetime;
454 if (gettouch(it) &&
boxesoverlap(it.absmin, it.absmax,
this.absmin,
this.absmax)) {
456 trace_allsolid = false;
457 trace_startsolid = false;
459 trace_inwater = false;
461 trace_endpos = it.origin;
462 trace_plane_normal =
'0 0 1';
463 trace_plane_dist = 0;
465 trace_dpstartcontents = 0;
466 trace_dphitcontents = 0;
467 trace_dphitq3surfaceflags = 0;
468 trace_dphittexturename = string_null;
469 gettouch(it)(this, it);
482 if (
this && ent && touched2 && ent.solid !=
SOLID_NOT) {
496 if (wasfreed(
this)) {
return; }
#define PHYS_INPUT_BUTTON_CROUCH(s)
void CheckPlayerJump(entity this)
#define PHYS_MAXAIRSPEED(s)
#define PHYS_FRICTION_SLICK(s)
void CPM_PM_Aircontrol(entity this, float dt, vector wishdir, float wishspeed)
const int WATERLEVEL_SUBMERGED
float trace_dphitq3surfaceflags
#define PHYS_ACCELERATE(s)
bool sys_phys_override(entity this, float dt)
void sys_phys_simulate(entity this, float dt)
for players
void PM_check_slick(entity this)
void PM_Accelerate(entity this, float dt, vector wishdir, float wishspeed, float wishspeed0, float accel, float accelqw, float stretchfactor, float sidefric, float speedlimit)
void PM_check_hitground(entity this)
void sys_phys_postupdate(entity this)
float com_phys_acc_rate_air_strafe
float trace_dphitcontents
float com_phys_acc_rate_air
#define PHYS_AIRSTRAFEACCEL_QW(s)
#define PHYS_STOPSPEED(s)
#define PHYS_INPUT_BUTTON_MASK(s)
void sys_phys_fixspeed(entity this, float maxspeed_mod)
#define PHYS_AIRACCEL_SIDEWAYS_FRICTION(s)
float com_phys_gravity_factor
float IsMoveInDirection(vector mv, float ang)
float com_phys_acc_rate_air_stop
#define ClipVelocity(in, normal, out, overbounce)
#define PHYS_SLICK_APPLYGRAVITY(s)
#define UNSET_ONGROUND(s)
float com_phys_vel_max_air
void sys_phys_simulate_simple(entity this, float dt)
for other entities
const int WATERLEVEL_NONE
void PM_AirAccelerate(entity this, float dt, vector wishdir, float wishspeed)
void viewloc_PlayerPhysics(entity this)
float com_phys_vel_max_air_strafe
string trace_dphittexturename
#define PHYS_AIRSTOPACCELERATE(s)
const float CONTENT_EMPTY
const float MOVE_NOMONSTERS
spree_inf s1 s2 s3loc s2 spree_inf s1 s2 s3loc s2 spree_inf s1 s2 s3loc s2 s1 s2loc s1 s2loc s1 s2loc s1 s2loc s1 s2loc s1 s2loc s1 s2loc s1 s2 f1 f1points f2
#define PHYS_WARSOWBUNNY_TURNACCEL(s)
void PM_Footsteps(entity this)
const float CONTENT_SLIME
float GeomLerp(float a, float _lerp, float b)
ERASEABLE float boxesoverlap(vector m1, vector m2, vector m3, vector m4)
requires that m2>m1 in all coordinates, and that m4>m3
const float CONTENT_WATER
void PM_check_frozen(entity this)
#define PHYS_AIRACCELERATE(s)
float MOVETYPE_FLY_WORLDONLY
void sys_phys_update(entity this, float dt)
float trace_dpstartcontents
void sys_phys_ai(entity this)
void PM_jetpack(entity this, float maxspd_mod, float dt)
void PM_check_blocked(entity this)
const int WATERLEVEL_WETFEET
void sys_phys_pregame_hold(entity this)
bool IsFlying(entity this)
#define PHYS_AIRACCEL_QW_STRETCHFACTOR(s)
vector(float skel, float bonenum) _skel_get_boneabs_hidden
#define PHYS_AIRACCEL_QW(s)
#define PHYS_AIRCONTROL(s)
const float SOLID_TRIGGER
const int WATERLEVEL_SWIMMING
#define MUTATOR_CALLHOOK(id,...)
#define PHYS_MAXAIRSTRAFESPEED(s)
#define PHYS_AIRSPEEDLIMIT_NONQW(s)
vector trace_plane_normal
void sys_phys_fix(entity this, float dt)
#define PHYS_AIRSTRAFEACCELERATE(s)
void sys_phys_monitor(entity this, float dt)
int disableclientprediction
void sys_phys_update_single(entity this)
bool com_phys_friction_air
#define PHYS_FRICTION_ONLAND(s)
void sys_phys_spectator_control(entity this)