Stop all "in-transit" sounds effects from triggering in the first update
loop when their initial property value is "1".
_dt_play(0.0),
_dt_stop(0.0),
_delay(0.0),
- _stopping(0.0)
+ _stopping(0.0),
+ _initialized(false)
{
}
if (_property)
curr_value = _property->getDoubleValue();
+ if (!_initialized)
+ {
+ // update initial value before detecting changes
+ _prev_value = curr_value;
+ _initialized = true;
+ }
+
// If a condition is defined, test whether it is FALSE,
// else
// if a property is defined then test if it's value is FALSE
double _dt_play;
double _dt_stop;
double _delay; // time after which the sound should be started (default: 0)
- double _stopping; // time after the sound should have stopped.
- // This is useful for lost packets in in-transit mode.
+ double _stopping; // time after the sound should have stopped.
+ // This is useful for lost packets in in-transit mode.
+ bool _initialized;
std::vector<_snd_prop> _volume;
std::vector<_snd_prop> _pitch;
-
};
#endif // _SG_SOUND_HXX