From 3a34a9a98d063cf957201218a7c73deb3847b8b5 Mon Sep 17 00:00:00 2001 From: divverent Date: Tue, 20 Jul 2010 17:16:27 +0000 Subject: [PATCH] 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 ::stable-branch::merge=b0c31bd70112993cbed12a7afe21e37695d5eaa4 --- view.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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. -- 2.39.2