From 9fe75dc5211c9e6b420053d48847700822bbd6e8 Mon Sep 17 00:00:00 2001 From: ehofman Date: Tue, 27 Oct 2009 12:21:56 +0000 Subject: [PATCH] also test for NaN in listener code --- simgear/sound/soundmgr_openal.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/simgear/sound/soundmgr_openal.cxx b/simgear/sound/soundmgr_openal.cxx index 2d37e30e..217039a6 100644 --- a/simgear/sound/soundmgr_openal.cxx +++ b/simgear/sound/soundmgr_openal.cxx @@ -45,6 +45,7 @@ #include #include +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() ); -- 2.39.5