载入中...
搜索中...
未找到
IncrementalBuild.h
浏览该文件的文档.
1#pragma once
2
3#include "common/Result.h"
5
6#include <cstdint>
7#include <unordered_map>
8#include <vector>
9
10namespace eve::procgen {
11
14 int x = 0;
15 int z = 0;
16 bool removed = false;
18};
19
22public:
24 [[nodiscard]] int getCount() const noexcept;
26 [[nodiscard]] int getClusterX(int index) const noexcept;
28 [[nodiscard]] int getClusterZ(int index) const noexcept;
30 [[nodiscard]] bool isRemoved(int index) const noexcept;
32 [[nodiscard]] Result<BuildLayerExecution> getArtifacts(int index) const;
33
34private:
36 std::vector<BuildClusterChange> changes_;
37};
38
48public:
60 [[nodiscard]] Result<IncrementalBuildDelta> update(const BuildLayerStack& stack, const Grid2D& grid,
61 const PointSet& points, int clusterSizeCells,
62 float cellSizeWorld, const PointSet* orientation = nullptr);
64 void clear();
66 [[nodiscard]] int getCachedClusterCount() const noexcept;
68 [[nodiscard]] Result<BuildLayerExecution> getCachedArtifacts(int clusterX, int clusterZ) const;
69
70private:
71 struct Record {
72 std::uint64_t hash = 0;
73 BuildLayerExecution artifacts;
74 };
75 std::unordered_map<std::uint64_t, Record> cache_;
76};
77
78} // namespace eve::procgen
std::array< std::uint8_t, 32 > hash
Definition Evpack.cpp:172
#define EVENGINE_API_DOMAINS
Definition Export.h:110
std::shared_ptr< const std::vector< glm::vec2 > > points
Move-only, checked operation results for the common layer.
uint32_t index
Move-only operation result carrying either a value or Status.
Definition Result.h:155
Immutable-by-convention result of one complete build-stack execution.
Ordered, versioned executor for procedural tile and object build layers.
Intermediate 2D generation result. cells store semantic ids (see Semantic.h), not tile GIDs — convert...
Definition Grid2D.h:36
Ordered changes required to synchronize a scene-side cluster cache.
Derived cluster cache that incrementally executes a BuildLayerStack.
Script-friendly collection of attributed 3D samples.
Definition PointSet.h:59
One cache mutation emitted by an incremental cluster rebuild.