ScaleNoise.cpp 325 B

1234567891011121314151617
  1. #include "ScaleNoise.h"
  2. ScaleNoise::ScaleNoise(Noise* base, double factor)
  3. : Noise(),
  4. base(base),
  5. factor(factor)
  6. {}
  7. int ScaleNoise::getSeed() const
  8. {
  9. return base->getSeed();
  10. }
  11. double ScaleNoise::getNoise(double x, double y, double z)
  12. {
  13. return MIN(MAX(base->getNoise(x, y, z) * factor, 0.0), 1.0);
  14. }