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