]> git.localhorst.tv Git - blank.git/blobdiff - src/block.hpp
allow face/turn selection of placed blocks
[blank.git] / src / block.hpp
index 3777e6d77b6169d345ca73592d4f7b54182c765c..a142a96256e285e3acfca5b6848e04df00e4ebc0 100644 (file)
@@ -42,6 +42,11 @@ struct Block {
 
        const glm::mat4 &Transform() const;
 
+       Face GetFace() const { return Face(orient / 4); }
+       void SetFace(Face face) { orient = face * TURN_COUNT + GetTurn(); }
+       Turn GetTurn() const { return Turn(orient % 4); }
+       void SetTurn(Turn turn) { orient = GetFace() * TURN_COUNT + turn; }
+
 };
 
 
@@ -57,10 +62,10 @@ struct BlockType {
        bool visible;
 
        struct Faces {
+               bool up;
+               bool down;
                bool right;
                bool left;
-               bool top;
-               bool bottom;
                bool front;
                bool back;
        } fill;