载入中...
搜索中...
未找到
RuntimeGenerationAsset.cpp
浏览该文件的文档.
16 out << "EVPCG_CELL 3 " << worldSeed_ << ' ' << level << ' ' << x << ' ' << z << ' ' << found->second.revision << ' '
22 out << "POINT " << point.x << ' ' << point.y << ' ' << point.z << ' ' << point.normalX << ' ' << point.normalY
24 << point.scaleX << ' ' << point.scaleY << ' ' << point.scaleZ << ' ' << point.density << ' ' << point.seed
26 << ' ' << point.boundsMinX << ' ' << point.boundsMinY << ' ' << point.boundsMinZ << ' ' << point.boundsMaxX
76 if (!(input >> magic >> version >> seed >> key.level >> key.x >> key.z >> revision >> cellSize) ||
77 magic != "EVPCG_CELL" || (version != 1 && version != 2 && version != 3) || seed != worldSeed_ || revision == 0 ||
83 if (!(input >> record >> pointCount) || record != "POINTS" || pointCount < 0 || pointCount > maxPersistedPoints)
91 if (!(input >> point.x >> point.y >> point.z >> point.normalX >> point.normalY >> point.normalZ >>
95 if (!(input >> point.x >> point.y >> point.z >> point.normalX >> point.normalY >> point.normalZ >>
106 !std::isfinite(point.normalX) || !std::isfinite(point.normalY) || !std::isfinite(point.normalZ) ||
109 !std::isfinite(point.density) || !std::isfinite(point.boundsMinX) || !std::isfinite(point.boundsMinY) ||
110 !std::isfinite(point.boundsMinZ) || !std::isfinite(point.boundsMaxX) || !std::isfinite(point.boundsMaxY) ||
111 !std::isfinite(point.boundsMaxZ) || !std::isfinite(point.colorR) || !std::isfinite(point.colorG) ||
112 !std::isfinite(point.colorB) || !std::isfinite(point.colorA) || !std::isfinite(point.steepness))
130 if (!(input >> target >> std::quoted(name) >> value) || target != index || name.empty()) return false;
144 if (!(input >> target >> std::quoted(name) >> value.x >> value.y >> value.z) || target != index ||
147 if (!restored.trySetVectorAttribute(restoredIndex, name, value.x, value.y, value.z).ok()) return false;
152 if (!(input >> target >> std::quoted(name) >> std::quoted(value)) || target != index || name.empty())
166 const bool alreadyResident = existing != cells_.end() && (existing->second.state == State::Active ||
168 if (!alreadyResident && maxActiveCells_ > 0 && getActiveCellCount() + getGeneratingCount() >= maxActiveCells_)
173 (maxResidentPoints_ > 0 && getResidentPointCount() - replacedPoints > maxResidentPoints_ - restoredPoints)) {
177 generateQueue_.erase(std::remove(generateQueue_.begin(), generateQueue_.end(), key), generateQueue_.end());
178 cleanupQueue_.erase(std::remove(cleanupQueue_.begin(), cleanupQueue_.end(), key), cleanupQueue_.end());
bool ok() const noexcept
Whether this result represents a non-failure outcome.
Definition Result.h:480
Result< void > trySetStringAttribute(int index, const std::string &name, const std::string &value)
Canonical checked string metadata write.
Definition PointSet.cpp:421
Result< void > trySetBoolAttribute(int index, const std::string &name, bool value)
Canonical checked Boolean metadata write.
Definition PointSet.cpp:371
Result< void > trySetVectorAttribute(int index, const std::string &name, float x, float y, float z)
Canonical checked vector metadata write.
Definition PointSet.cpp:391
int appendPoint(ProcgenPoint point)
Append a point with an empty attribute row and return its row index.
Definition PointSet.cpp:62
Result< void > trySetIntAttribute(int index, const std::string &name, std::int64_t value)
Canonical checked signed integer metadata write.
Definition PointSet.cpp:351
Result< void > trySetFloatAttribute(int index, const std::string &name, float value)
Canonical checked float metadata write.
Definition PointSet.cpp:331
bool deserializeCell(const std::string &definition)
Atomically restore one cell produced by serializeCell for this world seed.
Definition RuntimeGenerationAsset.cpp:67
std::string serializeCell(int level, int x, int z) const
Serialize one active cell cache entry in a deterministic versioned format.
Definition RuntimeGenerationAsset.cpp:11
int getResidentPointCount() const
Return points retained by active or not-yet-acknowledged cleanup cells.
Definition RuntimeGeneration.cpp:113
Definition EvpackPointGraphLoader.h:12
Compact three-component value used by typed procedural metadata.
Definition AttributeTable.h:16
One deterministic sample used by script-first procedural pipelines.
Definition PointSet.h:17