12345678910111213141516171819202122232425262728293031 |
- #include "FastNoiseWrapper.h"
- FastNoiseWrapper::FastNoiseWrapper(FastNoiseLite* noise, int seed)
- {
- this->noise = noise;
- this->seed = seed;
- this->multiplier = 1.f;
- }
- FastNoiseWrapper::~FastNoiseWrapper()
- {
- delete noise;
- }
- void FastNoiseWrapper::setMultiplier(float multiplier)
- {
- assert(multiplier > 0);
- this->multiplier = multiplier;
- }
- int FastNoiseWrapper::getSeed() const
- {
- return seed;
- }
- double FastNoiseWrapper::getNoise(double x, double y, double z)
- {
- // scale the noise from 0 to 1
- return (noise->GetNoise(x * multiplier, y * multiplier, z * multiplier) + 1)
- / 2;
- }
|