123456789101112131415161718192021222324252627282930 |
- #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, y, z ) * multiplier + 1) / 2;
- }
|