some small fixes
This commit is contained in:
@@ -285,7 +285,7 @@ public:
|
||||
* Set the frequency (in Herz) of this audio sample.
|
||||
* @param freq Frequency
|
||||
*/
|
||||
inline void set_frequency( int freq ) { _freq = freq; _changed = true; }
|
||||
inline void set_frequency( int freq ) { _freq = freq; }
|
||||
|
||||
/**
|
||||
* Returns the frequency (in Herz) of this audio sample.
|
||||
@@ -343,20 +343,18 @@ public:
|
||||
* @param dir Sound emission direction
|
||||
*/
|
||||
inline void set_direction( const SGVec3f& dir ) {
|
||||
_direction = toVec3d(dir); _changed = true;
|
||||
_direction = toVec3d(dir); _static_changed = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the audio cone parameters for directional audio.
|
||||
* Note: setting it to 1 degree will result in 0.5 degrees to both sides.
|
||||
* Note: setting it to 2 degree will result in 1 degree to both sides.
|
||||
* @param inner Inner cone angle (0 - 360 degrees)
|
||||
* @param outer Outer cone angle (0 - 360 degrees)
|
||||
* @param gain Remaining gain at the edge of the outer cone (0.0 - 1.0)
|
||||
*/
|
||||
void set_audio_cone( float inner, float outer, float gain ) {
|
||||
_inner_angle = inner;
|
||||
_outer_angle = outer;
|
||||
_outer_gain = gain;
|
||||
_inner_angle = inner; _outer_angle = outer; _outer_gain = gain;
|
||||
_static_changed = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -156,8 +156,8 @@ public:
|
||||
* Set the Geodetic position of the sound manager.
|
||||
* @param pos OpenAL listener position
|
||||
*/
|
||||
void set_position_geod( const SGGeod& pos ) {
|
||||
_absolute_pos = SGVec3d::fromGeod( pos ); _changed = true;
|
||||
void set_position( const SGVec3d& pos ) {
|
||||
_absolute_pos = pos; _changed = true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -229,9 +229,9 @@ SGXmlSound::init(SGPropertyNode *root, SGPropertyNode *node,
|
||||
SGVec3f offset_pos = SGVec3f::zeros();
|
||||
SGPropertyNode_ptr prop = node->getChild("position");
|
||||
if ( prop != NULL ) {
|
||||
offset_pos[0] = prop->getDoubleValue("y", 0.0);
|
||||
offset_pos[1] = -prop->getDoubleValue("z", 0.0);
|
||||
offset_pos[2] = -prop->getDoubleValue("x", 0.0);
|
||||
offset_pos[0] = -prop->getDoubleValue("x", 0.0);
|
||||
offset_pos[1] = prop->getDoubleValue("y", 0.0);
|
||||
offset_pos[2] = -prop->getDoubleValue("z", 0.0);
|
||||
}
|
||||
|
||||
//
|
||||
@@ -243,9 +243,9 @@ SGXmlSound::init(SGPropertyNode *root, SGPropertyNode *node,
|
||||
float outer_gain = 0.0;
|
||||
prop = node->getChild("orientation");
|
||||
if ( prop != NULL ) {
|
||||
dir = SGVec3f(prop->getFloatValue("y", 0.0),
|
||||
-prop->getFloatValue("z", 0.0),
|
||||
-prop->getFloatValue("x", 0.0));
|
||||
dir = SGVec3f(-prop->getFloatValue("x", 0.0),
|
||||
prop->getFloatValue("y", 0.0),
|
||||
-prop->getFloatValue("z", 0.0));
|
||||
inner = prop->getFloatValue("inner-angle", 360.0);
|
||||
outer = prop->getFloatValue("outer-angle", 360.0);
|
||||
outer_gain = prop->getFloatValue("outer-gain", 0.0);
|
||||
|
||||
Reference in New Issue
Block a user