From: divverent Date: Mon, 12 Jul 2010 18:04:07 +0000 (+0000) Subject: Set better defaults and fix final comments. I think this should be ready for testing... X-Git-Tag: xonotic-v0.1.0preview~230^2~193 X-Git-Url: http://git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=commitdiff_plain;h=b439868ab86c397b70f15db398787bae83b01cc6 Set better defaults and fix final comments. I think this should be ready for testing and merging if approved. NOTE: If anyone wishes to see the effect better, set cl_bobroll to a higher value (eg. 0.01) From: MirceaKitsune git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10285 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/darkplaces.txt b/darkplaces.txt index ae8dc9b3..54bc457f 100644 --- a/darkplaces.txt +++ b/darkplaces.txt @@ -396,6 +396,9 @@ cl_beams_polygons 1 use beam p cl_beams_quakepositionhack 1 makes your lightning gun appear to fire from your waist (as in Quake and QuakeWorld) cl_bob 0.02 view bobbing amount cl_bobcycle 0.6 view bobbing speed +cl_bobroll 0.001 view rolling amount +cl_bobrollcycle 0.75 view rolling speed +cl_bobrollairtime 0.05 how fast the view rolls 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 7d96c8c6..55a8a0c0 100644 --- a/view.c +++ b/view.c @@ -39,8 +39,8 @@ cvar_t cl_rollangle = {0, "cl_rollangle", "2.0", "how much to tilt the view when cvar_t cl_bob = {CVAR_SAVE, "cl_bob","0.02", "view bobbing amount"}; cvar_t cl_bobcycle = {CVAR_SAVE, "cl_bobcycle","0.6", "view bobbing speed"}; cvar_t cl_bobup = {CVAR_SAVE, "cl_bobup","0.5", "view bobbing adjustment that makes the up or down swing of the bob last longer"}; -cvar_t cl_bobroll = {CVAR_SAVE, "cl_bobroll","0.01", "view rolling amount"}; -cvar_t cl_bobrollcycle = {CVAR_SAVE, "cl_bobrollcycle","0.5", "view rolling speed"}; +cvar_t cl_bobroll = {CVAR_SAVE, "cl_bobroll","0.001", "view rolling amount"}; +cvar_t cl_bobrollcycle = {CVAR_SAVE, "cl_bobrollcycle","0.75", "view rolling speed"}; cvar_t cl_bobrollairtime = {CVAR_SAVE, "cl_bobrollairtime","0.05", "how fast the view rolls 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"}; @@ -666,9 +666,6 @@ void V_CalcRefdef (void) } // view rolling code - // TODO 1 (DONE): Make it work around the center rather than the left side - // TODO 2 (DONE): Make the roll smoothly return to 0 when you stop touching the ground, rather than instantly - // TODO 3: Write cvars to darkplaces.txt, set better defaults and possibly disable by default once the first TODOs are ready if (cl_bobroll.value && cl_bobrollcycle.value) { cycle2 = cl.time / cl_bobrollcycle.value; @@ -678,6 +675,8 @@ void V_CalcRefdef (void) else cycle2 = sin(M_PI + M_PI * (cycle2-0.5)/0.5); + // 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.bobroll_airtime = 1; else