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