X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=player_common.c;h=21d52aa76871c6f978d10f3bda4334ae614e5671;hb=8c376ed2e4021a18b0a6c6e800109d67ad09d198;hp=f058b56569ac2bb9b7aa4c20c7a6e192fb6545b5;hpb=f99902f513b0ad606437bf32de47405dd4ea5f98;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/player_common.c b/player_common.c index f058b56..21d52aa 100644 --- a/player_common.c +++ b/player_common.c @@ -89,17 +89,17 @@ VG_STATIC void player__cam_iterate( player_instance *player ) player->cam_velocity_influence_smooth = vg_lerpf( player->cam_velocity_influence_smooth, player->cam_velocity_influence, - vg.frame_delta * 8.0f ); + vg.time_frame_delta * 8.0f ); player->cam_velocity_coefficient_smooth = vg_lerpf( player->cam_velocity_coefficient_smooth, player->cam_velocity_coefficient, - vg.frame_delta * 8.0f ); + vg.time_frame_delta * 8.0f ); player->cam_velocity_constant_smooth = vg_lerpf( player->cam_velocity_constant_smooth, player->cam_velocity_constant, - vg.frame_delta * 8.0f ); + vg.time_frame_delta * 8.0f ); enum camera_mode target_mode = player->camera_mode; @@ -109,16 +109,16 @@ VG_STATIC void player__cam_iterate( player_instance *player ) player->camera_type_blend = vg_lerpf( player->camera_type_blend, (target_mode == k_cam_firstperson)? 1.0f: 0.0f, - 5.0f * vg.frame_delta ); + 5.0f * vg.time_frame_delta ); v3_lerp( player->fpv_viewpoint_smooth, player->fpv_viewpoint, - vg.frame_delta * 8.0f, player->fpv_viewpoint_smooth ); + vg.time_frame_delta * 8.0f, player->fpv_viewpoint_smooth ); v3_lerp( player->fpv_offset_smooth, player->fpv_offset, - vg.frame_delta * 8.0f, player->fpv_offset_smooth ); + vg.time_frame_delta * 8.0f, player->fpv_offset_smooth ); v3_lerp( player->tpv_offset_smooth, player->tpv_offset, - vg.frame_delta * 8.0f, player->tpv_offset_smooth ); + vg.time_frame_delta * 8.0f, player->tpv_offset_smooth ); /* fov -- simple blend */ float fov_skate = vg_lerpf( 97.0f, 135.0f, cl_fov ), @@ -139,7 +139,7 @@ VG_STATIC void player__cam_iterate( player_instance *player ) /* angles */ v3f velocity_angles; - v3_lerp( player->cam_velocity_smooth, player->rb.v, 4.0f*vg.frame_delta, + v3_lerp( player->cam_velocity_smooth, player->rb.v, 4.0f*vg.time_frame_delta, player->cam_velocity_smooth ); v3f velocity_local; @@ -167,7 +167,7 @@ VG_STATIC void player__cam_iterate( player_instance *player ) * it is done in the local basis then transformed back */ v3f future; - v3_muls( player->rb.v, 0.4f*vg.frame_delta, future ); + v3_muls( player->rb.v, 0.4f*vg.time_frame_delta, future ); m3x3_mulv( player->invbasis, future, future ); v3f camera_follow_dir = @@ -193,7 +193,7 @@ VG_STATIC void player__cam_iterate( player_instance *player ) v3f pco; v4f pq; rb_extrapolate( &player->rb, pco, pq ); - v3_lerp( player->tpv_lpf, pco, 20.0f*vg.frame_delta, player->tpv_lpf ); + v3_lerp( player->tpv_lpf, pco, 20.0f*vg.time_frame_delta, player->tpv_lpf ); /* now move into world */ @@ -213,8 +213,8 @@ VG_STATIC void player__cam_iterate( player_instance *player ) float Fd = -player->cam_land_punch_v * k_cam_damp, Fs = -player->cam_land_punch * k_cam_spring; - player->cam_land_punch += player->cam_land_punch_v * vg.frame_delta; - player->cam_land_punch_v += ( Fd + Fs ) * vg.frame_delta; + player->cam_land_punch += player->cam_land_punch_v * vg.time_frame_delta; + player->cam_land_punch_v += ( Fd + Fs ) * vg.time_frame_delta; player->cam.angles[1] += player->cam_land_punch; /* override camera */