6352e8e319
all at once
40 lines
757 B
C++
40 lines
757 B
C++
#ifndef STAR_ISLAND_SURFACE_SELECTOR_HPP
|
|
#define STAR_ISLAND_SURFACE_SELECTOR_HPP
|
|
|
|
#include "StarLruCache.hpp"
|
|
#include "StarPerlin.hpp"
|
|
#include "StarTerrainDatabase.hpp"
|
|
|
|
namespace Star {
|
|
|
|
struct IslandColumn {
|
|
float topLevel;
|
|
float bottomLevel;
|
|
};
|
|
|
|
struct IslandSurfaceSelector : TerrainSelector {
|
|
static char const* const Name;
|
|
|
|
IslandSurfaceSelector(Json const& config, TerrainSelectorParameters const& parameters);
|
|
|
|
float get(int x, int y) const override;
|
|
|
|
IslandColumn generateColumn(int x) const;
|
|
|
|
mutable HashLruCache<int, IslandColumn> columnCache;
|
|
|
|
PerlinF islandHeight;
|
|
PerlinF islandDepth;
|
|
PerlinF islandDecision;
|
|
|
|
float islandTaperPoint;
|
|
float islandElevation;
|
|
|
|
float layerBaseHeight;
|
|
int worldWidth;
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|