review save method
[carveJwlIkooP6JGAAIwe30JlM.git] / player_skate.h
index eca4582b5943ebb4c9d960822734b24ed1ad1e0b..3d1a9806c93fb70d3dc01d74daa2832199e7ce8d 100644 (file)
@@ -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,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 );