]> git.mxchange.org Git - simgear.git/blobdiff - simgear/sound/sample_openal.hxx
Merge branch 'jmt/magvar' into next
[simgear.git] / simgear / sound / sample_openal.hxx
index d196560123ee1b1559d422c7b593263672a4c52a..d2cb1824763a7a76b3769397bc80a0956c9464e0 100644 (file)
@@ -172,7 +172,7 @@ public:
      * Free the data associated with this audio sample
      */
     void free_data() {
-        if ( _data ) free( _data ); _data = NULL;
+        if ( _data != NULL ) free( _data ); _data = NULL;
     }
 
     /**
@@ -337,6 +337,10 @@ public:
         _orientation = ori; _changed = true;
     }
 
+    inline void set_rotation( const SGQuatd& ec2body ) {
+        _rotation = ec2body; _changed = true;
+    }
+
     /**
      * Set direction of this sound relative to the orientation.
      * This is in the same coordinate system as OpenGL; y=up, z=back, x=right
@@ -454,6 +458,8 @@ private:
     SGVec3f _orivec;           // orientation vector for OpenAL
     SGVec3d _base_pos;         // base position
 
+    SGQuatd _rotation;
+
     std::string _refname;      // name or file path
     unsigned char* _data;