-
Notifications
You must be signed in to change notification settings - Fork 47
/
SpeakerRenderables.h
69 lines (57 loc) · 1.52 KB
/
SpeakerRenderables.h
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
63
64
65
66
67
68
69
#pragma once
#include "isound.h"
#include "math/Vector3.h"
#include "render/RenderableGeometry.h"
namespace entity
{
class RenderableSpeakerRadiiBase :
public render::RenderableGeometry
{
protected:
bool _needsUpdate;
const Vector3& _origin;
// SoundRadii reference containing min and max radius values
// (the actual instance resides in the SpeakerNode)
const SoundRadii& _radii;
protected:
RenderableSpeakerRadiiBase(const Vector3& origin, const SoundRadii& radii) :
_origin(origin),
_radii(radii)
{}
public:
void queueUpdate()
{
_needsUpdate = true;
}
};
/**
* \brief
* Renderable speaker radius class (wireframe mode).
* Draws 3 axis-aligned circles per radius.
*/
class RenderableSpeakerRadiiWireframe :
public RenderableSpeakerRadiiBase
{
public:
// Construct an instance with the given origin and radius.
RenderableSpeakerRadiiWireframe(const Vector3& origin, const SoundRadii& radii) :
RenderableSpeakerRadiiBase(origin, radii)
{}
void updateGeometry() override;
};
/**
* \brief
* Renderable speaker radius class (camera mode).
* Draws a quad-based sphere with a fixed number of subdivisions.
*/
class RenderableSpeakerRadiiFill :
public RenderableSpeakerRadiiBase
{
public:
// Construct an instance with the given origin and radius.
RenderableSpeakerRadiiFill(const Vector3& origin, const SoundRadii& radii) :
RenderableSpeakerRadiiBase(origin, radii)
{}
void updateGeometry() override;
};
} // namespace