From 743ecf650ea62c60e58803d2f2fe881db9511877 Mon Sep 17 00:00:00 2001 From: "PSp..om" Date: Sun, 15 May 2011 05:42:54 +0000 Subject: [PATCH] Fixed a comment to be more accurate. Max distance is not the maximum distance for the sound to be heard but the maximum distance that it will be attenuated. In other words, setting max distance to a small value has the opposite effect of cutting off the sound early. git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7496 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- engine/src/core/com/jme3/audio/AudioNode.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/engine/src/core/com/jme3/audio/AudioNode.java b/engine/src/core/com/jme3/audio/AudioNode.java index fa45b8fa0..72a02079b 100644 --- a/engine/src/core/com/jme3/audio/AudioNode.java +++ b/engine/src/core/com/jme3/audio/AudioNode.java @@ -72,7 +72,7 @@ public class AudioNode extends Node { protected transient int channel = -1; protected Vector3f velocity = new Vector3f(); protected boolean reverbEnabled = true; - protected float maxDistance = 20; // 20 meters + protected float maxDistance = 200; // 200 meters protected float refDistance = 10; // 10 meters protected Filter reverbFilter; private boolean directional = false; @@ -447,11 +447,16 @@ public class AudioNode extends Node { } /** - * Set the maximum playing distance for the audio node. + * Set the maximum distance for the attenuation of the audio node. * Does nothing if the audio node is not positional. *
* The maximum distance is the distance beyond which the audio - * node will no longer be heard. + * node will no longer be attenuated. Normal attenuation is logarithmic + * from refDistance (it reduces by half when the distance doubles). + * Max distance sets where this fall-off stops and the sound will never + * get any quieter than at that distance. If you want a sound to fall-off + * very quickly then set ref distance very short and leave this distance + * very long. * * @param maxDistance The maximum playing distance. * @throws IllegalArgumentException If maxDistance is negative