From: mfranz Date: Thu, 21 Jun 2007 21:46:21 +0000 (+0000) Subject: Maik JUSTUS: fix/implement directional sound X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c8953c6275647ab7a5593554bbb8cf5e9bd11279;p=simgear.git Maik JUSTUS: fix/implement directional sound --- diff --git a/simgear/sound/sample_openal.cxx b/simgear/sound/sample_openal.cxx index 310b6339..2eb4910d 100644 --- a/simgear/sound/sample_openal.cxx +++ b/simgear/sound/sample_openal.cxx @@ -338,6 +338,9 @@ SGSoundSample::set_orientation( ALfloat *dir, ALfloat inner_angle, inner = inner_angle; outer = outer_angle; outergain = outer_gain; + direction[0] = dir[0]; + direction[1] = dir[1]; + direction[2] = dir[2]; if (playing) { alSourcefv( source, AL_DIRECTION, dir); alSourcef( source, AL_CONE_INNER_ANGLE, inner ); diff --git a/simgear/sound/xmlsound.cxx b/simgear/sound/xmlsound.cxx index 74ef4713..c4b65233 100644 --- a/simgear/sound/xmlsound.cxx +++ b/simgear/sound/xmlsound.cxx @@ -237,7 +237,7 @@ SGXmlSound::init(SGPropertyNode *root, SGPropertyNode *node, SGSoundMgr *sndmgr, SGPropertyNode_ptr pos = node->getChild("position"); if ( pos != NULL ) { offset_pos[0] = pos->getDoubleValue("x", 0.0); - offset_pos[1] = pos->getDoubleValue("y", 0.0); + offset_pos[1] = -pos->getDoubleValue("y", 0.0); offset_pos[2] = pos->getDoubleValue("z", 0.0); } @@ -252,7 +252,7 @@ SGXmlSound::init(SGPropertyNode *root, SGPropertyNode *node, SGSoundMgr *sndmgr, pos = node->getChild("orientation"); if ( pos != NULL ) { dir[0] = pos->getDoubleValue("x", 0.0); - dir[1] = pos->getDoubleValue("y", 0.0); + dir[1] = -pos->getDoubleValue("y", 0.0); dir[2] = pos->getDoubleValue("z", 0.0); inner = pos->getDoubleValue("inner-angle", 360.0); outer = pos->getDoubleValue("outer-angle", 360.0);