the never ending refactor
[carveJwlIkooP6JGAAIwe30JlM.git] / player_skate.h
1 #ifndef PLAYER_SKATE_H
2 #define PLAYER_SKATE_H
3
4 #include "player_api.h"
5
6 struct player_skate
7 {
8 struct
9 {
10 enum skate_activity
11 {
12 k_skate_activity_air,
13 k_skate_activity_ground,
14 k_skate_activity_grind
15 }
16 activity,
17 activity_prev;
18
19 float steery,
20 steerx,
21 steery_s,
22 steerx_s,
23 reverse,
24 slip;
25
26 v3f flip_axis;
27 float flip_time,
28 flip_rate;
29
30 m3x3f velocity_bias,
31 velocity_bias_pstep;
32 v3f apex;
33
34 int lift_frames;
35
36 v3f throw_v;
37 v3f cog_v, cog;
38
39 float grabbing;
40 v2f grab_mouse_delta;
41
42 int charging_jump, jump_dir;
43 float jump_charge;
44 double jump_time;
45
46 double start_push,
47 cur_push;
48
49 v3f prev_pos;
50
51 /* FIXME: Sensible names */
52 v3f vl, /* 1st */
53 posl, dirl; /* 3rd */
54 }
55 state,
56 state_gate_storage;
57
58 struct land_prediction
59 {
60 v3f log[50];
61 v3f n;
62 v3f apex;
63 u32 log_length;
64 float score,
65 land_dist;
66
67 enum prediction_type
68 {
69 k_prediction_none,
70 k_prediction_land,
71 k_prediction_grind
72 }
73 type;
74
75 u32 colour;
76 }
77 predictions[22];
78 u32 prediction_count;
79 float land_dist;
80 v3f land_normal;
81
82 /* animation */
83 struct skeleton_anim *anim_stand, *anim_highg, *anim_slide,
84 *anim_air,
85 *anim_push, *anim_push_reverse,
86 *anim_ollie, *anim_ollie_reverse,
87 *anim_grabs, *anim_stop;
88 rb_sphere sphere_front, sphere_back;
89 v3f board_offset;
90 v4f board_rotation;
91
92 float blend_slide,
93 blend_z,
94 blend_x,
95 blend_fly,
96 blend_stand,
97 blend_push,
98 blend_jump,
99 blend_airdir;
100
101 v2f wobble;
102
103 float debug_normal_pressure;
104 u32 device_id_walk;
105 };
106
107 VG_STATIC void player__skate_bind ( player_instance *player );
108 VG_STATIC void player__skate_pre_update ( player_instance *player );
109 VG_STATIC void player__skate_update ( player_instance *player );
110 VG_STATIC void player__skate_post_update ( player_instance *player );
111 VG_STATIC void player__skate_im_gui ( player_instance *player );
112 VG_STATIC void player__skate_animate ( player_instance *player,
113 player_animation *anim );
114 VG_STATIC void player__skate_post_animate ( player_instance *player );
115 VG_STATIC void player__skate_reset ( player_instance *player,
116 struct respawn_point *rp );
117
118 VG_STATIC void player__skate_transition ( player_instance *player,
119 v3f init_velocity );
120
121 #endif /* PLAYER_SKATE_H */