X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=player_animation.h;h=594f282c3be7e8917bcb111a98d84080dbc17c1d;hb=47941822dae18a018c985847b052e70214a3ccc6;hp=ea7d566468bbc3463c750c8ef67249b1aeaafcbc;hpb=821f3f664586e72151e95127572677bc73bf6f02;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/player_animation.h b/player_animation.h index ea7d566..594f282 100644 --- a/player_animation.h +++ b/player_animation.h @@ -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;