10 vector movelib_dragvec(
entity this,
float drag,
float exp_)
15 ldrag = lspeed * drag;
16 ldrag = ldrag * (drag * exp_);
17 ldrag = 1 - (ldrag / lspeed);
26 float movelib_dragflt(
float fspeed,
float drag,
float exp_)
30 ldrag = fspeed * drag;
31 ldrag = ldrag * ldrag * exp_;
32 ldrag = 1 - (ldrag / fspeed);
42 vector movelib_inertmove_byspeed(
entity this,
vector vel_new,
float vel_max,
float newmin,
float oldmax)
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);
58 void movelib_move(
entity this,
vector force,
float max_velocity,
float drag,
float theMass,
float breakforce)
65 deltatime =
time - this.movelib_lastupdate;
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);
89 this.
velocity = movelib_dragvec(
this, drag, 1);
94 this.
velocity = this.velocity +
'0 0 0.05' * autocvar_sv_gravity * deltatime;
102 if (mspeed > max_velocity)
166 void movelib_brake_simple(
entity this,
float force)
176 this.velocity_z = vz;
187 vector a, b, c, d, e, r, push_angle, ahead, side;
191 e =
v_up * spring_length;
197 a = r + ahead + side;
198 b = r + ahead - side;
199 c = r - ahead + side;
200 d = r - ahead - side;
222 push_angle.x = (a.z - c.z) * _max;
223 push_angle.x += (b.z - d.z) * _max;
225 push_angle.z = (b.z - a.z) * _max;
226 push_angle.z += (d.z - c.z) * _max;
231 this.angles_x = ((1-blendrate) * this.
angles.x) + (push_angle.x * blendrate);
232 this.angles_z = ((1-blendrate) * this.
angles.z) + (push_angle.z * blendrate);
void movelib_groundalign4point(entity this, float spring_length, float spring_up, float blendrate, float _max)
vector(float skel, float bonenum) _skel_get_boneabs_hidden