small compression
[carveJwlIkooP6JGAAIwe30JlM.git] / player_walk.h
index a03e9a721d190fe6903849c8f764a9890457b6dc..a8dd9facd0dc526d2fecf94e1adac836fe37de11 100644 (file)
@@ -24,7 +24,9 @@ struct player_walk{
          k_walk_activity_air,
          k_walk_activity_ground,
          k_walk_activity_sleep,
-         k_walk_activity_lockedmove
+         k_walk_activity_lockedmove,
+         k_walk_activity_sit,
+         k_walk_activity_sit_up
       }
       activity;
 
@@ -32,7 +34,8 @@ struct player_walk{
          k_walk_outro_none,
          k_walk_outro_jump_to_air,
          k_walk_outro_drop_in,
-         k_walk_outro_regular
+         k_walk_outro_regular,
+         k_walk_outro_max
       }
       outro_type;
       double outro_start_time;
@@ -41,6 +44,7 @@ struct player_walk{
       f64 jump_input_time;
 
       f32 walk_timer;
+      f32 sit_t;
       int step_phase;
    }
    state;
@@ -49,7 +53,8 @@ struct player_walk{
 
    enum mdl_surface_prop surface;
    struct skeleton_anim *anim_walk, *anim_run, *anim_idle, *anim_jump,
-                        *anim_jump_to_air, *anim_drop_in, *anim_intro;
+                        *anim_jump_to_air, *anim_drop_in, *anim_intro,
+                        *anim_sit;
 
    struct player_walk_animator {
       v3f root_co;
@@ -58,12 +63,13 @@ struct player_walk{
           run,
           walk;
 
-      f32 walk_timer;
+      f32 walk_timer, yaw, pitch;
 
       v3f foot_anchor;
       enum walk_outro outro_type;
       f32 outro_t,
-          commit_t;
+          commit_t,
+          sit_t;
    }
    animator;
 }
@@ -76,7 +82,10 @@ static f32
    k_walk_accel            = 10.0f,
    k_walk_air_accel        = 7.0f,
    k_walk_friction         = 10.0f,
-   k_walk_step_height      = 0.2f;
+   k_walk_step_height      = 0.2f,
+
+   k_sit_yaw_limit         = VG_PIf/1.7f,
+   k_sit_pitch_limit       = VG_PIf/4.0f;
 
 static void player__walk_register(void){
    VG_VAR_F32( k_walkspeed,      flags=VG_VAR_CHEAT );