SoundSource3D.pkg 1.1 KB

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