]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
Attempt to implement landing viewshake effect (the camera lowering and going back...
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 16 Jul 2010 22:24:11 +0000 (22:24 +0000)
committerRudolf Polzer <divverent@alientrap.org>
Wed, 21 Jul 2010 04:57:01 +0000 (06:57 +0200)
From: MirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10336 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=f42800577ad4cfda0aca780d1f7d28b4c2aaa14c

client.h
view.c

index c555f418eb24945cd49661e50fbc1367a5900ef5..266a99dff9d73dd1aae5a7478481c3b7d841c3c7 100644 (file)
--- 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 615d52bd181dc1d92fa5e1b353fd06110ee166c3..0bcf9b554a138c50d72dbf8e9f10a5495f7e3666 100644 (file)
--- 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)