31 overshoot = overshootLevel;
37 float position = newNoiseWaveLenght;
40 assert(noisePositionPeaks.empty());
41 noisePositionPeaks.push_back(0.0f);
42 noiseAmplitudePeaks.push_back(0.0f);
43 while (position < 1.0f)
46 randomFloat = (
static_cast<float>(rand())/RAND_MAX) - 0.5;
47 noisePositionPeaks.push_back(position);
48 noiseAmplitudePeaks.push_back(randomFloat * newNoiseAmplitude);
49 position += newNoiseWaveLenght;
52 noisePositionPeaks.push_back(1.0f);
53 noiseAmplitudePeaks.push_back(0.0f);
57 float VART::NaturalInterpolator::GetNoise()
59 if (noisePositionPeaks.empty())
63 SineInterpolator::GetValue();
74 if (linearIndex < peakTime)
76 newLinearIndex = linearIndex / peakTime;
77 newRange = range + offset + overshoot;
78 result = SineInterpolator::GetValue(newLinearIndex, initialValue, newRange);
80 result += GetNoise(linearIndex);
84 result = SineInterpolator::GetValue((linearIndex-peakTime)/(1-peakTime),
85 initialPos+range+offset+overshoot,
NaturalInterpolator()
Creates an unitialized natural interpolator.
virtual float GetValue(float linearIndex, float initialValue, float range) const
Evaluates a goal position for DOF interpolation.
Header file for V-ART class "NaturalInterpolator".
void SetNoise(float newNoiseAmplitude, float newNoiseWaveLenght)