X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=player_skate.h;h=3d1a9806c93fb70d3dc01d74daa2832199e7ce8d;hb=8a31c1ffcb632b9b6d1702332f0d75d609c0a87b;hp=b09c68a79334ee64c897328178424c4003405123;hpb=a528498841a151efbd38cddcc9f09a5f39dbbd19;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/player_skate.h b/player_skate.h index b09c68a..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,30 +74,55 @@ struct player_skate{ v3f air_init_v, air_init_co; - v4f smoothed_rotation; - 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 * --------------------------------------------------------------*/ @@ -121,7 +149,6 @@ struct player_skate{ k_skate_sample_metal_scrape_generic } main_sample_type; - player_pose holdout; /* * Physics @@ -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,8 +325,8 @@ 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 );