From e204067b5061e6deb78f42b2104c498038dbff16 Mon Sep 17 00:00:00 2001 From: divverent Date: Fri, 16 Jul 2010 22:24:42 +0000 Subject: [PATCH] Even closer to a senseful code. We need to get just one swing using sin() From: MirceaKitsune git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10341 d7cf8633-e32d-0410-b094-e92efae38249 ::stable-branch::merge=417370b88b5b02820dac0b30b33fd725f4f70652 --- client.h | 1 - view.c | 13 ++++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/client.h b/client.h index 6123587b..266a99df 100644 --- a/client.h +++ b/client.h @@ -975,7 +975,6 @@ typedef struct client_state_s float bob2_smooth; float ground_hit_speed; - float ground_hit_target; // don't change view angle, full screen, etc int intermission; diff --git a/view.c b/view.c index ce439163..f35fb255 100644 --- a/view.c +++ b/view.c @@ -719,18 +719,17 @@ void V_CalcRefdef (void) // get the speed while in the air, apply it while we're not if (!cl.onground) { - cl.ground_hit_speed = 0; - cl.ground_hit_target = cl.velocity[2] * 0.1; // replace 0.1 with cvar + cl.ground_hit_speed = cl.velocity[2] * 0.1; // replace 0.1 with cvar } else { - if(cl.ground_hit_speed > cl.ground_hit_target) - cl.ground_hit_speed -= 0.1; // replace 0.1 with cvar - if(cl.ground_hit_speed < cl.ground_hit_target) + if(cl.ground_hit_speed < 0) cl.ground_hit_speed += 0.1; // replace 0.1 with cvar + else + cl.ground_hit_speed = 0; - vieworg[2] += sin(M_PI + M_PI * cl.ground_hit_speed * 0.2); - gunorg[2] += sin(M_PI + M_PI * cl.ground_hit_speed * 0.2); + vieworg[2] += sin(M_PI + M_PI * cl.ground_hit_speed * 1); + gunorg[2] += sin(M_PI + M_PI * cl.ground_hit_speed * 1); } // End of TEST!!! -- 2.39.2