]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
sound direction fix (negated yaw angle), submitted by div0
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 30 Jan 2006 13:03:47 +0000 (13:03 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 30 Jan 2006 13:03:47 +0000 (13:03 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5926 d7cf8633-e32d-0410-b094-e92efae38249

snd_main.c

index 9dc5df8ffe2f52b67b2e7967debf6e678a5c22fa..26f048d4a3fdb70eac3c0e75ddeda8c77cbdc24a 100644 (file)
@@ -956,8 +956,18 @@ void S_Update(const matrix4x4_t *listenermatrix)
        // calculate the current matrices
        for (j = 0;j < SND_LISTENERS;j++)
        {
-               Matrix4x4_CreateFromQuakeEntity(&rotatematrix, 0, 0, 0, 0, snd_speakerlayout.listeners[j].yawangle, 0, 1);
-               Matrix4x4_Concat(&listener_matrix[j], &basematrix, &rotatematrix);
+               Matrix4x4_CreateFromQuakeEntity(&rotatematrix, 0, 0, 0, 0, -snd_speakerlayout.listeners[j].yawangle, 0, 1);
+               Matrix4x4_Concat(&listener_matrix[j], &rotatematrix, &basematrix);
+               // I think this should now do this:
+               //   1. create a rotation matrix for rotating by e.g. -90 degrees CCW
+               //      (note: the matrix will rotate the OBJECT, not the VIEWER, so its
+               //       angle has to be taken negative)
+               //   2. create a transform which first rotates and moves its argument
+               //      into the player's view coordinates (using basematrix which is
+               //      an inverted "absolute" listener matrix), then applies the
+               //      rotation matrix for the ear
+               // Isn't Matrix4x4_CreateFromQuakeEntity a bit misleading because this
+               // does not actually refer to an entity?
        }
 
        // update general area ambient sound sources