fuck you, you cant put your couch there
[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 typedef struct jump_info jump_info;
9
10 struct player_skate
11 {
12 struct
13 {
14 enum skate_activity
15 {
16 k_skate_activity_air,
17 k_skate_activity_air_to_grind,
18 k_skate_activity_ground,
19 k_skate_activity_undefined,
20 k_skate_activity_grind_any,
21 k_skate_activity_grind_boardslide,
22 k_skate_activity_grind_back50,
23 k_skate_activity_grind_front50,
24 k_skate_activity_grind_5050
25 }
26 activity,
27 activity_prev;
28
29 float /* steery,
30 steerx,
31 steery_s,
32 steerx_s, */
33 reverse,
34 slip;
35
36 int manual_direction;
37
38 /* tricks */
39 v3f flip_axis;
40 float flip_time,
41 flip_rate;
42
43 v3f trick_vel, /* measured in units of TAU/s */
44 trick_euler; /* measured in units of TAU */
45 float trick_time;
46 float gravity_bias;
47
48 v3f up_dir;
49 v3f head_position;
50
51 v3f throw_v;
52 v3f cog_v, cog;
53
54 float grabbing;
55 v2f grab_mouse_delta;
56
57 int charging_jump, jump_dir;
58 float jump_charge,
59 slap;
60
61 double jump_time;
62 double start_push,
63 cur_push;
64
65 v3f prev_pos;
66
67 /* initial launch conditions */
68 double air_start;
69 v3f air_init_v,
70 air_init_co;
71
72 v4f smoothed_rotation;
73 }
74 state,
75 state_gate_storage;
76
77
78 /* animation /audio */
79 struct skeleton_anim *anim_stand, *anim_highg, *anim_slide,
80 *anim_air, *anim_grind, *anim_grind_jump,
81 *anim_push, *anim_push_reverse,
82 *anim_ollie, *anim_ollie_reverse,
83 *anim_grabs, *anim_stop;
84 v3f
85 board_trick_residualv,
86 board_trick_residuald;
87
88 float blend_slide,
89 blend_z,
90 blend_x,
91 blend_fly,
92 blend_grind,
93 blend_grind_balance,
94 blend_stand,
95 blend_push,
96 blend_jump,
97 blend_airdir,
98 blend_weight,
99 subslap;
100
101 /* vectors representing the direction of the axels in localspace */
102 v3f truckv0[2];
103 v2f wobble;
104
105 audio_channel *aud_main, *aud_slide, *aud_air;
106 enum mdl_surface_prop surface, audio_surface;
107
108 int wheel_contacts[2];
109 float sample_change_cooldown;
110
111 enum {
112 k_skate_sample_concrete,
113 k_skate_sample_wood,
114 k_skate_sample_concrete_scrape_metal,
115 k_skate_sample_concrete_scrape_wood,
116 k_skate_sample_metal_scrape_generic
117 }
118 main_sample_type;
119
120 /*
121 * Physics
122 * ----------------------------------------------------
123 */
124
125 float substep,
126 substep_delta;
127
128 struct jump_info
129 {
130 v3f log[50];
131 v3f n;
132 v3f apex;
133 v3f v;
134
135 float gravity;
136
137 int log_length;
138 float score,
139 land_dist;
140
141 enum prediction_type
142 {
143 k_prediction_none,
144 k_prediction_unset,
145 k_prediction_land,
146 k_prediction_grind
147 }
148 type;
149
150 u32 colour;
151 }
152 possible_jumps[36];
153 u32 possible_jump_count;
154
155 float land_dist;
156 v3f land_normal;
157
158 v3f surface_picture,
159 weight_distribution,
160 grind_vec,
161 grind_dir;
162
163 u32 grind_cooldown,
164 surface_cooldown;
165
166 float grind_strength;
167
168 struct grind_limit
169 {
170 v3f ra, n;
171 float p;
172 }
173 limits[3];
174 u32 limit_count;
175 };
176
177 VG_STATIC void player__skate_bind ( player_instance *player );
178 VG_STATIC void player__skate_pre_update ( player_instance *player );
179 VG_STATIC void player__skate_update ( player_instance *player );
180 VG_STATIC void player__skate_post_update ( player_instance *player );
181 VG_STATIC void player__skate_im_gui ( player_instance *player );
182 VG_STATIC void player__skate_animate ( player_instance *player,
183 player_animation *anim );
184 VG_STATIC void player__skate_post_animate ( player_instance *player );
185 VG_STATIC void player__skate_reset ( player_instance *player,
186 ent_spawn *rp );
187
188 VG_STATIC void player__skate_clear_mechanics( player_instance *player );
189 VG_STATIC void player__skate_reset_animator( player_instance *player );
190 VG_STATIC void player__approximate_best_trajectory( player_instance *player );
191 #endif /* PLAYER_SKATE_H */