15 ldrag = lspeed * drag;
16 ldrag = ldrag * (drag * exp_);
17 ldrag = 1 - (ldrag / lspeed);
30 ldrag = fspeed * drag;
31 ldrag = ldrag * ldrag * exp_;
32 ldrag = 1 - (ldrag / fspeed);
48 influense =
bound(newmin,influense,oldmax);
50 return (vel_new * (1 - influense)) + (this.
velocity * influense);
55 return new_vel * new_bias + this.
velocity * (1-new_bias);
66 if (deltatime > 0.15) deltatime = 0;
67 this.movelib_lastupdate =
time;
68 if (!deltatime)
return;
73 acceleration =
vlen(force) / theMass;
75 acceleration =
vlen(force);
102 if (mspeed > max_velocity)
177 this.velocity_z = vz;
188 vector a, b, c, d, e, r, push_angle, ahead, side;
192 e =
v_up * spring_length;
198 a = r + ahead + side;
199 b = r + ahead - side;
200 c = r - ahead + side;
201 d = r - ahead - side;
223 push_angle.x = (a.z - c.z) * _max;
224 push_angle.x += (b.z - d.z) * _max;
226 push_angle.z = (b.z - a.z) * _max;
227 push_angle.z += (d.z - c.z) * _max;
232 this.angles_x = ((1-blendrate) * this.
angles.x) + (push_angle.x * blendrate);
233 this.angles_z = ((1-blendrate) * this.
angles.z) + (push_angle.z * blendrate);
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
#define autocvar_sv_gravity
vector movelib_dragvec(entity this, float drag, float exp_)
Simulate drag this.velocity = movelib_dragvec(this.velocity,0.02,0.5);.
void movelib_groundalign4point(entity this, float spring_length, float spring_up, float blendrate, float _max)
Pitches and rolls the entity to match the gound.
void movelib_brake_simple(entity this, float force)
float movelib_dragflt(float fspeed, float drag, float exp_)
Simulate drag this.velocity *= movelib_dragflt(somespeed,0.01,0.7);.
vector movelib_inertmove_byspeed(entity this, vector vel_new, float vel_max, float newmin, float oldmax)
Do a inertia simulation based on velocity.
void movelib_move(entity this, vector force, float max_velocity, float drag, float theMass, float breakforce)
vector movelib_inertmove(entity this, vector new_vel, float new_bias)