]> git.mxchange.org Git - simgear.git/commitdiff
the wrong name also mislead me: rotate velocity to the proper quat
authorehofman <ehofman>
Thu, 19 Nov 2009 15:29:34 +0000 (15:29 +0000)
committerTim Moore <timoore@redhat.com>
Thu, 19 Nov 2009 22:01:49 +0000 (23:01 +0100)
simgear/sound/sample_group.cxx
simgear/sound/soundmgr_openal.cxx

index bd1bf4851b238176f5c613a2d49a766cf30e034c..f384663142a0e866e3a8d422006d64e1cf4b2465 100644 (file)
@@ -324,11 +324,12 @@ void SGSampleGroup::set_volume( float vol )
 void SGSampleGroup::update_pos_and_orientation() {
  
     SGVec3d position = SGVec3d::fromGeod(_base_pos) - _smgr->get_position();
-    SGQuatd ec2body= SGQuatd::fromLonLat(_base_pos) * _orientation;
+    SGQuatd hlOr = SGQuatd::fromLonLat(_base_pos);
+    SGQuatd ec2body = hlOr*_orientation;
 
     SGVec3f velocity = SGVec3f::zeros();
     if ( _velocity[0] || _velocity[1] || _velocity[2] ) {
-       velocity = toVec3f( ec2body.backTransform(_velocity*SG_FEET_TO_METER) );
+       velocity = toVec3f( hlOr.backTransform(_velocity*SG_FEET_TO_METER) );
     }
 
     sample_map_iterator sample_current = _samples.begin();
index b9e86488d0d4651c75585ac6fe1be25294bc3485..6066a560c32d1d22cc49679b387171fe0a8807d9 100644 (file)
@@ -323,6 +323,7 @@ SGSampleGroup *SGSoundMgr::find( const string &refname, bool create ) {
         // sample group was not found.
         if (create) {
             SGSampleGroup* sgrp = new SGSampleGroup(this, refname);
+            add( sgrp, refname );
             return sgrp;
         }
         else