X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fphysics%2Fmovetypes%2Fmovetypes.qh;h=0c8bc694850a40fe3aac357936ab7067231606f7;hb=9b36d99e99fda853f75a7f63c6fc2ebf9fa9e5cb;hp=35a73d3331755d5f24b04ef175ce3f3208bf7420;hpb=4f133bdb70d13143f2ce4b9de097744371c1f92a;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/physics/movetypes/movetypes.qh b/qcsrc/common/physics/movetypes/movetypes.qh index 35a73d333..0c8bc6948 100644 --- a/qcsrc/common/physics/movetypes/movetypes.qh +++ b/qcsrc/common/physics/movetypes/movetypes.qh @@ -1,17 +1,69 @@ -#ifndef MOVETYPES_H -#define MOVETYPES_H +#pragma once + +// water levels +const int WATERLEVEL_NONE = 0; +const int WATERLEVEL_WETFEET = 1; +const int WATERLEVEL_SWIMMING = 2; +const int WATERLEVEL_SUBMERGED = 3; #define IS_ONGROUND(s) boolean((s).flags & FL_ONGROUND) #define SET_ONGROUND(s) ((s).flags |= FL_ONGROUND) #define UNSET_ONGROUND(s) ((s).flags &= ~FL_ONGROUND) +#define IS_ONSLICK(s) boolean((s).flags & FL_ONSLICK) +#define SET_ONSLICK(s) ((s).flags |= FL_ONSLICK) +#define UNSET_ONSLICK(s) ((s).flags &= ~FL_ONSLICK) + +#define GAMEPLAYFIX_DOWNTRACEONGROUND(s) STAT(GAMEPLAYFIX_DOWNTRACEONGROUND) +#define GAMEPLAYFIX_EASIERWATERJUMP(s) STAT(GAMEPLAYFIX_EASIERWATERJUMP) +#define GAMEPLAYFIX_STEPDOWN(s) STAT(GAMEPLAYFIX_STEPDOWN) +#define GAMEPLAYFIX_STEPMULTIPLETIMES(s) STAT(GAMEPLAYFIX_STEPMULTIPLETIMES) +#define GAMEPLAYFIX_UNSTICKPLAYERS(s) STAT(GAMEPLAYFIX_UNSTICKPLAYERS) +#define GAMEPLAYFIX_WATERTRANSITION(s) STAT(GAMEPLAYFIX_WATERTRANSITION) +#define GAMEPLAYFIX_SLIDEMOVEPROJECTILES(s) STAT(GAMEPLAYFIX_SLIDEMOVEPROJECTILES) +#define GAMEPLAYFIX_GRENADEBOUNCESLOPES(s) STAT(GAMEPLAYFIX_GRENADEBOUNCESLOPES) +#define GAMEPLAYFIX_NOAIRBORNCORPSE(s) STAT(GAMEPLAYFIX_NOAIRBORNCORPSE) +#define NOAIRBORNCORPSE_ALLOWSUSPENDED(s) STAT(NOAIRBORNCORPSE_ALLOWSUSPENDED) +#define UPWARD_VELOCITY_CLEARS_ONGROUND(s) STAT(GAMEPLAYFIX_UPVELOCITYCLEARSONGROUND) + + +#define PHYS_STEPHEIGHT(s) STAT(MOVEVARS_STEPHEIGHT) +#define PHYS_NOSTEP(s) STAT(NOSTEP) +#define PHYS_JUMPSTEP(s) STAT(MOVEVARS_JUMPSTEP) +#define PHYS_WALLFRICTION(s) STAT(MOVEVARS_WALLFRICTION) + +#define PHYS_WALLCLIP(s) STAT(MOVEVARS_WALLCLIP) #ifdef CSQC .float bouncestop; .float bouncefactor; + + #define GAMEPLAYFIX_GRAVITYUNAFFECTEDBYTICRATE (boolean(moveflags & MOVEFLAG_GRAVITYUNAFFECTEDBYTICRATE)) + #define GAMEPLAYFIX_NOGRAVITYONGROUND (boolean(moveflags & MOVEFLAG_NOGRAVITYONGROUND)) + #define GAMEPLAYFIX_Q2AIRACCELERATE (boolean(moveflags & MOVEFLAG_Q2AIRACCELERATE)) + + #define PHYS_GRAVITY(s) STAT(MOVEVARS_GRAVITY, s) + // FIXME: 0 doesn't mean zero gravity + #define PHYS_ENTGRAVITY(s) STAT(MOVEVARS_ENTGRAVITY, s) + + #define TICRATE ticrate + +#elif defined(SVQC) + + #define GAMEPLAYFIX_GRAVITYUNAFFECTEDBYTICRATE autocvar_sv_gameplayfix_gravityunaffectedbyticrate + #define GAMEPLAYFIX_NOGRAVITYONGROUND autocvar_sv_gameplayfix_nogravityonground + #define GAMEPLAYFIX_Q2AIRACCELERATE autocvar_sv_gameplayfix_q2airaccelerate + + #define PHYS_GRAVITY(s) autocvar_sv_gravity + #define PHYS_ENTGRAVITY(s) ((s).gravity) + + #define TICRATE sys_frametime + #endif void set_movetype(entity this, int mt); +.float pm_time; + .float move_movetype; .float move_time; //.vector move_origin; @@ -33,17 +85,25 @@ void set_movetype(entity this, int mt); .float move_suspendedinair; .float move_didgravity; +// unsticking +const int UNSTICK_FINE = 0; +const int UNSTICK_FIXED = 1; +const int UNSTICK_STUCK = 2; + +// set by _Movetype_FlyMove +vector move_stepnormal; + void _Movetype_WallFriction(entity this, vector stepnormal); -int _Movetype_FlyMove(entity this, float dt, bool applygravity, vector stepnormal, float stepheight); +int _Movetype_FlyMove(entity this, float dt, bool applygravity, bool applystepnormal, float stepheight); void _Movetype_CheckVelocity(entity this); void _Movetype_CheckWaterTransition(entity ent); +void _Movetype_CheckStuck(entity this); float _Movetype_CheckWater(entity ent); void _Movetype_LinkEdict_TouchAreaGrid(entity this); void _Movetype_LinkEdict(entity this, float touch_triggers); vector _Movetype_ClipVelocity(vector vel, vector norm, float f); void _Movetype_PushEntityTrace(entity this, vector push); -float _Movetype_PushEntity(entity this, vector push, float failonstartsolid); -void makevectors_matrix(vector myangles); +bool _Movetype_PushEntity(entity this, vector push, float failonstartsolid, bool dolink); void Movetype_Physics_NoMatchTicrate(entity this, float movedt, bool isclient); void Movetype_Physics_MatchTicrate(entity this, float tr, bool sloppy); @@ -52,7 +112,7 @@ void Movetype_Physics_NoMatchServer(entity this); void _Movetype_LinkEdict(entity this, float touch_triggers); void _Movetype_LinkEdict_TouchAreaGrid(entity this); -float _Movetype_UnstickEntity(entity this); +int _Movetype_UnstickEntity(entity this); const int MAX_CLIP_PLANES = 5; @@ -80,6 +140,10 @@ const int MOVETYPE_ANGLENOCLIP = 1; const int MOVETYPE_ANGLECLIP = 2; #endif +const int MOVETYPE_QCPLAYER = 150; // QC-driven player physics, no think functions! + +const int FL_ONSLICK = BIT(20); + const int MOVETYPE_FAKEPUSH = 13; const int MOVEFLAG_VALID = BIT(23); @@ -90,5 +154,3 @@ const int MOVEFLAG_GRAVITYUNAFFECTEDBYTICRATE = BIT(2); #ifdef CSQC #define moveflags STAT(MOVEFLAGS) #endif - -#endif