X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fcommon%2Fphysics%2Fmovelib.qh;h=250c3ba2b28e121d7e4568a4a87baf134d5ac45b;hp=26b7033ff37a16ea109e422a020f8dac0377fa84;hb=7666560c6a475aefe6b55ff74a20444f328e0093;hpb=f41d9f31538bef0259d2b2c74536bb977901f99d diff --git a/qcsrc/common/physics/movelib.qh b/qcsrc/common/physics/movelib.qh index 26b7033ff3..250c3ba2b2 100644 --- a/qcsrc/common/physics/movelib.qh +++ b/qcsrc/common/physics/movelib.qh @@ -6,41 +6,41 @@ /** Simulate drag - self.velocity = movelib_dragvec(self.velocity,0.02,0.5); + this.velocity = movelib_dragvec(this.velocity,0.02,0.5); **/ -vector movelib_dragvec(float drag, float exp_); +vector movelib_dragvec(entity this, float drag, float exp_); /** Simulate drag - self.velocity *= movelib_dragflt(somespeed,0.01,0.7); + this.velocity *= movelib_dragflt(somespeed,0.01,0.7); **/ float movelib_dragflt(float fspeed,float drag,float exp_); /** Do a inertia simulation based on velocity. Basicaly, this allows you to simulate loss of steering with higher speed. - self.velocity = movelib_inertmove_byspeed(self.velocity,newvel,1000,0.1,0.9); + this.velocity = movelib_inertmove_byspeed(this.velocity,newvel,1000,0.1,0.9); **/ -vector movelib_inertmove_byspeed(vector vel_new, float vel_max,float newmin,float oldmax); +vector movelib_inertmove_byspeed(entity this, vector vel_new, float vel_max, float newmin, float oldmax); -vector movelib_inertmove(vector new_vel,float new_bias); +vector movelib_inertmove(entity this, vector new_vel, float new_bias); .float movelib_lastupdate; -void movelib_move(vector force,float max_velocity,float drag,float theMass,float breakforce); +void movelib_move(entity this, vector force, float max_velocity, float drag, float theMass, float breakforce); /* void movelib_move_simple(vector newdir,float velo,float blendrate) { - self.velocity = self.velocity * (1 - blendrate) + (newdir * blendrate) * velo; + this.velocity = this.velocity * (1 - blendrate) + (newdir * blendrate) * velo; } */ -#define movelib_move_simple(newdir,velo,blendrate) \ - self.velocity = self.velocity * (1 - blendrate) + (newdir * blendrate) * velo +#define movelib_move_simple(e,newdir,velo,blendrate) \ + e.velocity = e.velocity * (1 - blendrate) + (newdir * blendrate) * velo -#define movelib_move_simple_gravity(newdir,velo,blendrate) \ - if(IS_ONGROUND(self)) movelib_move_simple(newdir,velo,blendrate) +#define movelib_move_simple_gravity(e,newdir,velo,blendrate) \ + if(IS_ONGROUND(e)) movelib_move_simple(e,newdir,velo,blendrate) -void movelib_brake_simple(float force); +void movelib_brake_simple(entity this, float force); /** Pitches and rolls the entity to match the gound. @@ -48,6 +48,6 @@ Yed need to set v_up and v_forward (generally by calling makevectors) before cal **/ #endif -void movelib_groundalign4point(float spring_length, float spring_up, float blendrate, float _max); +void movelib_groundalign4point(entity this, float spring_length, float spring_up, float blendrate, float _max); #endif