]> git.mxchange.org Git - flightgear.git/commitdiff
proper listener velocity calculation, this has no effect yet but is required when...
authorehofman <ehofman>
Mon, 23 Nov 2009 09:35:59 +0000 (09:35 +0000)
committerTim Moore <timoore@redhat.com>
Tue, 24 Nov 2009 13:22:54 +0000 (14:22 +0100)
src/Main/viewmgr.cxx
src/Model/acmodel.cxx
src/Model/acmodel.hxx
src/Sound/sample_queue.cxx

index dd1299be9f72e7d9f1999945ad44994517ea2570..270c579e03b82dcfd89457b8a8dd9b472bead2d5 100644 (file)
@@ -338,15 +338,15 @@ FGViewMgr::update (double dt)
 
   // update audio listener values
   // set the viewer posotion in Cartesian coordinates in meters
-  smgr->set_position( abs_viewer_position );
+  smgr->set_position( abs_viewer_position, loop_view->getPosition() );
   smgr->set_orientation( current_view_orientation );
 
   // get the model velocity
-  SGVec3f velocity = SGVec3f::zeros();
+  SGVec3d velocity = SGVec3d::zeros();
   if ( !stationary() ) {
     velocity = globals->get_aircraft_model()->getVelocity();
   }
-  smgr->set_velocity(velocity);
+  smgr->set_velocity( velocity );
 }
 
 void
index 1da7e37592f07f43497750fb9b88839f7132030f..2df6e0abfb29caff2bbe0d0314133456bd4fe8f9 100644 (file)
@@ -132,10 +132,10 @@ FGAircraftModel::update (double dt)
                                                 _roll->getDoubleValue());
   _fx->set_orientation( orient );
  
-  SGVec3d vel = SGVec3d( _speed_n->getDoubleValue(),
-                         _speed_e->getDoubleValue(),
-                         _speed_d->getDoubleValue() );
-  _fx->set_velocity( vel );
+  _velocity = SGVec3d( _speed_n->getDoubleValue(),
+                       _speed_e->getDoubleValue(),
+                       _speed_d->getDoubleValue() );
+  _fx->set_velocity( _velocity );
 }
 
 
index da3c844f56888a5e6ba849264e3b5b87aaf02281..59e6034dd26c0126af99aa4d5dc5e3d74b064899 100644 (file)
@@ -39,12 +39,12 @@ public:
   virtual void unbind ();
   virtual void update (double dt);
   virtual SGModelPlacement * get3DModel() { return _aircraft; }
-  virtual SGVec3f& getVelocity() { return _velocity; }
+  virtual SGVec3d& getVelocity() { return _velocity; }
 
 private:
 
   SGModelPlacement * _aircraft;
-  SGVec3f _velocity;
+  SGVec3d _velocity;
   SGSharedPtr<FGFX>  _fx;
 
   SGPropertyNode_ptr _lon;
index 9d71401656527ca54371c3247f2b7620b5224ca1..863cbcbdc602600943f952206810477e0ca195c3 100644 (file)
@@ -44,6 +44,7 @@ FGSampleQueue::FGSampleQueue ( SGSoundMgr *smgr, const string &refname ) :
 {
     SGSampleGroup::_smgr = smgr;
     SGSampleGroup::_smgr->add(this, refname);
+    SGSampleGroup::_refname = refname;
 }