]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Revert "More arrangements"
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 2 May 2010 14:06:38 +0000 (14:06 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 2 May 2010 14:06:38 +0000 (14:06 +0000)
This reverts commit 06694fee2275d36160c2948be3fd1f224842d800.

From: Rudolf Polzer <divverent@alientrap.org>

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

view.c

diff --git a/view.c b/view.c
index b6dd47ddb6fae26d276e53d54a2946ea40e6b4c9..de4c36311676e54292aaae58d5aa099ff6817482 100644 (file)
--- a/view.c
+++ b/view.c
@@ -602,6 +602,26 @@ void V_CalcRefdef (void)
 
                                        // gun model bobbing code
                                        xyspeed = sqrt(cl.movement_velocity[0]*cl.movement_velocity[0] + cl.movement_velocity[1]*cl.movement_velocity[1]);
+                                       if (cl_bob.value && cl_bobcycle.value)
+                                       {
+                                               float cycle;
+                                               // LordHavoc: this code is *weird*, but not replacable (I think it
+                                               // should be done in QC on the server, but oh well, quake is quake)
+                                               // LordHavoc: figured out bobup: the time at which the sin is at 180
+                                               // degrees (which allows lengthening or squishing the peak or valley)
+                                               cycle = cl.time / cl_bobcycle.value;
+                                               cycle -= (int) cycle;
+                                               if (cycle < cl_bobup.value)
+                                                       cycle = sin(M_PI * cycle / cl_bobup.value);
+                                               else
+                                                       cycle = sin(M_PI + M_PI * (cycle-cl_bobup.value)/(1.0 - cl_bobup.value));
+                                               // bob is proportional to velocity in the xy plane
+                                               // (don't count Z, or jumping messes it up)
+                                               bob = xyspeed * cl_bob.value;
+                                               bob = bob*0.3 + bob*0.7*cycle;
+                                               vieworg[2] += bound(-7, bob, 4);
+                                       }
+
                                        if (cl_bob.value && cl_bobmodel.value)
                                        {
                                                // calculate for swinging gun model
@@ -642,27 +662,6 @@ void V_CalcRefdef (void)
                                                bob = bspeed * cl_bobmodel_up.value * cl_viewmodel_scale.value * cos (s * 2) * t;
                                                VectorMA (gunorg, bob, up, gunorg);
                                        }
-
-                                       // view bobbing code
-                                       if (cl_bob.value && cl_bobcycle.value)
-                                       {
-                                               float cycle;
-                                               // LordHavoc: this code is *weird*, but not replacable (I think it
-                                               // should be done in QC on the server, but oh well, quake is quake)
-                                               // LordHavoc: figured out bobup: the time at which the sin is at 180
-                                               // degrees (which allows lengthening or squishing the peak or valley)
-                                               cycle = cl.time / cl_bobcycle.value;
-                                               cycle -= (int) cycle;
-                                               if (cycle < cl_bobup.value)
-                                                       cycle = sin(M_PI * cycle / cl_bobup.value);
-                                               else
-                                                       cycle = sin(M_PI + M_PI * (cycle-cl_bobup.value)/(1.0 - cl_bobup.value));
-                                               // bob is proportional to velocity in the xy plane
-                                               // (don't count Z, or jumping messes it up)
-                                               bob = xyspeed * cl_bob.value;
-                                               bob = bob*0.3 + bob*0.7*cycle;
-                                               vieworg[2] += bound(-7, bob, 4);
-                                       }
                                }
                        }
                        // calculate a view matrix for rendering the scene