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