From: divverent Date: Tue, 20 Jul 2010 17:16:27 +0000 (+0000) Subject: Second change: Use cos for the horizontal view bobbing while leaving sin for the... X-Git-Tag: xonotic-v0.1.0preview~230^2~125 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b0c31bd70112993cbed12a7afe21e37695d5eaa4;p=xonotic%2Fdarkplaces.git Second change: Use cos for the horizontal view bobbing while leaving sin for the vertical (old) one. This makes the view bobbing look rounder and prettier when both are enabled. From: MirceaKitsune git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10353 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/view.c b/view.c index 9e4a7f05..b72bd03e 100644 --- a/view.c +++ b/view.c @@ -680,9 +680,9 @@ void V_CalcRefdef (void) cycle = cl.time / cl_bob2cycle.value; cycle -= (int) cycle; if (cycle < 0.5) - cycle = sin(M_PI * cycle / 0.5); + cycle = cos(M_PI * cycle / 0.5); // cos looks better here with the other view bobbing using sin else - cycle = sin(M_PI + M_PI * (cycle-0.5)/0.5); + cycle = cos(M_PI + M_PI * (cycle-0.5)/0.5); bob = bound(0, cl_bob2.value, 0.05) * cycle; // this value slowly decreases from 1 to 0 when we stop touching the ground.