Maik JUSTUS: fix/implement directional sound
This commit is contained in:
parent
e8dc9c9454
commit
c8953c6275
@ -338,6 +338,9 @@ SGSoundSample::set_orientation( ALfloat *dir, ALfloat inner_angle,
|
||||
inner = inner_angle;
|
||||
outer = outer_angle;
|
||||
outergain = outer_gain;
|
||||
direction[0] = dir[0];
|
||||
direction[1] = dir[1];
|
||||
direction[2] = dir[2];
|
||||
if (playing) {
|
||||
alSourcefv( source, AL_DIRECTION, dir);
|
||||
alSourcef( source, AL_CONE_INNER_ANGLE, inner );
|
||||
|
@ -237,7 +237,7 @@ SGXmlSound::init(SGPropertyNode *root, SGPropertyNode *node, SGSoundMgr *sndmgr,
|
||||
SGPropertyNode_ptr pos = node->getChild("position");
|
||||
if ( pos != NULL ) {
|
||||
offset_pos[0] = pos->getDoubleValue("x", 0.0);
|
||||
offset_pos[1] = pos->getDoubleValue("y", 0.0);
|
||||
offset_pos[1] = -pos->getDoubleValue("y", 0.0);
|
||||
offset_pos[2] = pos->getDoubleValue("z", 0.0);
|
||||
}
|
||||
|
||||
@ -252,7 +252,7 @@ SGXmlSound::init(SGPropertyNode *root, SGPropertyNode *node, SGSoundMgr *sndmgr,
|
||||
pos = node->getChild("orientation");
|
||||
if ( pos != NULL ) {
|
||||
dir[0] = pos->getDoubleValue("x", 0.0);
|
||||
dir[1] = pos->getDoubleValue("y", 0.0);
|
||||
dir[1] = -pos->getDoubleValue("y", 0.0);
|
||||
dir[2] = pos->getDoubleValue("z", 0.0);
|
||||
inner = pos->getDoubleValue("inner-angle", 360.0);
|
||||
outer = pos->getDoubleValue("outer-angle", 360.0);
|
||||
|
Loading…
Reference in New Issue
Block a user