SoundSource3D.pkg 1.0 KB

123456789101112131415161718192021222324
  1. $#include "SoundSource3D.h"
  2. /// %Sound source component with three-dimensional position.
  3. class SoundSource3D : public SoundSource
  4. {
  5. public:
  6. /// Set attenuation parameters.
  7. void SetDistanceAttenuation(float nearDistance, float farDistance, float rolloffFactor);
  8. /// Set near distance. Distances closer than this do not have an effect.
  9. void SetNearDistance(float distance);
  10. /// Set far distance. Beyond this sound will be completely attenuated.
  11. void SetFarDistance(float distance);
  12. /// Set rolloff power factor, defines attenuation function shape.
  13. void SetRolloffFactor(float factor);
  14. /// Calculate attenuation and panning based on current position and listener position.
  15. void CalculateAttenuation();
  16. /// Return near distance.
  17. float GetNearDistance() const { return nearDistance_; }
  18. /// Return far distance.
  19. float GetFarDistance() const { return farDistance_; }
  20. /// Return rolloff power factor.
  21. float RollAngleoffFactor() const { return rolloffFactor_; }
  22. };