24 uint64_t node_rid = 0;
33 uint64_t generation = 0;
34 std::shared_ptr<const std::vector<VoxelRegion>> regions;
37 static constexpr size_t k_max_entries = 32;
40 static auto extend(
const VoxelChangeHistory& previous, uint64_t generation, std::vector<VoxelRegion> regions)
44 template<
typename Visit>
45 auto forEachSince(uint64_t generation, Visit&& visit)
const ->
bool {
46 const auto known = std::ranges::find(m_entries, generation, &Entry::generation);
47 if (known == m_entries.end()) {
50 for (
auto entry = std::next(known); entry != m_entries.end(); ++entry) {
59 std::vector<Entry> m_entries;
63 uint64_t node_rid = 0;
68using PublishedDims = std::function<std::optional<glm::uvec3>(uint64_t)>;
72 uint64_t node_rid = 0;
86 std::span<const TrackedVolume> volumes,
const PublishedDims& published_dims, std::vector<VolumeDelta>* deltas =
nullptr
99 uint64_t node_rid = 0;
100 uint64_t volume_id = 0;
101 uint32_t content = 0;
104 std::vector<Seen> m_seen;
107 std::vector<VoxelRegion> m_unpublished;
108 bool m_has_pending =
false;
112 uint64_t node_rid = 0;
113 glm::mat4 model {1.0f};
119 const VoxelChangeHistory& history, uint64_t generation, std::span<const VoxelCaster> casters,
120 std::span<const FrustumPlanes> views
Regions each published voxel storage brought oldest first.
Definition voxel_change_history.hpp:30
auto forEachSince(uint64_t generation, Visit &&visit) const -> bool
Definition voxel_change_history.hpp:45
Finds what changed in each volume between packs and keeps it until a storage carrying it is published...
Definition voxel_change_history.hpp:82
void observe(std::span< const TrackedVolume > volumes, const PublishedDims &published_dims, std::vector< VolumeDelta > *deltas=nullptr)
Call with the voxel lock held since it reads and then discards the dirty bricks of every volume.
Definition voxel_change_history.cpp:96
void published()
The storage from the last packed() is now the one frames use.
Definition voxel_change_history.cpp:154
auto packed(uint64_t generation) -> VoxelChangeHistory
Definition voxel_change_history.cpp:144
Definition voxel_volume.hpp:21
Definition voxel_change_history.hpp:62
What one volume changed since the observe before.
Definition voxel_change_history.hpp:71
bool unknown
New or replaced or its history was discarded so only a full pack describes it.
Definition voxel_change_history.hpp:75
std::vector< uint32_t > bricks
Grid indices of the bricks written.
Definition voxel_change_history.hpp:78
Definition voxel_change_history.hpp:111
Definition voxel_change_history.hpp:32
A box that changed in the voxel space of one volume.
Definition voxel_change_history.hpp:23
auto regionsReach(const VoxelChangeHistory &history, uint64_t generation, std::span< const VoxelCaster > casters, std::span< const FrustumPlanes > views) -> bool
True when a region published after generation reaches one of the views or when that generation is gon...
Definition voxel_change_history.cpp:172
std::function< std::optional< glm::uvec3 >(uint64_t)> PublishedDims
Brick dims of a volume in the storage frames use or nullopt when it is not in there.
Definition voxel_change_history.hpp:68