X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fphysics%2Fmovelib.qh;h=e0659a40c197ffcbeeffb775a974682974466212;hb=3e8e73d5c867c2833409e33782d91c45fa0769eb;hp=a64651b30e092dd2939cb513bcab941744d0ba35;hpb=42a9e3d7ece2c716e5cd6899e90841acb7fb891b;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/physics/movelib.qh b/qcsrc/common/physics/movelib.qh index a64651b30..e0659a40c 100644 --- a/qcsrc/common/physics/movelib.qh +++ b/qcsrc/common/physics/movelib.qh @@ -1,25 +1,24 @@ -#ifndef MOVELIB_H -#define MOVELIB_H +#pragma once #ifdef SVQC .vector moveto; /** 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(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(entity this, vector vel_new, float vel_max, float newmin, float oldmax); @@ -31,7 +30,7 @@ void movelib_move(entity this, vector force, float max_velocity, float drag, flo /* 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(e,newdir,velo,blendrate) \ @@ -49,5 +48,3 @@ Yed need to set v_up and v_forward (generally by calling makevectors) before cal #endif void movelib_groundalign4point(entity this, float spring_length, float spring_up, float blendrate, float _max); - -#endif