mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
Added Source:setRelativePosition and Source:hasRelativePosition, if enabled the Source's position will always be relative to the listener instead of absolute.
This commit is contained in:
@@ -135,6 +135,16 @@ void Source::getDirection(float *) const
|
||||
{
|
||||
}
|
||||
|
||||
void Source::setRelativePosition(bool relative)
|
||||
{
|
||||
relativePosition = relative;
|
||||
}
|
||||
|
||||
bool Source::hasRelativePosition() const
|
||||
{
|
||||
return relativePosition;
|
||||
}
|
||||
|
||||
void Source::setLooping(bool looping)
|
||||
{
|
||||
this->looping = looping;
|
||||
|
||||
@@ -60,6 +60,8 @@ public:
|
||||
virtual void getVelocity(float *v) const;
|
||||
virtual void setDirection(float *v);
|
||||
virtual void getDirection(float *v) const;
|
||||
virtual void setRelativePosition(bool relative);
|
||||
virtual bool hasRelativePosition() const;
|
||||
void setLooping(bool looping);
|
||||
bool isLooping() const;
|
||||
bool isStatic() const;
|
||||
@@ -78,6 +80,7 @@ private:
|
||||
|
||||
float pitch;
|
||||
float volume;
|
||||
bool relativePosition;
|
||||
bool looping;
|
||||
float minVolume;
|
||||
float maxVolume;
|
||||
|
||||
Reference in New Issue
Block a user