From b341066ac7cfd9db40ee7c3bd4c8b446ddd017ef Mon Sep 17 00:00:00 2001 From: divverent Date: Mon, 12 Jul 2010 18:09:03 +0000 Subject: [PATCH] Place / move a speed bound, to avoid bobbing getting stronger if sv_maxspeed is over 400 From: MirceaKitsune git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10310 d7cf8633-e32d-0410-b094-e92efae38249 ::stable-branch::merge=e11d48d5becde5e2ad87efd230ac999b2780336a --- view.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/view.c b/view.c index 2f7e17f8..276e9091 100644 --- a/view.c +++ b/view.c @@ -638,8 +638,10 @@ void V_CalcRefdef (void) VectorAdd(vieworg, gunorg, gunorg); VectorAdd(viewangles, gunangles, gunangles); + // bounded XY speed calculation, used by several effects below + xyspeed = bound (0, sqrt(cl.velocity[0]*cl.velocity[0] + cl.velocity[1]*cl.velocity[1]), 400); + // vertical view bobbing code - xyspeed = sqrt(cl.velocity[0]*cl.velocity[0] + cl.velocity[1]*cl.velocity[1]); if (cl_bob.value && cl_bobcycle.value) { // LordHavoc: this code is *weird*, but not replacable (I think it @@ -745,7 +747,7 @@ void V_CalcRefdef (void) t *= 5; } - bspeed = bound (0, xyspeed, 400) * 0.01f; + bspeed = xyspeed * 0.01f; AngleVectors (gunangles, forward, right, up); bob = bspeed * cl_bobmodel_side.value * cl_viewmodel_scale.value * sin (s) * t; VectorMA (gunorg, bob, right, gunorg); -- 2.39.2