FactorizeNoise.cpp 494 B

1234567891011121314151617181920212223
  1. #include "FactorizeNoise.h"
  2. FactorizeNoise::FactorizeNoise(Noise* a, Noise* b, double factorA)
  3. : Noise(),
  4. noiseA(a),
  5. noiseB(b),
  6. factorA(factorA)
  7. {}
  8. FactorizeNoise::~FactorizeNoise()
  9. {
  10. noiseA->release();
  11. noiseB->release();
  12. }
  13. int FactorizeNoise::getSeed() const {
  14. return noiseA->getSeed();
  15. }
  16. double FactorizeNoise::getNoise(double x, double y, double z) {
  17. return noiseA->getNoise(x, y, z) * factorA
  18. + noiseB->getNoise(x, y, z) * (1 - factorA);
  19. }