]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
Make the view slowly go back after hitting the ground. We need to do the same for...
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 16 Jul 2010 22:24:17 +0000 (22:24 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 16 Jul 2010 22:24:17 +0000 (22:24 +0000)
From: MirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>

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

view.c

diff --git a/view.c b/view.c
index 0bcf9b554a138c50d72dbf8e9f10a5495f7e3666..78d9013b4abbdedad548d83d6544edd6ef2aa67e 100644 (file)
--- 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!!!