f0efcf8ac3df169f6d911648c110968620980cba
[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 state,
52 state_gate_storage;
53
54 struct land_prediction
55 {
56 v3f log[50];
57 v3f n;
58 v3f apex;
59 u32 log_length;
60 float score,
61 land_dist;
62
63 enum prediction_type
64 {
65 k_prediction_none,
66 k_prediction_land,
67 k_prediction_grind
68 }
69 type;
70
71 u32 colour;
72 }
73 predictions[22];
74 u32 prediction_count;
75 float land_dist;
76 v3f land_normal;
77
78 /* animation */
79 struct skeleton_anim *anim_stand, *anim_highg, *anim_slide,
80 *anim_air,
81 *anim_push, *anim_push_reverse,
82 *anim_ollie, *anim_ollie_reverse,
83 *anim_grabs, *anim_stop;
84 rb_sphere sphere_front, sphere_back;
85 v3f board_offset;
86 v4f board_rotation;
87
88 float blend_slide,
89 blend_z,
90 blend_x,
91 blend_fly,
92 blend_stand,
93 blend_push,
94 blend_jump,
95 blend_airdir;
96
97 v2f wobble;
98
99 float debug_normal_pressure;
100 u32 device_id_walk;
101 };
102
103 VG_STATIC void player__skate_bind ( player_instance *player );
104 VG_STATIC void player__skate_pre_update ( player_instance *player );
105 VG_STATIC void player__skate_update ( player_instance *player );
106 VG_STATIC void player__skate_post_update ( player_instance *player );
107 VG_STATIC void player__skate_im_gui ( player_instance *player );
108 VG_STATIC void player__skate_animate ( player_instance *player,
109 player_animation *anim );
110 VG_STATIC void player__skate_post_animate ( player_instance *player );
111 VG_STATIC void player__skate_reset ( player_instance *player,
112 struct respawn_point *rp );
113
114 VG_STATIC void player__skate_clear_mechanics( player_instance *player );
115 VG_STATIC void player__skate_reset_animator( player_instance *player );
116 VG_STATIC void player__approximate_best_trajectory( player_instance *player );
117 #endif /* PLAYER_SKATE_H */