|
VR-Engage
2.2
|
Handles automatic variation of a floating point value (like volume or pitch) within a specified range and over varying durations.
#include <soundscape.h>
Public Member Functions | |
| void | reset () |
| void | update (double dt) |
Public Attributes | |
| float | currentVal |
| float | duration |
| float | rate |
| float | minVal |
| float | maxVal |
| float | minTime |
| float | maxTime |
| void makVre::DtSoundscape::Varying::reset | ( | ) |
Resets the variation with a new random target value and duration.
Selects a new random target value between minVal and maxVal and calculates the rate of change needed to reach that value over a random duration between minTime and maxTime.
| void makVre::DtSoundscape::Varying::update | ( | double | dt | ) |
Updates the current value based on elapsed time.
| dt | Time elapsed since last update in seconds |
Applies the current rate of change to the current value and resets if the duration has elapsed.
| float makVre::DtSoundscape::Varying::currentVal |
Current value of the parameter.
| float makVre::DtSoundscape::Varying::duration |
Time remaining until next value change (seconds)
| float makVre::DtSoundscape::Varying::rate |
Rate of change per second toward target value.
| float makVre::DtSoundscape::Varying::minVal |
Minimum allowed value.
| float makVre::DtSoundscape::Varying::maxVal |
Maximum allowed value.
| float makVre::DtSoundscape::Varying::minTime |
Minimum time between value changes (seconds)
| float makVre::DtSoundscape::Varying::maxTime |
Maximum time between value changes (seconds)