Vegastrike 0.5.1 rc1
1.0
Original sources for Vegastrike Evolved
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
Vegastrike 0.5.1 rc1
Todo List
Modules
Namespaces
Classes
Files
File List
src
aldrv
audio
codecs
renderers
CodecRegistry.cpp
CodecRegistry.h
Exceptions.h
Format.h
Listener.cpp
Listener.h
Matrix.h
RenderableListener.cpp
RenderableListener.h
RenderableSource.cpp
RenderableSource.h
Renderer.cpp
Renderer.h
Scene.cpp
Scene.h
SceneManager.cpp
SceneManager.h
SimpleScene.cpp
SimpleScene.h
SimpleSound.cpp
SimpleSound.h
SimpleSource.cpp
SimpleSource.h
Sound.cpp
Sound.h
SoundBuffer.cpp
SoundBuffer.h
Source.cpp
Source.h
SourceListener.h
SourceTemplate.cpp
SourceTemplate.h
Stream.cpp
Stream.h
TemplateManager.cpp
TemplateManager.h
test.cpp
test.h
Types.h
utils.cpp
utils.h
Vector.h
VirtualIterator.h
cmd
common
gfx
gldrv
gui
networking
python
accountserver.cpp
audiolib.h
cg_global.cpp
cg_global.h
command.cpp
command.h
config_xml.cpp
config_xml.h
configxml.cpp
configxml.h
cs_boostpython.h
cs_boostpythonclass.h
cs_boostpythonobj.h
cs_python.h
debug_vs.cpp
debug_vs.h
easydom.cpp
easydom.h
endianness.cpp
endianness.h
faction_generic.cpp
faction_generic.h
faction_util.cpp
faction_util_generic.cpp
faction_util_server.cpp
fastmath.cpp
ffmpeg_init.cpp
ffmpeg_init.h
file_main.h
force_feedback.cpp
force_feedback.h
force_feedback_server.cpp
functors.h
galaxy.cpp
galaxy_gen.cpp
galaxy_gen.h
galaxy_xml.cpp
galaxy_xml.h
gamemenu.cpp
gamemenu.h
gfxlib.h
gfxlib_struct.cpp
gfxlib_struct.h
gfxlib_struct_server.cpp
gnuhash.h
hashtable.cpp
hashtable.h
in.h
in_handler.h
in_joystick.cpp
in_joystick.h
in_kb.cpp
in_kb.h
in_kb_data.h
in_main.cpp
in_main.h
in_mouse.cpp
in_mouse.h
in_sdl.cpp
junk.c
libaudioserver.cpp
libserver.cpp
lin_time.cpp
lin_time.h
linecollide.h
load_mission.cpp
load_mission.h
macosx_math.cpp
macosx_math.h
macquartz.cpp
main.cpp
main_loop.cpp
main_loop.h
mmorpgclient.cpp
mmorpgclient.h
options.cpp
options.h
physics.cpp
physics.h
pk3.cpp
pk3.h
posh.cpp
posh.h
precompiled.h
profile.h
rendertext.cpp
rendertext.h
replaceall.py
resizable.h
save_util.h
savegame.cpp
savegame.h
SharedPool.cpp
SharedPool.h
ship_commands.cpp
ship_commands.h
Singleton.h
star_system.cpp
star_system.h
star_system_generic.cpp
star_system_generic.h
star_system_jump.cpp
star_system_xml.cpp
stardate.cpp
stardate.h
universe.cpp
universe.h
universe_generic.cpp
universe_generic.h
universe_util.cpp
universe_util.h
universe_util_generic.cpp
universe_util_server.cpp
vegaserver.cpp
vegastrike.h
vs_globals.cpp
vs_globals.h
vs_math.h
vs_random.h
vsfilesystem.cpp
vsfilesystem.h
VSFileXMLSerializer.cpp
VSFileXMLSerializer.h
xml_serializer.cpp
xml_serializer.h
xml_support.cpp
xml_support.h
XMLDocument.cpp
XMLDocument.h
File Members
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
Listener.cpp
Go to the documentation of this file.
1
//
2
// C++ Implementation: Audio::Source
3
//
4
5
#include "
Listener.h
"
6
#include "config.h"
7
8
#include <math.h>
9
10
namespace
Audio {
11
12
Listener::Listener
() throw() :
13
cosAngleRange(-1,-1),
14
position(0,0,0),
15
atDirection(0,0,-1),
16
upDirection(0,1,0),
17
velocity(0,0,0),
18
radius(1),
19
gain(1),
20
worldToLocal(1)
// set to identity, given default settings
21
{
22
}
23
24
Listener::~Listener
()
25
{
26
}
27
28
Range<Scalar>
Listener::getAngleRange
()
const
throw()
29
{
30
return
Range<Scalar>
(
Scalar
(
acos
(cosAngleRange.
min
)),
31
Scalar
(
acos
(cosAngleRange.
max
)));
32
}
33
34
void
Listener::setAngleRange
(
Range<Scalar>
r)
throw
()
35
{
36
cosAngleRange.min =
Scalar
(
cos
(r.min));
37
cosAngleRange.max =
Scalar
(
cos
(r.max));
38
dirty.attributes = 1;
39
}
40
41
void
Listener::update
(
int
flags)
throw
()
42
{
43
if
(!dirty.attributes)
44
flags &= ~
RenderableListener
::UPDATE_ATTRIBUTES;
45
if
(!dirty.location)
46
flags &= ~
RenderableListener
::UPDATE_LOCATION;
47
if
(!dirty.gain)
48
flags &= ~
RenderableListener
::UPDATE_GAIN;
49
50
if
(getRenderable().
get
() != 0)
51
getRenderable()->
update
(flags);
52
53
if
(flags &
RenderableListener::UPDATE_ATTRIBUTES
)
54
dirty.attributes = 0;
55
if
(flags &
RenderableListener::UPDATE_GAIN
)
56
dirty.gain = 0;
57
if
(flags &
RenderableListener::UPDATE_LOCATION
) {
58
worldToLocal =
59
Matrix3
(
60
atDirection.cross(upDirection),
61
upDirection,
62
-atDirection
63
).inverse();
64
dirty.location = 0;
65
}
66
}
67
68
Vector3
Listener::toLocalDirection
(
Vector3
dir)
const
throw
()
69
{
70
return
worldToLocal * dir;
71
}
72
73
};
src
audio
Listener.cpp
Generated on Fri May 29 2015 23:07:06 for Vegastrike 0.5.1 rc1 by
1.8.4