4 #include "player_api.h"
8 typedef struct jump_info jump_info
;
11 struct player_skate_state
{
14 k_skate_activity_air_to_grind
,
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_metallic
,
20 k_skate_activity_grind_back50
,
21 k_skate_activity_grind_front50
,
22 k_skate_activity_grind_5050
30 f32 reverse
, slip
, delayed_slip_dir
;
38 v3f trick_vel
, /* measured in units of TAU/s */
39 trick_euler
; /* measured in units of TAU */
40 v3f trick_residualv
, /* spring */
46 k_trick_type_kickflip
,
62 int charging_jump
, jump_dir
;
72 /* initial launch conditions */
79 v4f smoothed_rotation
;
83 struct player_skate_animator
{
121 f32 push_time
, jump_time
;
128 * --------------------------------------------------------------*/
129 struct skeleton_anim
*anim_stand
, *anim_highg
, *anim_slide
,
130 *anim_air
, *anim_grind
, *anim_grind_jump
,
131 *anim_push
, *anim_push_reverse
,
132 *anim_ollie
, *anim_ollie_reverse
,
133 *anim_grabs
, *anim_stop
;
135 /* vectors representing the direction of the axels in localspace */
138 audio_channel
*aud_main
, *aud_slide
, *aud_air
;
139 enum mdl_surface_prop surface
, audio_surface
;
141 int wheel_contacts
[2];
142 float sample_change_cooldown
;
145 k_skate_sample_concrete
,
147 k_skate_sample_concrete_scrape_metal
,
148 k_skate_sample_concrete_scrape_wood
,
149 k_skate_sample_metal_scrape_generic
155 * ----------------------------------------------------
158 float substep
, substep_delta
;
172 enum prediction_type
{
183 u32 possible_jump_count
;
190 float grind_strength
;
199 struct player_skate_animator_q
{
230 i8 steer
[2], grab
[2];
235 i8 push_time
, jump_time
;
242 k_friction_lat
= 12.0f
,
243 k_friction_resistance
= 0.01f
,
245 k_max_push_speed
= 16.0f
,
246 k_push_accel
= 10.0f
,
247 k_push_cycle_rate
= 8.0f
,
249 k_steer_ground
= 2.5f
,
252 k_jump_charge_speed
= (1.0f
/0.4f
),
257 k_cog_mass_ratio
= 0.9f
,
259 k_mmthrow_steer
= 1.0f
,
260 k_mmthrow_scale
= 6.0f
,
261 k_mmcollect_lat
= 2.0f
,
262 k_mmcollect_vert
= 0.0f
,
264 k_spring_angular
= 1.0f
,
266 k_spring_force
= 300.0f
,
267 k_spring_dampener
= 5.0f
,
269 k_grind_spring
= 50.0f
,
270 k_grind_aligment
= 10.0f
,
271 k_grind_dampener
= 5.0f
,
273 k_surface_spring
= 100.0f
,
274 k_surface_dampener
= 40.0f
,
275 k_manul_spring
= 200.0f
,
276 k_manul_dampener
= 30.0f
,
277 k_board_interia
= 8.0f
,
279 k_grind_decayxy
= 30.0f
,
280 k_grind_axel_min_vel
= 1.0f
,
281 k_grind_axel_max_angle
= 0.95f
, /* cosine(|a|) */
282 k_grind_axel_max_vangle
= 0.4f
,
283 k_grind_max_friction
= 3.0f
,
284 k_grind_max_edge_angle
= 0.97f
,
286 k_board_length
= 0.45f
,
287 k_board_width
= 0.13f
,
288 k_board_end_radius
= 0.1f
,
289 k_board_radius
= 0.14f
, /* 0.07 */
291 k_grind_balance
= -40.0f
;
293 VG_STATIC
void player__skate_register(void)
295 VG_VAR_F32( k_grind_dampener
, flags
=VG_VAR_CHEAT
);
296 VG_VAR_F32( k_grind_spring
, flags
=VG_VAR_CHEAT
);
297 VG_VAR_F32( k_grind_aligment
, flags
=VG_VAR_CHEAT
);
298 VG_VAR_F32( k_surface_spring
, flags
=VG_VAR_CHEAT
);
299 VG_VAR_F32( k_surface_dampener
, flags
=VG_VAR_CHEAT
);
300 VG_VAR_F32( k_board_interia
, flags
=VG_VAR_CHEAT
);
301 VG_VAR_F32( k_grind_decayxy
, flags
=VG_VAR_CHEAT
);
302 VG_VAR_F32( k_grind_axel_min_vel
, flags
=VG_VAR_CHEAT
);
303 VG_VAR_F32( k_grind_axel_max_angle
, flags
=VG_VAR_CHEAT
);
304 VG_VAR_F32( k_grind_max_friction
, flags
=VG_VAR_CHEAT
);
305 VG_VAR_F32( k_grind_balance
, flags
=VG_VAR_CHEAT
);
306 VG_VAR_F32( k_friction_lat
, flags
=VG_VAR_CHEAT
);
308 VG_VAR_F32( k_cog_spring
, flags
=VG_VAR_CHEAT
);
309 VG_VAR_F32( k_cog_damp
, flags
=VG_VAR_CHEAT
);
310 VG_VAR_F32( k_cog_mass_ratio
, flags
=VG_VAR_CHEAT
);
312 VG_VAR_F32( k_spring_force
, flags
=VG_VAR_CHEAT
);
313 VG_VAR_F32( k_spring_dampener
, flags
=VG_VAR_CHEAT
);
314 VG_VAR_F32( k_spring_angular
, flags
=VG_VAR_CHEAT
);
316 VG_VAR_F32( k_mmthrow_scale
, flags
=VG_VAR_CHEAT
);
317 VG_VAR_F32( k_mmcollect_lat
, flags
=VG_VAR_CHEAT
);
318 VG_VAR_F32( k_mmcollect_vert
, flags
=VG_VAR_CHEAT
);
319 VG_VAR_F32( k_mmdecay
, flags
=VG_VAR_CHEAT
);
320 VG_VAR_F32( k_mmthrow_steer
, flags
=VG_VAR_CHEAT
);
323 VG_STATIC
void player__skate_bind ( player_instance
*player
);
324 VG_STATIC
void player__skate_pre_update ( player_instance
*player
);
325 VG_STATIC
void player__skate_update ( player_instance
*player
);
326 VG_STATIC
void player__skate_post_update ( player_instance
*player
);
327 VG_STATIC
void player__skate_im_gui ( player_instance
*player
);
328 VG_STATIC
void player__skate_animate ( player_instance
*player
);
329 VG_STATIC
void player__skate_pose( player_instance
*player
, player_pose
*pose
);
330 VG_STATIC
void player__skate_post_animate ( player_instance
*player
);
331 VG_STATIC
void player__skate_reset ( player_instance
*player
,
334 VG_STATIC
void player__skate_clear_mechanics( player_instance
*player
);
335 VG_STATIC
void player__skate_reset_animator( player_instance
*player
);
336 VG_STATIC
void player__approximate_best_trajectory( player_instance
*player
);
338 #endif /* PLAYER_SKATE_H */