]> git.mxchange.org Git - simgear.git/commitdiff
add relative pos back in
authorehofman <ehofman>
Fri, 30 Oct 2009 12:59:53 +0000 (12:59 +0000)
committerTim Moore <timoore@redhat.com>
Fri, 30 Oct 2009 23:03:27 +0000 (00:03 +0100)
simgear/sound/sample_openal.cxx

index 561f06ed38f9b90f93bde6e3139e2b604dcc455b..b66c36280c33bec4aacaf9aee145089c1755c1c2 100644 (file)
@@ -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)));
     }