载入中...
搜索中...
未找到
TerrainSpawnPlan.cpp
浏览该文件的文档.
13 return std::any_of(rules_.begin(), rules_.end(), [&](const auto& rule) { return ruleId(rule) == id; });
16Result<int> TerrainSpawnPlan::addSplat(const std::string& id, const Heightmap& paint, int targetLayer,
20 Diagnostic::error(DiagnosticCode::InvalidArgument, "terrain.spawnPlan: nonempty unique rule ID required"));
23 Diagnostic::error(DiagnosticCode::InvalidArgument, "terrain.spawnPlan: nonnegative splat layer required"));
36 Diagnostic::error(DiagnosticCode::InvalidArgument, "terrain.spawnPlan: nonempty unique rule ID required"));
48 Diagnostic::error(DiagnosticCode::InvalidArgument, "terrain.spawnPlan: nonempty unique rule ID required"));
60 Diagnostic::error(DiagnosticCode::InvalidArgument, "terrain.spawnPlan: nonempty unique rule ID required"));
72 Diagnostic::error(DiagnosticCode::InvalidArgument, "terrain.spawnPlan: nonempty unique rule ID required"));
84 Diagnostic::error(DiagnosticCode::InvalidArgument, "terrain.spawnPlan: nonempty unique rule ID required"));
86 candidate.emplace_back(TerrainModifierStampSpawnRule{id, stamp, localMask, globalMask, operation});
93 auto found = std::find_if(candidate.begin(), candidate.end(), [&](const auto& rule) { return ruleId(rule) == id; });
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={}, DiagnosticDetails details={}, std::string source={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.h:125
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:175
In-memory terrain heightmap: a dense float grid (row-major, index = y * width + x) materialized from ...
Definition Heightmap.h:21
const std::vector< TerrainSpawnRule > & rules() const noexcept
Return immutable ordered rules for transactional execution.
Definition TerrainSpawnPlan.cpp:103
Result< int > addProbes(const std::string &ruleId, const Heightmap &fitness, const TerrainProbePlacementSettings &settings, const TerrainStampSettings &operation, TerrainProbeOperationMode mode)
Append an owned reflection or light probe rule after validating a nonempty unique rule ID.
Definition TerrainSpawnPlan.cpp:67
int getRuleCount() const noexcept
Return the number of retained rules.
Definition TerrainSpawnPlan.cpp:102
Result< int > addSplat(const std::string &ruleId, const Heightmap &paint, int targetLayer, const TerrainStampSettings &operation)
Append an owned terrain texture rule after validating a nonempty unique rule ID.
Definition TerrainSpawnPlan.cpp:16
Result< int > addTrees(const std::string &ruleId, const Heightmap &fitness, const TerrainTreePlacementSettings &settings, const TerrainStampSettings &operation, TerrainTreeOperationMode mode)
Append an owned tree rule after validating a nonempty unique rule ID.
Definition TerrainSpawnPlan.cpp:43
Result< void > setEnabled(const std::string &ruleId, bool enabled)
Enable or disable a stable rule without changing its order.
Definition TerrainSpawnPlan.cpp:91
Result< int > addDetail(const std::string &ruleId, const Heightmap &fitness, const TerrainDetailSettings &settings, const TerrainStampSettings &operation, TerrainDetailMode mode, std::int32_t seed)
Append an owned detail rule after validating a nonempty unique rule ID.
Definition TerrainSpawnPlan.cpp:30
Result< int > addObjects(const std::string &ruleId, const Heightmap &fitness, const TerrainObjectPlacementSettings &settings, const TerrainStampSettings &operation, TerrainObjectOperationMode mode)
Append an owned object rule after validating a nonempty unique rule ID.
Definition TerrainSpawnPlan.cpp:55
Result< int > addModifierStamp(const std::string &ruleId, const Heightmap &stamp, const TerrainStampSettings &operation, const Heightmap &localMask, const Heightmap &globalMask)
Append an owned TerrainModifierStamp with independent local and global mask snapshots.
Definition TerrainSpawnPlan.cpp:79
Definition EvpackPointGraphLoader.h:12
TerrainProbeOperationMode
Mutation performed by a multi-terrain probe rule.
Definition TerrainProbePlacement.h:14
TerrainDetailMode
Native detail-density operation corresponding to Pcg SpawnMode.
Definition TerrainDetailLayer.h:15
std::variant< TerrainSplatSpawnRule, TerrainDetailSpawnRule, TerrainTreeSpawnRule, TerrainObjectSpawnRule, TerrainProbeSpawnRule, TerrainModifierStampSpawnRule > TerrainSpawnRule
Definition TerrainSpawnPlan.h:80
TerrainObjectOperationMode
Mutation performed by a multi-terrain game-object operation.
Definition TerrainObjectPlacement.h:21
TerrainTreeOperationMode
Pcg SetTerrainTrees operation branch. Add and Replace both append after upstream clearing policy.
Definition TerrainTreePlacement.h:55
@ InvalidArgument
Effective detail rule settings; density is rule density times global spawn density.
Definition TerrainDetailLayer.h:17
One owned Pcg-style detail spawn rule.
Definition TerrainSpawnPlan.h:28
One owned Pcg TerrainModifierStamp rule, including both ordered mask domains.
Definition TerrainSpawnPlan.h:69
Deterministic Pcg SetTerrainGameObjects scan, collision and resource configuration.
Definition TerrainObjectPlacement.h:50
One owned Pcg-style game-object spawn rule.
Definition TerrainSpawnPlan.h:49
Deterministic value settings for Pcg SetProbes terrain scanning.
Definition TerrainProbePlacement.h:16
One owned Pcg-style reflection or light probe spawn rule.
Definition TerrainSpawnPlan.h:59
One owned Pcg-style terrain texture spawn rule.
Definition TerrainSpawnPlan.h:19
Value configuration for a rectangular stamp in world X/Z coordinates.
Definition TerrainStamp.h:22
Explicit deterministic tree placement configuration for one terrain rectangle and resource.
Definition TerrainTreePlacement.h:23
One owned Pcg-style tree spawn rule.
Definition TerrainSpawnPlan.h:39