well yeah i guess
[carveJwlIkooP6JGAAIwe30JlM.git] / player_animation.h
index ea7d566468bbc3463c750c8ef67249b1aeaafcbc..594f282c3be7e8917bcb111a98d84080dbc17c1d 100644 (file)
@@ -7,7 +7,7 @@
 
 #include "player.h"
 
-static void player_animate_offboard(void)
+VG_STATIC void player_animate_offboard(void)
 {
    {
       float fly = player.phys.in_air,
@@ -83,7 +83,7 @@ static void player_animate_offboard(void)
    skeleton_debug( &player.mdl.sk );
 }
 
-static void player_animate(void)
+VG_STATIC void player_animate(void)
 {
    struct player_phys *phys = &player.phys;
    rb_extrapolate_transform( &player.phys.rb, player.visual_transform );
@@ -139,8 +139,8 @@ static void player_animate(void)
    offset[1] *= -0.3f;
    offset[2] *= 0.01f;
 
-   offset[0] = vg_clampf( offset[0], -0.8f, 0.8f );
-   offset[1] = vg_clampf( offset[1], -0.5f, 0.0f );
+   offset[0]=vg_clampf(offset[0],-0.8f,0.8f)*(1.0f-fabsf(player.fslide)*0.9f);
+   offset[1]=vg_clampf(offset[1],-0.5f,0.0f);
 
    /* 
     * Animation blending
@@ -245,7 +245,7 @@ static void player_animate(void)
 
    skeleton_lerp_pose( sk, ground_pose, air_pose, player.ffly, apose );
 
-   float add_grab_mod = 1.0f - player.ffly*phys->grab;
+   float add_grab_mod = 1.0f - player.ffly;//*phys->grab;
 
    /* additive effects */
    {
@@ -274,7 +274,7 @@ static void player_animate(void)
    skeleton_debug( &player.mdl.sk );
 }
 
-static void player_animate_death_cam(void)
+VG_STATIC void player_animate_death_cam(void)
 {
    v3f delta;
    v3f head_pos;
@@ -300,14 +300,17 @@ static void player_animate_death_cam(void)
    if( ray_world( sample, (v3f){0.0f,-1.0f,0.0f}, &hit ))
       v3_add( hit.pos, min_height, player.camera_pos );
 
-   player.camera_pos[1] = 
-      vg_maxf( wrender.height + 2.0f, player.camera_pos[1] );
+   if( world.water.enabled )
+   {
+      player.camera_pos[1] = 
+         vg_maxf( world.water.height + 2.0f, player.camera_pos[1] );
+   }
 
    player.angles[0] = atan2f( delta[0], -delta[2] ); 
    player.angles[1] = -asinf( delta[1] );
 }
 
-static void player_animate_camera(void)
+VG_STATIC void player_animate_camera(void)
 {
    struct player_phys *phys = &player.phys;