载入中...
搜索中...
未找到
Biome.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
5#include "procgen/PointSet.h"
7
8#include <cstdint>
9#include <memory>
10#include <string>
11#include <vector>
12
13namespace eve::procgen {
14
17 std::string asset;
18 float weight = 1.f;
19 float minScale = 1.f;
20 float maxScale = 1.f;
21 bool randomYaw = true;
22};
23
26 std::string name;
27 int priority = 0;
28 float density = 1.f;
29 std::shared_ptr<SpatialData> spatial;
30 std::vector<BiomeAssetRule> assets;
31};
32
41public:
43 void clear();
45 bool addLayer(const std::string& name, SpatialData* spatial, int priority, float density);
47 bool removeLayer(const std::string& name);
49 bool hasLayer(const std::string& name) const;
51 int getLayerCount() const;
53 std::string getLayerName(int index) const;
55 int getLayerPriority(const std::string& name) const;
57 float getLayerDensity(const std::string& name) const;
58
60 bool addAsset(const std::string& layerName, const std::string& asset, float weight,
61 float minScale, float maxScale, bool randomYaw);
63 int getAssetCount(const std::string& layerName) const;
65 std::string getAssetName(const std::string& layerName, int index) const;
66
68 bool addExclusion(SpatialData* spatial);
70 int getExclusionCount() const;
71
76 PointSet* generate(SpatialData* domain, float spacing, uint32_t seed, float jitter);
78 std::string getError() const;
80 std::string debugReport() const;
81
82private:
83 BiomeLayerRule* findLayer(const std::string& name);
84 const BiomeLayerRule* findLayer(const std::string& name) const;
85
86 std::vector<BiomeLayerRule> layers_;
87 std::vector<std::shared_ptr<SpatialData>> exclusions_;
88 std::string error_;
89 int lastCandidateCount_ = 0;
90 int lastOutputCount_ = 0;
91};
92
93} // namespace eve::procgen
eve::action::ActionSpatialBinding spatial
int priority
#define EVENGINE_API_DOMAINS
Definition Export.h:110
std::string name
std::uint32_t seed
Definition PointSet.cpp:807
int spacing
uint32_t index
Data-driven biome distribution rules compatible with PointGraph and scene batches.
Definition Biome.h:40
Script-friendly collection of attributed 3D samples.
Definition PointSet.h:59
Queryable spatial input for procedural pipelines.
Definition SpatialData.h:35
One weighted asset entry in a procedural biome layer.
Definition Biome.h:16
One spatially-defined biome layer and its asset table.
Definition Biome.h:25
std::vector< BiomeAssetRule > assets
Definition Biome.h:30
std::shared_ptr< SpatialData > spatial
Definition Biome.h:29