Package org.collebol.math
Class VolumeCalculator
java.lang.Object
org.collebol.math.VolumeCalculator
The VolumeCalculator class is responsible for calculating the volume of a sound based on its position relative to the listener's position.
It uses the reference distance and roll-off factor of the sound to determine how the volume decreases with distance.
- Since:
- 1.0-dev
- Author:
- ColleBol - contact@collebol.org
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
VolumeCalculator
public VolumeCalculator()
-
-
Method Details
-
calculate
Calculates the volume of a sound based on its position relative to the listener's position.- Parameters:
sound- the sound whose volume is to be calculatedlistenerPosition- the position of the listener- Returns:
- the calculated volume
-