From fdb2376a03749b901ff83f28be54b6dd6caf4b72 Mon Sep 17 00:00:00 2001 From: hgn Date: Sat, 1 Jul 2023 00:12:10 +0100 Subject: [PATCH] review: player_common.h --- player.h | 1 + player_common.c | 3 ++- player_common.h | 1 - player_skate.c | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/player.h b/player.h index ec24b86..e5f3dc7 100644 --- a/player.h +++ b/player.h @@ -41,6 +41,7 @@ struct player_instance{ v3f fpv_offset, /* expressed relative to rigidbody */ tpv_offset, + tpv_offset_extra, fpv_viewpoint, /* expressed relative to neck bone inverse final */ fpv_offset_smooth, fpv_viewpoint_smooth, diff --git a/player_common.c b/player_common.c index cb83d53..5e1c88d 100644 --- a/player_common.c +++ b/player_common.c @@ -75,7 +75,8 @@ VG_STATIC void player__cam_iterate( player_instance *player ) #endif v3_copy( (v3f){0.0f,0.0f,0.0f}, player->fpv_offset ); v3_copy( (v3f){0.0f,1.4f,0.0f}, player->tpv_offset ); - v3_add( TEMP_TPV_EXTRA, player->tpv_offset, player->tpv_offset ); + v3_add( player->tpv_offset_extra, player->tpv_offset, + player->tpv_offset ); } player->cam_velocity_constant = 0.25f; diff --git a/player_common.h b/player_common.h index 1b6ec71..a83e39a 100644 --- a/player_common.h +++ b/player_common.h @@ -3,7 +3,6 @@ #include "player_api.h" -static v3f TEMP_TPV_EXTRA; /* TODO: what? */ static float k_cam_spring = 20.0f, k_cam_damp = 6.7f, diff --git a/player_skate.c b/player_skate.c index 8598f20..2c38f7e 100644 --- a/player_skate.c +++ b/player_skate.c @@ -2714,7 +2714,7 @@ VG_STATIC void player__skate_animate( player_instance *player, offset[0]=vg_clampf(offset[0],-0.8f,0.8f)*(1.0f-fabsf(s->blend_slide)*0.9f); offset[1]=vg_clampf(offset[1],-0.5f,0.0f); - v3_muls( offset, 0.3f, TEMP_TPV_EXTRA ); + v3_muls( offset, 0.3f, player->tpv_offset_extra ); /* * Animation blending -- 2.25.1