]> git.rm.cloudns.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)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 16 Jul 2010 22:24:11 +0000 (22:24 +0000)
From: MirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10336 d7cf8633-e32d-0410-b094-e92efae38249

client.h
view.c

index 412d00eea9f590c3cc24206f79a345cf56776631..8b9298df64ce376d11987fdfd46fb21037321253 100644 (file)
--- a/client.h
+++ b/client.h
@@ -978,6 +978,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)