From 34d5ad2fb537f3247a626f1922c223461743d4c5 Mon Sep 17 00:00:00 2001 From: divverent Date: Fri, 16 Jul 2010 22:25:19 +0000 Subject: [PATCH] Minimum necessary speed for fall-bobbing to occur From: MirceaKitsune git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10346 d7cf8633-e32d-0410-b094-e92efae38249 ::stable-branch::merge=aa0529558f794a9b2aff043357b97eb0ea80e36f --- darkplaces.txt | 1 + view.c | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/darkplaces.txt b/darkplaces.txt index 81c82c68..c68c9202 100644 --- a/darkplaces.txt +++ b/darkplaces.txt @@ -401,6 +401,7 @@ cl_bob2cycle 0.6 sideways v cl_bob2smooth 0.05 how fast the view goes back when you stop touching the ground cl_bobfall 0 how much the view swings down when falling (influenced by the speed you hit the ground with) cl_bobfallcycle 0.25 speed of the bobfall swing +cl_bobfallspeed 200 necessary amount of speed for bob-falling to occur 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 0848d002..fd362e5c 100644 --- a/view.c +++ b/view.c @@ -42,8 +42,9 @@ cvar_t cl_bobup = {CVAR_SAVE, "cl_bobup","0.5", "view bobbing adjustment that ma cvar_t cl_bob2 = {CVAR_SAVE, "cl_bob2","0", "sideways view bobbing amount"}; cvar_t cl_bob2cycle = {CVAR_SAVE, "cl_bob2cycle","0.6", "sideways view bobbing speed"}; 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_bobfall = {CVAR_SAVE, "cl_bobfall","0.1", "how much the view swings down when falling (influenced by the speed you hit the ground with)"}; +cvar_t cl_bobfall = {CVAR_SAVE, "cl_bobfall","0.05", "how much the view swings down when falling (influenced by the speed you hit the ground with)"}; cvar_t cl_bobfallcycle = {CVAR_SAVE, "cl_bobfallcycle","0.025", "speed of the bobfall swing"}; +cvar_t cl_bobfallminspeed = {CVAR_SAVE, "cl_bobfallminspeed","200", "necessary amount of speed for bob-falling to occur"}; 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"}; @@ -722,7 +723,10 @@ void V_CalcRefdef (void) if (!cl.onground) { cl.bobfall_speed = bound(-400, cl.velocity[2], 0) * bound(0, cl_bobfall.value, 0.1); - cl.bobfall_swing = 1; + if (cl.velocity[2] < -cl_bobfallminspeed.value) + cl.bobfall_swing = 1; + else + cl.bobfall_swing = 0; } else { @@ -976,6 +980,7 @@ void V_Init (void) Cvar_RegisterVariable (&cl_bob2smooth); Cvar_RegisterVariable (&cl_bobfall); Cvar_RegisterVariable (&cl_bobfallcycle); + Cvar_RegisterVariable (&cl_bobfallminspeed); Cvar_RegisterVariable (&cl_bobmodel); Cvar_RegisterVariable (&cl_bobmodel_side); Cvar_RegisterVariable (&cl_bobmodel_up); -- 2.39.2