paysages3d/src/tests/TestToolNoise.h

26 lines
543 B
C
Raw Normal View History

2016-01-10 13:27:32 +00:00
#ifndef TESTTOOLNOISE_H
#define TESTTOOLNOISE_H
#include "FractalNoise.h"
namespace {
/**
* Fractal noise that produces the same value anywhere.
*/
class ConstantFractalNoise : public FractalNoise {
public:
ConstantFractalNoise(double value) : value(value) {
// The noise will yield its value at first iteration, then will collapse to 0
setStep(0.0);
2016-01-10 13:27:32 +00:00
}
virtual double getBase3d(double, double, double) const override {
2016-01-10 13:27:32 +00:00
return value;
}
private:
double value;
};
}
#endif // TESTTOOLNOISE_H