]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/animdecide.qh
Merge branch 'master' into terencehill/quickmenu
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / animdecide.qh
1 #ifndef ANIMDECIDE_H
2 #define ANIMDECIDE_H
3
4 // must be called at least once to initialize, or when modelindex is changed
5 void animdecide_load_if_needed(entity e);
6
7 // client side frame inferring
8 void animdecide_setimplicitstate(entity e, float onground);
9 void animdecide_setframes(entity e, bool support_blending, .int fld_frame, .int fld_frame1time, .int fld_frame2, .int fld_frame2time);
10
11 // player animation data for this model
12 // each vector is as follows:
13 // _x = startframe
14 // _y = numframes
15 // _z = framerate
16 .vector anim_die1; // player dies
17 .vector anim_die2; // player dies differently
18 .vector anim_draw; // player pulls out a weapon
19 .vector anim_duckwalk; // player walking while crouching
20 .vector anim_duckjump; // player jumping from a crouch
21 .vector anim_duckidle; // player idling while crouching
22 .vector anim_idle; // player standing
23 .vector anim_jump; // player jump
24 .vector anim_pain1; // player flinches from pain
25 .vector anim_pain2; // player flinches from pain, differently
26 .vector anim_shoot; // player shoots
27 .vector anim_taunt; // player taunts others (FIXME: no code references this)
28 .vector anim_run; // player running forward
29 .vector anim_runbackwards; // player running backward
30 .vector anim_strafeleft; // player shuffling left quickly
31 .vector anim_straferight; // player shuffling right quickly
32 .vector anim_forwardright; // player running forward and right
33 .vector anim_forwardleft; // player running forward and left
34 .vector anim_backright; // player running backward and right
35 .vector anim_backleft; // player running back and left
36 .vector anim_melee; // player doing the melee action
37 .vector anim_duck; // player doing the melee action
38 .vector anim_duckwalkbackwards;
39 .vector anim_duckwalkstrafeleft;
40 .vector anim_duckwalkstraferight;
41 .vector anim_duckwalkforwardright;
42 .vector anim_duckwalkforwardleft;
43 .vector anim_duckwalkbackright;
44 .vector anim_duckwalkbackleft;
45 .float animdecide_modelindex;
46
47 // please network this one
48 .int anim_state;
49 .float anim_time;
50 .float anim_lower_action;
51 .float anim_lower_time;
52 .float anim_upper_action;
53 .float anim_upper_time;
54
55 // when copying entities, copy these too
56 .int anim_implicit_state;
57 .float anim_implicit_time;
58 .float anim_lower_implicit_action;
59 .float anim_lower_implicit_time;
60 .float anim_upper_implicit_action;
61 .float anim_upper_implicit_time;
62
63 // explicit anim states (networked)
64 void animdecide_setstate(entity e, int newstate, float restart);
65 const int ANIMSTATE_DEAD1 = 1; // base frames: die1
66 const int ANIMSTATE_DEAD2 = 2; // base frames: die2
67 const int ANIMSTATE_DUCK = 4; // turns walk into duckwalk, jump into duckjump, etc.
68 const int ANIMSTATE_FROZEN = 8; // force idle
69
70 // implicit anim states (inferred from velocity, etc.)
71 const int ANIMIMPLICITSTATE_INAIR = 1;
72 const int ANIMIMPLICITSTATE_FORWARD = 2;
73 const int ANIMIMPLICITSTATE_BACKWARDS = 4;
74 const int ANIMIMPLICITSTATE_LEFT = 8;
75 const int ANIMIMPLICITSTATE_RIGHT = 16;
76 const int ANIMIMPLICITSTATE_JUMPRELEASED = 32;
77
78 // explicit actions (networked); negative values are for lower body
79 void animdecide_setaction(entity e, float action, float restart);
80 const int ANIMACTION_JUMP = -1; // jump
81 const int ANIMACTION_DRAW = 1; // draw
82 const int ANIMACTION_PAIN1 = 2; // pain
83 const int ANIMACTION_PAIN2 = 3; // pain
84 const int ANIMACTION_SHOOT = 4; // shoot
85 const int ANIMACTION_TAUNT = 5; // taunt
86 const int ANIMACTION_MELEE = 6; // melee
87 #endif