]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
try to fix the gun origin for view bobbing
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 2 May 2010 14:06:49 +0000 (14:06 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 2 May 2010 14:06:49 +0000 (14:06 +0000)
From: Rudolf Polzer <divverent@alientrap.org>

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

view.c

diff --git a/view.c b/view.c
index de4c36311676e54292aaae58d5aa099ff6817482..685957dc8212df9e1187db9f402ec5c33d0e2a98 100644 (file)
--- a/view.c
+++ b/view.c
@@ -620,6 +620,13 @@ void V_CalcRefdef (void)
                                                bob = xyspeed * cl_bob.value;
                                                bob = bob*0.3 + bob*0.7*cycle;
                                                vieworg[2] += bound(-7, bob, 4);
+                                               // we also need to adjust gunorg, or this appears like
+                                               // pushing the gun! In the old code, this was applied
+                                               // to vieworg BEFORE copying to gunorg, but this is not
+                                               // viable with the new followmodel code as that would
+                                               // mean that followmodel would work on the
+                                               // munged-by-bob vieworg and do feedback
+                                               gunorg[2] += bound(-7, bob, 4);
                                        }
 
                                        if (cl_bob.value && cl_bobmodel.value)