123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- #include "OverworldDimension.h"
- #include "GrasslandBiom.h"
- #include "FastNoiseWrapper.h"
- #include "RandNoise.h"
- #include "WormCaveGenerator.h"
- OverworldDimension::OverworldDimension()
- : DimensionGenerator(ID, new WormCaveGenerator(75, 150, 1, 6, 0.1f))
- {
- registerBiom(new GrasslandBiom(), 1.0);
- biomNoise = 0;
- structureNoise = 0;
- }
- OverworldDimension::~OverworldDimension()
- {
- if (biomNoise)
- biomNoise->release();
- if (structureNoise)
- structureNoise->release();
- }
- Noise* OverworldDimension::zBiomNoise()
- {
- if (biomNoise)
- return biomNoise;
- FastNoiseLite* noise = new FastNoiseLite(seed);
- noise->SetNoiseType(FastNoiseLite::NoiseType::NoiseType_Cellular);
- noise->SetRotationType3D(FastNoiseLite::RotationType3D::RotationType3D_None);
- noise->SetFrequency(0.015f);
- noise->SetFractalType(FastNoiseLite::FractalType::FractalType_None);
- noise->SetCellularDistanceFunction(FastNoiseLite::CellularDistanceFunction::CellularDistanceFunction_Hybrid);
- noise->SetCellularReturnType(FastNoiseLite::CellularReturnType::CellularReturnType_CellValue);
- noise->SetCellularJitter(1.f);
- noise->SetDomainWarpType(FastNoiseLite::DomainWarpType::DomainWarpType_OpenSimplex2Reduced);
- noise->SetDomainWarpAmp(30.f);
- biomNoise = new FastNoiseWrapper(noise, seed);
- return biomNoise;
- }
- Noise* OverworldDimension::zStructureNoise()
- {
- if (structureNoise)
- return structureNoise;
- structureNoise = new RandNoise(seed);
- return structureNoise;
- }
|