]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/movetypes/movetypes.qh
Merge branch 'master' into Mario/vaporizer_damage
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / movetypes / movetypes.qh
1 #ifndef MOVETYPES_H
2 #define MOVETYPES_H
3
4 .float move_ltime;
5 .void(void)move_think;
6 .float move_nextthink;
7 .void(void)move_blocked;
8
9 .float move_movetype;
10 .float move_time;
11 .vector move_origin;
12 .vector move_angles;
13 .vector move_velocity;
14 .vector move_avelocity;
15 .int move_flags;
16 .int move_watertype;
17 .int move_waterlevel;
18 .void(void)move_touch;
19 .void(float, float)contentstransition;
20 .float move_bounce_factor;
21 .float move_bounce_stopspeed;
22 .float move_nomonsters;  // -1 for MOVE_NORMAL, otherwise a MOVE_ constant
23
24 .entity move_aiment;
25 .vector move_punchangle;
26
27 // should match sv_gameplayfix_fixedcheckwatertransition
28 float autocvar_cl_gameplayfix_fixedcheckwatertransition = 1;
29
30 #ifdef SVQC
31 .int stat_gameplayfix_upvelocityclearsonground;
32
33 #define GRAVITY_UNAFFECTED_BY_TICRATE autocvar_sv_gameplayfix_gravityunaffectedbyticrate
34 #define UPWARD_VELOCITY_CLEARS_ONGROUND autocvar_sv_gameplayfix_upwardvelocityclearsongroundflag
35
36 #define TICRATE sys_frametime
37 #elif defined(CSQC)
38 #define GRAVITY_UNAFFECTED_BY_TICRATE (getstati(STAT_MOVEFLAGS) & MOVEFLAG_GRAVITYUNAFFECTEDBYTICRATE)
39 #define UPWARD_VELOCITY_CLEARS_ONGROUND getstati(STAT_GAMEPLAYFIX_UPVELOCITYCLEARSONGROUND)
40
41 #define TICRATE ticrate
42 #endif
43
44 .entity move_groundentity;  // FIXME add move_groundnetworkentity?
45 .float move_suspendedinair;
46 .float move_didgravity;
47
48 void _Movetype_WallFriction(vector stepnormal);
49 int _Movetype_FlyMove(float dt, bool applygravity, vector stepnormal, float stepheight);
50 void _Movetype_CheckVelocity();
51 void _Movetype_CheckWaterTransition(entity ent);
52 float _Movetype_CheckWater(entity ent);
53 void _Movetype_LinkEdict_TouchAreaGrid();
54 void _Movetype_LinkEdict(float touch_triggers);
55 float _Movetype_TestEntityPosition(vector ofs);
56 float _Movetype_UnstickEntity();
57 vector _Movetype_ClipVelocity(vector vel, vector norm, float f);
58 void _Movetype_PushEntityTrace(vector push);
59 float _Movetype_PushEntity(vector push, float failonstartsolid);
60 void makevectors_matrix(vector myangles);
61
62 void Movetype_Physics_MatchTicrate(float tr, bool sloppy);
63 void Movetype_Physics_MatchServer(bool sloppy);
64 void Movetype_Physics_NoMatchServer();
65 void _Movetype_LinkEdict(float touch_triggers);
66 void _Movetype_LinkEdict_TouchAreaGrid();
67
68 float _Movetype_UnstickEntity();
69
70 const int MAX_CLIP_PLANES = 5;
71
72 #ifdef CSQC
73 const int MOVETYPE_NONE             = 0;
74 const int MOVETYPE_ANGLENOCLIP      = 1;
75 const int MOVETYPE_ANGLECLIP        = 2;
76 const int MOVETYPE_WALK             = 3;
77 const int MOVETYPE_STEP             = 4;
78 const int MOVETYPE_FLY              = 5;
79 const int MOVETYPE_TOSS             = 6;
80 const int MOVETYPE_PUSH             = 7;
81 const int MOVETYPE_NOCLIP           = 8;
82 const int MOVETYPE_FLYMISSILE       = 9;
83 const int MOVETYPE_BOUNCE           = 10;
84 const int MOVETYPE_BOUNCEMISSILE    = 11;  // Like bounce but doesn't lose speed on bouncing
85 const int MOVETYPE_FOLLOW           = 12;
86 const int MOVETYPE_FLY_WORLDONLY    = 33;
87
88 const int FL_ITEM                   = 256;
89 const int FL_ONGROUND                           = 512;
90 #endif
91
92 const int MOVETYPE_FAKEPUSH         = 13;
93
94 const float MOVEFLAG_Q2AIRACCELERATE            = 1;
95 const float MOVEFLAG_NOGRAVITYONGROUND          = 2;
96 const float MOVEFLAG_GRAVITYUNAFFECTEDBYTICRATE = 4;
97
98 #ifdef CSQC
99 // TODO: figure out server's version of this
100 #define moveflags (getstati(STAT_MOVEFLAGS))
101 #endif
102
103 #endif