voxel, animation, and pathfinding combined demo

This commit is contained in:
John McCardle 2026-02-05 22:57:08 -05:00
commit de5616f3a4
6 changed files with 730 additions and 2 deletions

View file

@ -64,6 +64,7 @@ private:
mutable bool meshDirty_ = true;
mutable std::vector<MeshVertex> cachedVertices_;
bool greedyMeshing_ = false; // Use greedy meshing algorithm
bool visible_ = true; // Visibility toggle for rendering
// Index calculation (row-major: X varies fastest, then Y, then Z)
inline size_t index(int x, int y, int z) const {
@ -163,6 +164,10 @@ public:
void setGreedyMeshing(bool enabled) { greedyMeshing_ = enabled; markDirty(); }
bool isGreedyMeshingEnabled() const { return greedyMeshing_; }
/// Show/hide this voxel grid in rendering
void setVisible(bool v) { visible_ = v; }
bool isVisible() const { return visible_; }
// Memory info (for debugging)
size_t memoryUsageBytes() const {
return data_.size() + materials_.size() * sizeof(VoxelMaterial);