MultiplyNoise.cpp 459 B

123456789101112131415161718192021222324
  1. #include "MultiplyNoise.h"
  2. MultiplyNoise::MultiplyNoise(Noise* base, Noise* multiplier)
  3. : Noise(),
  4. base(base),
  5. multiplier(multiplier)
  6. {}
  7. MultiplyNoise::~MultiplyNoise()
  8. {
  9. base->release();
  10. multiplier->release();
  11. }
  12. int MultiplyNoise::getSeed() const
  13. {
  14. return base->getSeed();
  15. }
  16. double MultiplyNoise::getNoise(double x, double y, double z)
  17. {
  18. return base->getNoise(x, y, z)
  19. * multiplier->getNoise(x, y, z);
  20. }