]> git.mxchange.org Git - simgear.git/commitdiff
also test for NaN in listener code
authorehofman <ehofman>
Tue, 27 Oct 2009 12:21:56 +0000 (12:21 +0000)
committerTim Moore <timoore@redhat.com>
Tue, 27 Oct 2009 21:15:11 +0000 (22:15 +0100)
simgear/sound/soundmgr_openal.cxx

index 2d37e30efaf0a6a8b66022e9f11d4bac868eeb33..217039a6c4408e71f7b7b190ca8191e3da480ecc 100644 (file)
@@ -45,6 +45,7 @@
 #include <simgear/misc/sg_path.hxx>
 #include <simgear/math/SGMath.hxx>
 
+extern bool isNaN(float *v);
 
 #define MAX_SOURCES    128
 
@@ -251,6 +252,9 @@ void SGSoundMgr::update_late( double dt ) {
         }
 
         if (_changed) {
+if (isNaN(_at_up_vec)) printf("NaN in listener orientation\n");
+if (isNaN(toVec3f(_position).data())) printf("NaN in listener position\n");
+if (isNaN(toVec3f(_velocity).data())) printf("NaN in listener velocity\n");
             alListenerf( AL_GAIN, _volume );
             alListenerfv( AL_ORIENTATION, _at_up_vec );
             alListenerfv( AL_POSITION, toVec3f(_position).data() );