1 #ifndef BLANK_WORLD_BLOCKTYPE_HPP_
2 #define BLANK_WORLD_BLOCKTYPE_HPP_
5 #include "../model/BlockModel.hpp"
6 #include "../model/Model.hpp"
7 #include "../model/OutlineModel.hpp"
8 #include "../model/shapes.hpp"
10 #include <glm/glm.hpp>
16 /// attributes of a type of block
21 glm::vec3 outline_color;
31 bool face[Block::FACE_COUNT];
32 Faces &operator =(const Faces &other) noexcept {
33 for (int i = 0; i < Block::FACE_COUNT; ++i) {
34 face[i] = other.face[i];
38 bool operator [](Block::Face f) const noexcept {
45 const glm::vec3 &color = { 1, 1, 1 },
46 const Shape *shape = &DEFAULT_SHAPE
49 static const NullShape DEFAULT_SHAPE;
51 bool FaceFilled(const Block &block, Block::Face face) const noexcept {
52 return fill[block.OrientedFace(face)];
57 const glm::mat4 &transform = glm::mat4(1.0f),
58 Model::Index idx_offset = 0
61 BlockModel::Buffer &m,
62 const glm::mat4 &transform = glm::mat4(1.0f),
63 BlockModel::Index idx_offset = 0
65 void FillOutlineModel(
67 const glm::vec3 &pos_offset = { 0, 0, 0 },
68 OutlineModel::Index idx_offset = 0