Firelight Technologies FMOD Studio API
ChannelGroup::set3DMinMaxDistance
Sets the minimum and maximum audible distance.
C++ Syntax
FMOD_RESULT ChannelGroup::set3DMinMaxDistance(
float mindistance,
float maxdistance
);
C Syntax
FMOD_RESULT FMOD_ChannelGroup_Set3DMinMaxDistance(
FMOD_CHANNELGROUP *channelgroup,
float mindistance,
float maxdistance
);
C# Syntax
RESULT ChannelGroup.set3DMinMaxDistance(
float mindistance,
float maxdistance
);
JavaScript Syntax
ChannelGroup.set3DMinMaxDistance(
mindistance,
maxdistance
);
Parameters
- mindistance
- Minimum volume distance in 'units' (see remarks), default = 1.0.
- maxdistance
- Maximum volume distance in 'units' (see remarks), default = 10000.0.
Return Values
If the function succeeds then the return value is FMOD_OK.
If the function fails then the return value will be one of the values defined in the FMOD_RESULT enumeration.
Remarks
When the listener is in-between the minimum distance and the sound source the volume will be at its maximum. As the listener moves from the minimum distance to the maximum distance the sound will attenuate following the rolloff curve set. When outside the maximum distance the sound will no longer attenuate.
Minimum distance is useful to give the impression that the sound is loud or soft in 3D space. An example of this is a small quiet object, such as a bumblebee, which you could set a small mindistance such as 0.1. This would cause it to attenuate quickly and dissapear when only a few meters away from the listener. Another example is a jumbo jet, which you could set to a mindistance of 100.0 causing the volume to stay at its loudest until the listener was 100 meters away, then it would be hundreds of meters more before it would fade out.
Maximum distance is effectively obsolete unless you need the sound to stop fading out at a certain point. Do not adjust this from the default if you dont need to. Some people have the confusion that maxdistance is the point the sound will fade out to zero, this is not the case.
A 'distance unit' is specified by System::set3DSettings. By default this is set to meters which is a distance scale of 1.0.
To define the min and max distance per sound use Sound::set3DMinMaxDistance.
If FMOD_3D_CUSTOMROLLOFF is used, then these values are stored, but ignored in 3D processing.
See Also
- ChannelControl::get3DMinMaxDistance
- System::set3DSettings
- Sound::set3DMinMaxDistance
- FMOD_3D_CUSTOMROLLOFF
Version 1.10.03 Built on Feb 1, 2018