]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/physics/movetypes/movetypes.qh
Merge branch 'Mario/teams_bitflag' 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 #ifdef CSQC
9 .float bouncestop;
10 .float bouncefactor;
11 #endif
12
13 #ifdef SVQC
14 .bool move_qcphysics;
15 #endif
16
17 void set_movetype(entity this, int mt);
18
19 .float move_movetype;
20 .float move_time;
21 //.vector move_origin;
22 //.vector move_angles;
23 //.vector move_velocity;
24 //.vector move_avelocity;
25 //.int move_flags;
26 //.int move_watertype;
27 //.int move_waterlevel;
28 .void(float, float)contentstransition;
29 //.float move_bounce_factor;
30 //.float move_bounce_stopspeed;
31 .float move_nomonsters;  // -1 for MOVE_NORMAL, otherwise a MOVE_ constant
32
33 .entity aiment;
34 .vector punchangle;
35
36 .entity move_groundentity;  // FIXME add move_groundnetworkentity?
37 .float move_suspendedinair;
38 .float move_didgravity;
39
40 void _Movetype_WallFriction(entity this, vector stepnormal);
41 int _Movetype_FlyMove(entity this, float dt, bool applygravity, vector stepnormal, float stepheight);
42 void _Movetype_CheckVelocity(entity this);
43 void _Movetype_CheckWaterTransition(entity ent);
44 float _Movetype_CheckWater(entity ent);
45 void _Movetype_LinkEdict_TouchAreaGrid(entity this);
46 void _Movetype_LinkEdict(entity this, float touch_triggers);
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_NoMatchTicrate(entity this, float movedt, bool isclient);
53 void Movetype_Physics_MatchTicrate(entity this, float tr, bool sloppy);
54 void Movetype_Physics_MatchServer(entity this, bool sloppy);
55 void Movetype_Physics_NoMatchServer(entity this);
56 void _Movetype_LinkEdict(entity this, float touch_triggers);
57 void _Movetype_LinkEdict_TouchAreaGrid(entity this);
58
59 float _Movetype_UnstickEntity(entity this);
60
61 const int MAX_CLIP_PLANES = 5;
62
63 #ifdef CSQC
64 const int MOVETYPE_NONE             = 0;
65 const int MOVETYPE_ANGLENOCLIP      = 1;
66 const int MOVETYPE_ANGLECLIP        = 2;
67 const int MOVETYPE_WALK             = 3;
68 const int MOVETYPE_STEP             = 4;
69 const int MOVETYPE_FLY              = 5;
70 const int MOVETYPE_TOSS             = 6;
71 const int MOVETYPE_PUSH             = 7;
72 const int MOVETYPE_NOCLIP           = 8;
73 const int MOVETYPE_FLYMISSILE       = 9;
74 const int MOVETYPE_BOUNCE           = 10;
75 const int MOVETYPE_BOUNCEMISSILE    = 11;  // Like bounce but doesn't lose speed on bouncing
76 const int MOVETYPE_FOLLOW           = 12;
77 const int MOVETYPE_PHYSICS          = 32;
78 const int MOVETYPE_FLY_WORLDONLY    = 33;
79
80 const int FL_ITEM                   = 256;
81 const int FL_ONGROUND                           = 512;
82 #endif
83
84 const int MOVETYPE_FAKEPUSH         = 13;
85
86 const int MOVEFLAG_VALID = BIT(23);
87 const int MOVEFLAG_Q2AIRACCELERATE = BIT(0);
88 const int MOVEFLAG_NOGRAVITYONGROUND = BIT(1);
89 const int MOVEFLAG_GRAVITYUNAFFECTEDBYTICRATE = BIT(2);
90
91 #ifdef CSQC
92 #define moveflags STAT(MOVEFLAGS)
93 #endif
94
95 #endif