dead
[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 /* tricks */
27 v3f flip_axis;
28 float flip_time,
29 flip_rate;
30
31 v3f trick_vel, /* measured in units of TAU/s */
32 trick_euler; /* measured in units of TAU */
33 float trick_time;
34
35 m3x3f velocity_bias,
36 velocity_bias_pstep;
37 v3f apex;
38
39 int lift_frames;
40
41 v3f throw_v;
42 v3f cog_v, cog;
43
44 float grabbing;
45 v2f grab_mouse_delta;
46
47 int charging_jump, jump_dir;
48 float jump_charge;
49 double jump_time;
50
51 double start_push,
52 cur_push;
53
54 v3f prev_pos;
55 }
56 state,
57 state_gate_storage;
58
59 struct land_prediction
60 {
61 v3f log[50];
62 v3f n;
63 v3f apex;
64 u32 log_length;
65 float score,
66 land_dist;
67
68 enum prediction_type
69 {
70 k_prediction_none,
71 k_prediction_land,
72 k_prediction_grind
73 }
74 type;
75
76 u32 colour;
77 }
78 predictions[22];
79 u32 prediction_count;
80 float land_dist;
81 v3f land_normal;
82
83 /* animation */
84 struct skeleton_anim *anim_stand, *anim_highg, *anim_slide,
85 *anim_air,
86 *anim_push, *anim_push_reverse,
87 *anim_ollie, *anim_ollie_reverse,
88 *anim_grabs, *anim_stop;
89 rb_sphere sphere_front, sphere_back;
90 v3f board_offset,
91 board_trick_residualv,
92 board_trick_residuald;
93 v4f board_rotation;
94
95 float blend_slide,
96 blend_z,
97 blend_x,
98 blend_fly,
99 blend_stand,
100 blend_push,
101 blend_jump,
102 blend_airdir;
103
104 v2f wobble;
105
106 float debug_normal_pressure;
107 u32 device_id_walk;
108 };
109
110 VG_STATIC void player__skate_bind ( player_instance *player );
111 VG_STATIC void player__skate_pre_update ( player_instance *player );
112 VG_STATIC void player__skate_update ( player_instance *player );
113 VG_STATIC void player__skate_post_update ( player_instance *player );
114 VG_STATIC void player__skate_im_gui ( player_instance *player );
115 VG_STATIC void player__skate_animate ( player_instance *player,
116 player_animation *anim );
117 VG_STATIC void player__skate_post_animate ( player_instance *player );
118 VG_STATIC void player__skate_reset ( player_instance *player,
119 struct respawn_point *rp );
120
121 VG_STATIC void player__skate_clear_mechanics( player_instance *player );
122 VG_STATIC void player__skate_reset_animator( player_instance *player );
123 VG_STATIC void player__approximate_best_trajectory( player_instance *player );
124 #endif /* PLAYER_SKATE_H */