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;
25 // light level that blocks of this type emit
30 // if true, stops light from propagating and fixes level to luminosity
33 // whether to check for collisions at all
35 // if the block should be impenetrable
39 bool face[Block::FACE_COUNT];
40 Faces &operator =(const Faces &other) noexcept {
41 for (int i = 0; i < Block::FACE_COUNT; ++i) {
42 face[i] = other.face[i];
46 bool operator [](Block::Face f) const noexcept {
53 const glm::vec3 &color = { 1, 1, 1 },
54 const Shape *shape = &DEFAULT_SHAPE
57 static const NullShape DEFAULT_SHAPE;
59 bool FaceFilled(const Block &block, Block::Face face) const noexcept {
60 return fill[block.OrientedFace(face)];
65 const glm::mat4 &transform = glm::mat4(1.0f),
66 Model::Index idx_offset = 0
69 BlockModel::Buffer &m,
70 const glm::mat4 &transform = glm::mat4(1.0f),
71 BlockModel::Index idx_offset = 0
73 void FillOutlineModel(
75 const glm::vec3 &pos_offset = { 0, 0, 0 },
76 OutlineModel::Index idx_offset = 0