#920: Qsound <-> openAL conversion / cleanup
---------------------------+------------------------------------------------
 Reporter:  Buginator      |              Owner:                  
     Type:  task           |             Status:  new             
 Priority:  major          |          Milestone:  unspecified     
Component:  Engine: Sound  |            Version:  unspecified     
 Keywords:                 |   Operating_system:  All/Non-Specific
Blockedby:                 |           Blocking:                  
---------------------------+------------------------------------------------
 Since we are not using Qsound (the original sound API that warzone used),
 there really is no reason why we need to convert the sound to 'Qsound
 format' for lack of a better term.

 DX was left-hand coordinates, openGL is right-hand coordinates, and qsound
 is ...unsure, but it looks like it is closer to R-HC, otherwise, I don't
 think they would have to convert anything, but it might be a hybrid thing.
 *shrug*

 The issue we have now, is in r5763, Giel added routines that calculated
 the forward and up vectors, and while it was "working"--as in, you could
 hear sounds, the positioning  of the sounds got really screwed up.

 First problem is in Vector3f_EulerToForwardVector()

 {{{
         Vector3f dest = {
                 cosf(v.x) * sinf(v.y),
                 -sinf(v.x),
                 cosf(v.x) * cosf(v.y)
         };
 }}}

 That seems to be the wrong axis from what we need?

 The other issue is, the "up" vector in Vector3f_EulerToUpVector()

 {{{
         Vector3f dest = {
                 sinf(v.x) * sinf(v.y) * cosf(v.z) - sinf(v.z) * cosf(v.z),
                 cosf(v.x) * cosf(v.z),
                 sinf(v.x) * cosf(v.y) * cosf(v.z) + sinf(v.y) * sinf(v.z)
         };
 }}}

 isn't correct either, and I am not quite sure why we need to calculate
 this anyway?  It isn't as if we can go below the map, so the up vector of
 0,0,1 is all we need.  (yes, I said 0,0,1, since we are dealing with
 qsound idiosynchracies)

 Anyway, in the committed code that fixes the sound orientation bugs that
 we had, if whoever wants to fix the matrix routines to work correctly, be
 my guest. You know, we could also get the view matrix from openGL, and
 just plug that into openAL, and that would work, but that is besides the
 point, and we really should be using our own matrix routines anyway, so we
 can move to openGL 3 more easily. :)

 Just remember to fix the qsound idiosynchracies as well, and we should be
 good to go.

 Note, my linux box is still down, suffering from ichabod craneitus, so I
 can't test on that.

-- 
Ticket URL: <http://developer.wz2100.net/ticket/920>
Warzone 2100 Trac <http://developer.wz2100.net/>
The Warzone 2100 Resurrection Project
_______________________________________________
Warzone-dev mailing list
[email protected]
https://mail.gna.org/listinfo/warzone-dev

Reply via email to