12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- #pragma once
- #include <Noise.h>
- class NoiseCombinerM : public Noise
- {
- private:
- Noise* a;
- Noise* b;
- public:
- NoiseCombinerM(Noise* a, Noise* b)
- : Noise(),
- a(a),
- b(b)
- {}
- virtual int getSeed() const
- {
- return 0;
- }
- virtual double getNoise(double x, double y, double z)
- {
- return a->getNoise(x, y, z) * b->getNoise(x, y, z)
- + (1 - b->getNoise(x, y, z)) / 2;
- }
- };
- class NoiseCombinerA : public Noise
- {
- private:
- Noise* a;
- Noise* b;
- public:
- NoiseCombinerA(Noise* a, Noise* b)
- : Noise(),
- a(a),
- b(b)
- {}
- virtual int getSeed() const
- {
- return 0;
- }
- virtual double getNoise(double x, double y, double z)
- {
- return a->getNoise(x, y, z)* 0.7 + b->getNoise(x, y, z) * 0.3;
- }
- };
|