]> git.mxchange.org Git - simgear.git/commitdiff
make sure update_late isn't executed when dt=0
authorehofman <ehofman>
Sat, 17 Oct 2009 13:09:27 +0000 (13:09 +0000)
committerTim Moore <timoore@redhat.com>
Sat, 17 Oct 2009 21:47:20 +0000 (23:47 +0200)
simgear/sound/sample_openal.cxx
simgear/sound/soundmgr_openal.cxx

index 191877ae6b957d33ddac8877cc0ef6f37826e7d0..d82c42a2f5080f9f104e93c9b1bff3ad3de34919 100644 (file)
@@ -183,4 +183,7 @@ void SGSoundSample::update_absolute_position() {
 
      orient = SGQuatd::fromRealImag(0, _relative_pos) * _orientation;
     _absolute_pos = -SGVec3d::fromGeod(_base_pos) -orient.rotate(SGVec3d::e1());
+
+    float vel = length(_velocity);
+    _velocity = toVec3d(_orivec * vel);
 }
index 10d406e0c4d851fd7073dd156b90843768e97432..1ab11035ea1315209a139538f7c8b19f88f34c89 100644 (file)
@@ -222,7 +222,7 @@ void SGSoundMgr::unbind ()
 
 // run the audio scheduler
 void SGSoundMgr::update_late( double dt ) {
-    if (_working) {
+    if (_working && dt != 0.0) {
         alcSuspendContext(_context);
 
         sample_group_map_iterator sample_grp_current = _sample_groups.begin();