|
@@ -97,7 +97,7 @@ OpenALAudioManager() {
|
|
|
_is_valid = true;
|
|
_is_valid = true;
|
|
|
|
|
|
|
|
// Init 3D attributes
|
|
// Init 3D attributes
|
|
|
- _distance_factor = 3.28;
|
|
|
|
|
|
|
+ _distance_factor = 1;
|
|
|
_drop_off_factor = 1;
|
|
_drop_off_factor = 1;
|
|
|
|
|
|
|
|
_position[0] = 0;
|
|
_position[0] = 0;
|
|
@@ -715,12 +715,11 @@ audio_3d_get_listener_attributes(PN_stdfloat *px, PN_stdfloat *py, PN_stdfloat *
|
|
|
*uz = _forward_up[4];
|
|
*uz = _forward_up[4];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Set units per foot WARNING: OpenAL has no distance factor but we use this
|
|
|
|
|
- * as a scale on the min/max distances of sounds to preserve FMOD
|
|
|
|
|
- * compatibility. Also, adjusts the speed of sound to compensate for unit
|
|
|
|
|
- * difference. OpenAL's default speed of sound is 343.3 m/s == 1126.3 ft/s
|
|
|
|
|
|
|
+ * Set value in units per meter
|
|
|
|
|
+ * WARNING: OpenAL has no distance factor but we use this as a scale
|
|
|
|
|
+ * on the min/max distances of sounds to preserve FMOD compatibility.
|
|
|
|
|
+ * Also adjusts the speed of sound to compensate for unit difference.
|
|
|
*/
|
|
*/
|
|
|
void OpenALAudioManager::
|
|
void OpenALAudioManager::
|
|
|
audio_3d_set_distance_factor(PN_stdfloat factor) {
|
|
audio_3d_set_distance_factor(PN_stdfloat factor) {
|
|
@@ -732,7 +731,7 @@ audio_3d_set_distance_factor(PN_stdfloat factor) {
|
|
|
alGetError(); // clear errors
|
|
alGetError(); // clear errors
|
|
|
|
|
|
|
|
if (_distance_factor>0) {
|
|
if (_distance_factor>0) {
|
|
|
- alSpeedOfSound(1126.3*_distance_factor);
|
|
|
|
|
|
|
+ alSpeedOfSound(343.3*_distance_factor);
|
|
|
al_audio_errcheck("alSpeedOfSound()");
|
|
al_audio_errcheck("alSpeedOfSound()");
|
|
|
// resets the doppler factor to the correct setting in case it was set to
|
|
// resets the doppler factor to the correct setting in case it was set to
|
|
|
// 0.0 by a distance_factor<=0.0
|
|
// 0.0 by a distance_factor<=0.0
|
|
@@ -752,7 +751,7 @@ audio_3d_set_distance_factor(PN_stdfloat factor) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Sets units per foot
|
|
|
|
|
|
|
+ * Get value in units per meter
|
|
|
*/
|
|
*/
|
|
|
PN_stdfloat OpenALAudioManager::
|
|
PN_stdfloat OpenALAudioManager::
|
|
|
audio_3d_get_distance_factor() const {
|
|
audio_3d_get_distance_factor() const {
|