15 ldrag = lspeed * drag;
17 ldrag = 1 - (ldrag / lspeed);
28 float ldrag = fspeed * drag;
29 ldrag *= ldrag * exp_;
30 ldrag = 1 - (ldrag / fspeed);
44 influense =
bound(newmin,influense,oldmax);
46 return (vel_new * (1 - influense)) + (this.
velocity * influense);
51 return new_vel * new_bias + this.
velocity * (1-new_bias);
62 if (deltatime > 0.15) deltatime = 0;
63 this.movelib_lastupdate =
time;
64 if (!deltatime)
return;
69 acceleration =
vlen(force) / theMass;
71 acceleration =
vlen(force);
81 this.
velocity += force * (acceleration * deltatime);
89 this.
velocity += force * (acceleration * deltatime)
98 if (mspeed > max_velocity)
173 this.velocity_z = vz;
184 vector a, b, c, d, e, r, push_angle, ahead, side;
188 e =
v_up * spring_length;
194 a = r + ahead + side;
195 b = r + ahead - side;
196 c = r - ahead + side;
197 d = r - ahead - side;
218 push_angle.x = (a.z - c.z) * _max;
219 push_angle.x += (b.z - d.z) * _max;
221 push_angle.z = (b.z - a.z) * _max;
222 push_angle.z += (d.z - c.z) * _max;
227 this.angles_x = ((1-blendrate) * this.
angles.x) + (push_angle.x * blendrate);
228 this.angles_z = ((1-blendrate) * this.
angles.z) + (push_angle.z * blendrate);
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
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)