]> git.mxchange.org Git - simgear.git/blobdiff - simgear/sound/sample_group.hxx
Merge branch 'timoore/effects-anim-rebase' into next
[simgear.git] / simgear / sound / sample_group.hxx
index af85e3121bb23e0f1ac8f59413aadd11bbb28992..d2d47394d4530a32a33f68db431e4212f5e6638b 100644 (file)
@@ -128,6 +128,11 @@ public:
      */
     SGSoundSample *find( const string& refname );
 
+    /**
+     * Stop all playing samples and set the source id to invalid.
+     */
+    void stop();
+
     /**
      * Request to stop playing all audio samples until further notice.
      */
@@ -186,23 +191,29 @@ public:
 
     /**
      * Set the velocity vector of this sample group.
-     * This is in the same coordinate system as OpenGL; y=up, z=back, x=right.
+     * This is in the local frame coordinate system; x=north, y=east, z=down
      * @param vel Velocity vector 
      */
-    void set_velocity( const SGVec3d& vel );
+    void set_velocity( const SGVec3d& vel ) {
+       _velocity = vel; _changed = true;
+    }
 
     /**
      * Set the position of this sample group.
      * This is in the same coordinate system as OpenGL; y=up, z=back, x=right.
      * @param pos Base position
      */
-    void set_position( const SGGeod& pos );
+    void set_position_geod( const SGGeod& pos ) {
+        _base_pos = pos; _changed = true;
+    }
 
     /**
      * Set the orientation of this sample group.
      * @param ori Quaternation containing the orientation information
      */
-    void set_orientation( const SGQuatd& ori );
+    void set_orientation( const SGQuatd& ori ) {
+        _orientation = ori; _changed = true;
+    }
 
     /**
      * Tie this sample group to the listener position, orientation and velocity
@@ -215,13 +226,14 @@ protected:
     bool _active;
 
 private:
+    bool _changed;
     bool _pause;
     float _volume;
     bool _tied_to_listener;
 
     SGVec3d _velocity;
+    SGGeod _base_pos;
     SGQuatd _orientation;
-    SGGeod _position;
 
     sample_map _samples;
     std::vector< SGSharedPtr<SGSoundSample> > _removed_samples;
@@ -229,6 +241,7 @@ private:
     bool testForALError(string s);
     bool testForError(void *p, string s);
 
+    void update_pos_and_orientation();
     void update_sample_config( SGSoundSample *sound );
 };