| 1234567891011121314151617181920212223242526 |
- $#include "SoundSource3D.h"
- /// %Sound source component with three-dimensional position.
- class SoundSource3D : public SoundSource
- {
- public:
- /// Register object factory.
- static void RegisterObject(Context* context);
- /// Set attenuation parameters.
- void SetDistanceAttenuation(float nearDistance, float farDistance, float rolloffFactor);
- /// Set near distance. Distances closer than this do not have an effect.
- void SetNearDistance(float distance);
- /// Set far distance. Beyond this sound will be completely attenuated.
- void SetFarDistance(float distance);
- /// Set rolloff power factor, defines attenuation function shape.
- void SetRolloffFactor(float factor);
- /// Calculate attenuation and panning based on current position and listener position.
- void CalculateAttenuation();
-
- /// Return near distance.
- float GetNearDistance() const { return nearDistance_; }
- /// Return far distance.
- float GetFarDistance() const { return farDistance_; }
- /// Return rolloff power factor.
- float RollAngleoffFactor() const { return rolloffFactor_; }
- };
|