]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
fix calculation of viewangles to include v_idlescale
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 29 May 2011 16:56:25 +0000 (16:56 +0000)
committerRudolf Polzer <divverent@xonotic.org>
Sun, 29 May 2011 17:04:54 +0000 (19:04 +0200)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11171 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=6cc0a6e1e0bf9142cbbf9e5d93264d736fa342cf

view.c

diff --git a/view.c b/view.c
index e31c9e429ea30c5580a6bcd5351534895990453b..772c31d15a9694b304a934bc07ca3beed0a66bfe 100644 (file)
--- a/view.c
+++ b/view.c
@@ -794,9 +794,12 @@ void V_CalcRefdef (void)
                        }
                        // calculate a view matrix for rendering the scene
                        if (v_idlescale.value)
-                               Matrix4x4_CreateFromQuakeEntity(&r_refdef.view.matrix, vieworg[0], vieworg[1], vieworg[2], viewangles[0] + v_idlescale.value * sin(cl.time*v_ipitch_cycle.value) * v_ipitch_level.value, viewangles[1] + v_idlescale.value * sin(cl.time*v_iyaw_cycle.value) * v_iyaw_level.value, viewangles[2] + v_idlescale.value * sin(cl.time*v_iroll_cycle.value) * v_iroll_level.value, 1);
-                       else
-                               Matrix4x4_CreateFromQuakeEntity(&r_refdef.view.matrix, vieworg[0], vieworg[1], vieworg[2], viewangles[0], viewangles[1], viewangles[2], 1);
+                       {
+                               viewangles[0] += v_idlescale.value * sin(cl.time*v_ipitch_cycle.value) * v_ipitch_level.value;
+                               viewangles[1] += v_idlescale.value * sin(cl.time*v_iyaw_cycle.value) * v_iyaw_level.value;
+                               viewangles[2] += v_idlescale.value * sin(cl.time*v_iroll_cycle.value) * v_iroll_level.value;
+                       }
+                       Matrix4x4_CreateFromQuakeEntity(&r_refdef.view.matrix, vieworg[0], vieworg[1], vieworg[2], viewangles[0], viewangles[1], viewangles[2], 1);
                        // calculate a viewmodel matrix for use in view-attached entities
                        Matrix4x4_CreateFromQuakeEntity(&viewmodelmatrix, gunorg[0], gunorg[1], gunorg[2], gunangles[0], gunangles[1], gunangles[2], cl_viewmodel_scale.value);
                        VectorCopy(vieworg, cl.csqc_vieworiginfromengine);