2024-02-25 14:46:47 +00:00
|
|
|
#pragma once
|
2023-06-20 04:33:09 +00:00
|
|
|
|
|
|
|
#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;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|