28class TerrainSystem :
public System {
30 TerrainSystem() =
default;
31 ~TerrainSystem()
override =
default;
33 TerrainSystem(
const TerrainSystem& other) =
delete;
34 TerrainSystem& operator=(
const TerrainSystem& other) =
delete;
36 TerrainSystem(TerrainSystem && other) =
delete;
37 TerrainSystem& operator=(TerrainSystem && other) =
delete;
45 TerrainHandle terrain;
47 uint32_t resolution = 0;
50 std::vector<std::array<MeshHandle, TerrainChunks::LEVELS>> chunks;
51 std::vector<Math::AABB> bounds;
52 TextureHandle weightMap;
53 MaterialHandle material;
54 std::vector<float> heights;
55 std::vector<uint8_t> weights;
56 std::vector<TerrainPlants::Plant> plants;
57 std::vector<uint32_t> plantRuns;
58 glm::mat4 model{1.0f};
60 bool castShadows =
true;
73 void remake(ResourceManager& resources, Made& made, TerrainHandle terrain, uint32_t slot);
76 static void release(ResourceManager& resources, Made& made);
84 void listPlants(
const ResourceManager& resources,
const Scene& scene);
94 uint64_t plantsKey(
const ResourceManager& resources,
const Scene& scene)
const;
97 std::unordered_map<uint32_t, Made> m_made;
100 uint64_t m_plantsKey = 0;
Per-frame state bundle passed to every system.
Definition system.h:57