mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
Added Source:setCone(innerAngle, outerAngle, outerVolume). Resolves issue #643.
When combined with Source:setDirection (and Source:setPosition or love.audio.setPosition), the cone parameters allow for directional sound output from a Source.
This commit is contained in:
@@ -135,6 +135,20 @@ void Source::getDirection(float *) const
|
||||
{
|
||||
}
|
||||
|
||||
void Source::setCone(float innerAngle, float outerAngle, float outerVolume)
|
||||
{
|
||||
coneInnerAngle = innerAngle;
|
||||
coneOuterAngle = outerAngle;
|
||||
coneOuterVolume = outerVolume;
|
||||
}
|
||||
|
||||
void Source::getCone(float &innerAngle, float &outerAngle, float &outerVolume) const
|
||||
{
|
||||
innerAngle = coneInnerAngle;
|
||||
outerAngle = coneOuterAngle;
|
||||
outerVolume = coneOuterVolume;
|
||||
}
|
||||
|
||||
void Source::setRelativePosition(bool relative)
|
||||
{
|
||||
relativePosition = relative;
|
||||
|
||||
@@ -60,6 +60,8 @@ public:
|
||||
virtual void getVelocity(float *v) const;
|
||||
virtual void setDirection(float *v);
|
||||
virtual void getDirection(float *v) const;
|
||||
virtual void setCone(float innerAngle, float outerAngle, float outerVolume);
|
||||
virtual void getCone(float &innerAngle, float &outerAngle, float &outerVolume) const;
|
||||
virtual void setRelativePosition(bool relative);
|
||||
virtual bool hasRelativePosition() const;
|
||||
void setLooping(bool looping);
|
||||
@@ -80,6 +82,9 @@ private:
|
||||
|
||||
float pitch;
|
||||
float volume;
|
||||
float coneInnerAngle;
|
||||
float coneOuterAngle;
|
||||
float coneOuterVolume;
|
||||
bool relativePosition;
|
||||
bool looping;
|
||||
float minVolume;
|
||||
|
||||
Reference in New Issue
Block a user