]> git.localhorst.tv Git - blank.git/blobdiff - src/chunk.hpp
orientable blocks
[blank.git] / src / chunk.hpp
index e442e4e289107ee735417c9677ffa6157b42396d..255d73b163f70ff25db4bade6f1b9a087a767aee 100644 (file)
@@ -51,6 +51,18 @@ public:
                        0.5f + (idx / (Width() * Height()))
                );
        }
+       glm::mat4 ToTransform(int idx) const;
+
+       static constexpr bool IsBorder(int idx) {
+               return
+                       idx < Width() * Height() ||
+                       (idx / Width()) % Height() == 0 ||
+                       (idx / Width()) % Height() == Height() - 1 ||
+                       (idx / (Width() * Height())) == Depth() - 1;
+       }
+
+       // check if block at given index is completely enclosed (and therefore invisible)
+       bool Obstructed(int idx) const;
 
        void Allocate();
        void Invalidate() { dirty = true; }