-
- SGVec3d position = SGVec3d::fromGeod( _position_geod );
- SGVec3d pos_offs = SGVec3d::fromGeod( _smgr->get_position_geod() );
-
- // The rotation rotating from the earth centerd frame to
- // the horizontal local frame
- SGQuatd hlOr = SGQuatd::fromLonLat(_position_geod);
-
- // Rotate the x-forward, y-right, z-down coordinate system
- // into the OpenGL camera system with x-right, y-up, z-back.
- SGQuatd q(-0.5, -0.5, 0.5, 0.5);
-
- // Compute the sounds orientation and position
- // wrt the earth centered frame - that is global coorinates
- SGQuatd sc2body = hlOr*_orientation*q;
-
- sample_map_iterator sample_current = _samples.begin();
- sample_map_iterator sample_end = _samples.end();
- for ( ; sample_current != sample_end; ++sample_current ) {
- SGSoundSample *sample = sample_current->second;
- sample->set_position( position - pos_offs );
- sample->set_orientation( _orientation );
- sample->set_rotation( sc2body );
+
+ SGVec3d position = SGVec3d::fromGeod(_base_pos) - _smgr->get_position();
+ SGQuatd hlOr = SGQuatd::fromLonLat(_base_pos);
+ SGQuatd ec2body = hlOr*_orientation;
+
+ SGVec3f velocity = SGVec3f::zeros();
+ if ( _velocity[0] || _velocity[1] || _velocity[2] ) {
+ velocity = toVec3f( hlOr.backTransform(_velocity*SG_FEET_TO_METER) );