From bcb95f647d750a867ed7e9415edcaa4670cea5f6 Mon Sep 17 00:00:00 2001 From: ehofman Date: Fri, 30 Oct 2009 12:59:53 +0000 Subject: [PATCH] add relative pos back in --- simgear/sound/sample_openal.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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))); } -- 2.39.2