From 995171d5b094cc745cfbd34665afea540295efaf Mon Sep 17 00:00:00 2001 From: divverent Date: Fri, 16 Jul 2010 22:24:11 +0000 Subject: [PATCH] Attempt to implement landing viewshake effect (the camera lowering and going back up when you hit the ground with speed). Code very primitive at this point, and just gets the basic calculation in place. From: MirceaKitsune git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10336 d7cf8633-e32d-0410-b094-e92efae38249 ::stable-branch::merge=f42800577ad4cfda0aca780d1f7d28b4c2aaa14c --- client.h | 2 ++ view.c | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/client.h b/client.h index c555f418..266a99df 100644 --- a/client.h +++ b/client.h @@ -973,6 +973,8 @@ typedef struct client_state_s double lastongroundtime; double hitgroundtime; float bob2_smooth; + + float ground_hit_speed; // don't change view angle, full screen, etc int intermission; diff --git a/view.c b/view.c index 615d52bd..0bcf9b55 100644 --- a/view.c +++ b/view.c @@ -712,6 +712,18 @@ void V_CalcRefdef (void) gunorg[0] += bob2vel[0]; gunorg[1] += bob2vel[1]; } + + + // TEST!!! + + if (!cl.onground) + cl.ground_hit_speed = cl.velocity[2]; + else + vieworg[2] += cl.ground_hit_speed; + + // End of TEST!!! + + // gun model bobbing code if (cl_bob.value || cl_bob2.value) -- 2.39.2