-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathlistener.cpp
More file actions
62 lines (52 loc) · 1.17 KB
/
listener.cpp
File metadata and controls
62 lines (52 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#include <fea/audio/listener.hpp>
#include <fea/assert.hpp>
#include <string>
namespace fea
{
Listener::Listener() :
mGain(1.0f),
mPosition({0.0f, 0.0f, 0.0f}),
mVelocity({0.0f, 0.0f, 0.0f}),
mAt({0.0f, 0.0f, -1.0f}),
mUp({0.0f, 1.0f, 0.0f})
{
}
void Listener::setGain(float gain)
{
FEA_ASSERT(gain > 0.0f, "Trying to set gain to zero or below! Given " + std::to_string(gain));
mGain = gain;
}
float Listener::getGain() const
{
return mGain;
}
void Listener::setPosition(const Vec3F& position)
{
mPosition = position;
}
const Vec3F& Listener::getPosition() const
{
return mPosition;
}
void Listener::setVelocity(const Vec3F& velocity)
{
mVelocity = velocity;
}
const Vec3F& Listener::getVelocity() const
{
return mVelocity;
}
void Listener::setOrientation(const Vec3F& at, const Vec3F& up)
{
mAt = at;
mUp = up;
}
const Vec3F& Listener::getOrientationAt() const
{
return mAt;
}
const Vec3F& Listener::getOrientationUp() const
{
return mUp;
}
}