From: divverent Date: Mon, 12 Jul 2010 18:07:55 +0000 (+0000) Subject: Tweak a definition and cvar X-Git-Tag: xonotic-v0.1.0preview~230^2~174 X-Git-Url: https://de.git.xonotic.org/?a=commitdiff_plain;h=0a45cf0d32ebe9d360a5cb2a47a92878c037d86c;hp=8e6ab24cdf43e59254de713c9103a3760f545926;p=xonotic%2Fdarkplaces.git Tweak a definition and cvar From: MirceaKitsune git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10304 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/client.h b/client.h index 5e00c011..412d00ee 100644 --- a/client.h +++ b/client.h @@ -977,9 +977,7 @@ typedef struct client_state_s qboolean oldonground; double lastongroundtime; double hitgroundtime; - - // used by bob2 - float bob2_airtime; + float bob2_smooth; // don't change view angle, full screen, etc int intermission; diff --git a/darkplaces.txt b/darkplaces.txt index e73aba1c..46d793ea 100644 --- a/darkplaces.txt +++ b/darkplaces.txt @@ -398,7 +398,7 @@ cl_bob 0.02 view bobbi cl_bobcycle 0.6 view bobbing speed cl_bob2 0 sideway view bobbing amount cl_bob2cycle 0.6 sideway view bobbing speed -cl_bob2airtime 0.05 how fast the view goes back when you stop touching the ground +cl_bob2smooth 0.05 how fast the view goes back when you stop touching the ground cl_bobmodel 1 enables gun bobbing cl_bobmodel_side 0.05 gun bobbing sideways sway amount cl_bobmodel_speed 7 gun bobbing speed diff --git a/view.c b/view.c index 9c897de7..732c02ac 100644 --- a/view.c +++ b/view.c @@ -42,7 +42,7 @@ cvar_t cl_bobup = {CVAR_SAVE, "cl_bobup","0.5", "view bobbing adjustment that ma cvar_t cl_bob2 = {CVAR_SAVE, "cl_bob2","0", "sideway view bobbing amount"}; cvar_t cl_bob2cycle = {CVAR_SAVE, "cl_bob2cycle","0.6", "sideway view bobbing speed"}; cvar_t cl_bob2up = {CVAR_SAVE, "cl_bob2up","0.5", "view bobbing adjustment that makes the side swing of the bob last longer"}; -cvar_t cl_bob2airtime = {CVAR_SAVE, "cl_bob2airtime","0.05", "how fast the view goes back when you stop touching the ground"}; +cvar_t cl_bob2smooth = {CVAR_SAVE, "cl_bob2smooth","0.05", "how fast the view goes back when you stop touching the ground"}; cvar_t cl_bobmodel = {CVAR_SAVE, "cl_bobmodel", "1", "enables gun bobbing"}; cvar_t cl_bobmodel_side = {CVAR_SAVE, "cl_bobmodel_side", "0.15", "gun bobbing sideways sway amount"}; cvar_t cl_bobmodel_up = {CVAR_SAVE, "cl_bobmodel_up", "0.06", "gun bobbing upward movement amount"}; @@ -686,20 +686,20 @@ void V_CalcRefdef (void) // this value slowly decreases from 1 to 0 when we stop touching the ground. // The cycle is later multiplied with it so the view smooths back to normal if (cl.onground && !cl.cmd.jump) // also block the effect while the jump button is pressed, to avoid twitches when bunny-hopping - cl.bob2_airtime = 1; + cl.bob2_smooth = 1; else { - if(cl.bob2_airtime > 0) - cl.bob2_airtime -= bound(0, cl_bob2airtime.value, 1); + if(cl.bob2_smooth > 0) + cl.bob2_smooth -= bound(0, cl_bob2smooth.value, 1); else - cl.bob2_airtime = 0; + cl.bob2_smooth = 0; } // now we calculate the side and front of the player, between the X and Y axis AngleVectors(viewangles, forward, right, up); // now the speed based on these angles. The division is for mathing vertical bobbing intensity - side = DotProduct (cl.velocity, right) / 1000 * cl.bob2_airtime; - front = DotProduct (cl.velocity, forward) / 1000 * cl.bob2_airtime; + side = DotProduct (cl.velocity, right) / 1000 * cl.bob2_smooth; + front = DotProduct (cl.velocity, forward) / 1000 * cl.bob2_smooth; forward[0] *= bob; forward[1] *= bob; right[0] *= bob; @@ -954,7 +954,7 @@ void V_Init (void) Cvar_RegisterVariable (&cl_bob2); Cvar_RegisterVariable (&cl_bob2cycle); Cvar_RegisterVariable (&cl_bob2up); - Cvar_RegisterVariable (&cl_bob2airtime); + Cvar_RegisterVariable (&cl_bob2smooth); Cvar_RegisterVariable (&cl_bobmodel); Cvar_RegisterVariable (&cl_bobmodel_side); Cvar_RegisterVariable (&cl_bobmodel_up);