better? grinds
[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_undefined,
17 k_skate_activity_grind_any,
18 k_skate_activity_grind_boardslide,
19 k_skate_activity_grind_noseslide,
20 k_skate_activity_grind_tailslide,
21 k_skate_activity_grind_back50,
22 k_skate_activity_grind_front50,
23 k_skate_activity_grind_5050
24 }
25 activity,
26 activity_prev;
27
28 float /* steery,
29 steerx,
30 steery_s,
31 steerx_s, */
32 reverse,
33 slip;
34
35 int manual_direction;
36
37 /* tricks */
38 v3f flip_axis;
39 float flip_time,
40 flip_rate;
41
42 v3f trick_vel, /* measured in units of TAU/s */
43 trick_euler; /* measured in units of TAU */
44 float trick_time;
45
46 m3x3f velocity_bias,
47 velocity_bias_pstep;
48 v3f apex;
49 v3f up_dir;
50
51 v3f head_position;
52
53 int lift_frames;
54
55 v3f throw_v;
56 v3f cog_v, cog;
57
58 float grabbing;
59 v2f grab_mouse_delta;
60
61 int charging_jump, jump_dir;
62 float jump_charge;
63 double jump_time;
64
65 double start_push,
66 cur_push;
67
68 v3f prev_pos;
69 }
70 state,
71 state_gate_storage;
72
73
74 /* animation */
75 struct skeleton_anim *anim_stand, *anim_highg, *anim_slide,
76 *anim_air,
77 *anim_push, *anim_push_reverse,
78 *anim_ollie, *anim_ollie_reverse,
79 *anim_grabs, *anim_stop;
80 v3f
81 board_trick_residualv,
82 board_trick_residuald;
83
84 float blend_slide,
85 blend_z,
86 blend_x,
87 blend_fly,
88 blend_stand,
89 blend_push,
90 blend_jump,
91 blend_airdir;
92
93 v2f wobble;
94
95 /*
96 * Physics
97 * ----------------------------------------------------
98 */
99
100 float substep,
101 substep_delta;
102
103 struct land_prediction
104 {
105 v3f log[50];
106 v3f n;
107 v3f apex;
108 u32 log_length;
109 float score,
110 land_dist;
111
112 enum prediction_type
113 {
114 k_prediction_none,
115 k_prediction_land,
116 k_prediction_grind
117 }
118 type;
119
120 u32 colour;
121 }
122 predictions[22];
123 u32 prediction_count;
124 float land_dist;
125 v3f land_normal;
126
127 v3f surface_picture,
128 weight_distribution,
129 grind_vec;
130
131 float grind_strength;
132
133 struct grind_limit
134 {
135 v3f ra, n;
136 float p;
137 }
138 limits[3];
139 u32 limit_count;
140 };
141
142 VG_STATIC void player__skate_bind ( player_instance *player );
143 VG_STATIC void player__skate_pre_update ( player_instance *player );
144 VG_STATIC void player__skate_update ( player_instance *player );
145 VG_STATIC void player__skate_post_update ( player_instance *player );
146 VG_STATIC void player__skate_im_gui ( player_instance *player );
147 VG_STATIC void player__skate_animate ( player_instance *player,
148 player_animation *anim );
149 VG_STATIC void player__skate_post_animate ( player_instance *player );
150 VG_STATIC void player__skate_reset ( player_instance *player,
151 struct respawn_point *rp );
152
153 VG_STATIC void player__skate_clear_mechanics( player_instance *player );
154 VG_STATIC void player__skate_reset_animator( player_instance *player );
155 VG_STATIC void player__approximate_best_trajectory( player_instance *player );
156 #endif /* PLAYER_SKATE_H */