osb/source/game/terrain/StarIslandSurfaceSelector.hpp
2023-06-20 14:33:09 +10:00

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