12345678910111213141516171819202122232425262728293031323334 |
- #include "GrasslandBiom.h"
- #include "BlockType.h"
- #include "BasicBlocks.h"
- #include "FastNoiseLite.h"
- #include "FastNoiseWrapper.h"
- GrasslandBiom::GrasslandBiom()
- : BiomGenerator()
- {
- heightNoise = 0;
- }
- GrasslandBiom::~GrasslandBiom()
- {
- if( heightNoise )
- heightNoise->release();
- }
- Framework::Either<Block*, int> GrasslandBiom::getBlock( int x, int y, int z )
- {
- return DirtBlockType::ID;
- }
- Noise* GrasslandBiom::zHeightMapNoise( int seed )
- {
- if( heightNoise )
- return heightNoise;
- FastNoiseLite* noise = new FastNoiseLite( seed );
- noise->SetNoiseType( FastNoiseLite::NoiseType::NoiseType_ValueCubic );
- FastNoiseWrapper* wrapper = new FastNoiseWrapper( noise, seed );
- wrapper->setMultiplier( 0.2f );
- heightNoise = wrapper;
- return heightNoise;
- }
|