X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=player_skate.h;h=3d1a9806c93fb70d3dc01d74daa2832199e7ce8d;hb=5bfb36032928ba9f8d12e72961af68bfab9ea648;hp=c3ec0e6a81942392e99b43b5043c2b6546f2b66a;hpb=9eb3de757a997becb8406417a4bf613f4cb04900;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/player_skate.h b/player_skate.h index c3ec0e6..3d1a980 100644 --- a/player_skate.h +++ b/player_skate.h @@ -37,6 +37,9 @@ struct player_skate{ v3f trick_vel, /* measured in units of TAU/s */ trick_euler; /* measured in units of TAU */ + v3f trick_residualv, /* spring */ + trick_residuald; + float trick_time; enum trick_type{ k_trick_type_none, @@ -71,27 +74,55 @@ struct player_skate{ v3f air_init_v, air_init_co; + float land_dist; + v3f land_normal; v4f smoothed_rotation; + } + state; + + struct player_skate_animator { + v3f root_co; + v4f root_q; + + v3f offset, + local_cog; + + f32 slide, + z, + x, + fly, + grind, + grind_balance, + stand, + push, + jump, + airdir, + weight, + trick_foot, + slap, + subslap, + reverse, + delayed_slip_dir, + grabbing; - /* animator controls which require persistence */ - v3f board_trick_residualv, - board_trick_residuald; - f32 blend_slide, - blend_z, - blend_x, - blend_fly, - blend_grind, - blend_grind_balance, - blend_stand, - blend_push, - blend_jump, - blend_airdir, - blend_weight, - blend_trick_foot, - subslap; v2f wobble; + f32 foot_offset[2]; + + v4f qfixuptotal; + v4f qflip; + + v3f board_euler; + f32 board_lean; + v2f steer, grab; + + f32 jump_charge; + + /* linear anims */ + f32 push_time, jump_time; + u8 jump_dir; + u8 trick_type; } - state; + animator; /* animation /audio * --------------------------------------------------------------*/ @@ -118,7 +149,6 @@ struct player_skate{ k_skate_sample_metal_scrape_generic } main_sample_type; - player_pose holdout; /* * Physics @@ -152,9 +182,6 @@ struct player_skate{ possible_jumps[36]; u32 possible_jump_count; - float land_dist; - v3f land_normal; - v3f surface_picture, weight_distribution, grind_vec, @@ -169,6 +196,48 @@ struct player_skate{ u32 limit_count; }; +struct player_skate_animator_q { + v3f root_co; + v4f root_q; + + i8 offset[3]; + i8 local_cog[3]; + i8 slide, + z, + x, + fly, + grind, + grind_balance, + stand, + push, + jump, + airdir, + weight, + trick_foot, + slap, + subslap, + reverse, + delayed_slip_dir, + grabbing; + + i8 wobble[2]; + i8 foot_offset[2]; + + i16 qfixuptotal[4]; + i16 qflip; + + i16 board_euler[3]; + i8 steer[2], grab[2]; + + u8 jump_charge; + + /* linear anims */ + i8 push_time, jump_time; + u8 jump_dir; + u8 trick_type; +} +animator; + VG_STATIC float k_friction_lat = 12.0f, k_friction_resistance = 0.01f, @@ -256,14 +325,14 @@ VG_STATIC void player__skate_pre_update ( player_instance *player ); VG_STATIC void player__skate_update ( player_instance *player ); VG_STATIC void player__skate_post_update ( player_instance *player ); VG_STATIC void player__skate_im_gui ( player_instance *player ); -VG_STATIC void player__skate_animate ( player_instance *player, - player_animation *anim ); +VG_STATIC void player__skate_animate ( player_instance *player ); +VG_STATIC void player__skate_pose( player_instance *player, player_pose *pose ); VG_STATIC void player__skate_post_animate ( player_instance *player ); VG_STATIC void player__skate_reset ( player_instance *player, ent_spawn *rp ); -VG_STATIC void player__skate_restore( player_instance *player ); VG_STATIC void player__skate_clear_mechanics( player_instance *player ); VG_STATIC void player__skate_reset_animator( player_instance *player ); VG_STATIC void player__approximate_best_trajectory( player_instance *player ); + #endif /* PLAYER_SKATE_H */