From: divverent Date: Fri, 16 Jul 2010 22:24:17 +0000 (+0000) Subject: Make the view slowly go back after hitting the ground. We need to do the same for... X-Git-Tag: xonotic-v0.1.0preview~334 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e79808a163183be1125cb97f39da6da021f4e2c6;p=xonotic%2Fdarkplaces.git Make the view slowly go back after hitting the ground. We need to do the same for both up and down. Also use reasonable values until cvars are done. From: MirceaKitsune git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10337 d7cf8633-e32d-0410-b094-e92efae38249 ::stable-branch::merge=f10f49777267ac15108f2df78cc555583856f136 --- diff --git a/view.c b/view.c index 0bcf9b55..78d9013b 100644 --- a/view.c +++ b/view.c @@ -716,10 +716,19 @@ void V_CalcRefdef (void) // TEST!!! + float ground_hit_target; if (!cl.onground) - cl.ground_hit_speed = cl.velocity[2]; + cl.ground_hit_speed = cl.velocity[2] * 0.1; else + { + if(cl.ground_hit_speed > ground_hit_target) + cl.ground_hit_speed -= 0.1; + if(cl.ground_hit_speed < ground_hit_target) + cl.ground_hit_speed += 0.1; + vieworg[2] += cl.ground_hit_speed; + gunorg[2] += cl.ground_hit_speed; + } // End of TEST!!!