From: ehofman Date: Fri, 30 Oct 2009 12:59:53 +0000 (+0000) Subject: add relative pos back in X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=bcb95f647d750a867ed7e9415edcaa4670cea5f6;p=simgear.git add relative pos back in --- diff --git a/simgear/sound/sample_openal.cxx b/simgear/sound/sample_openal.cxx index 561f06ed..b66c3628 100644 --- a/simgear/sound/sample_openal.cxx +++ b/simgear/sound/sample_openal.cxx @@ -207,7 +207,12 @@ void SGSoundSample::update_absolute_position() { // The cartesian position of the base sound coordinate SGVec3d position = SGVec3d::fromGeod(_base_pos); - _absolute_pos = position; // + (sc2body*q).backTransform(_relative_pos); + _absolute_pos = position; + if ( !(_relative_pos[0] == 0 && _relative_pos[1] == 0 && + _relative_pos[2] == 0) ) + { + _absolute_pos += (sc2body*q).backTransform(_relative_pos); + } if ( !(_direction[0] == 0 && _direction[1] == 0 && _direction[2] == 0) ) { _orivec = toVec3f((sc2body*q).backTransform(toVec3d(_direction))); }