1 #ifndef BLANK_WORLD_BLOCKTYPE_HPP_
2 #define BLANK_WORLD_BLOCKTYPE_HPP_
5 #include "../model/BlockModel.hpp"
6 #include "../model/EntityModel.hpp"
7 #include "../model/OutlineModel.hpp"
8 #include "../model/shapes.hpp"
10 #include <glm/glm.hpp>
16 /// attributes of a type of block
22 glm::vec3 outline_color;
24 // a string to display to the user
29 // light level that blocks of this type emit
34 // if true, stops light from propagating and fixes level to luminosity
37 // whether to check for collisions at all
39 // if the block should be impenetrable
43 bool face[Block::FACE_COUNT];
44 Faces &operator =(const Faces &other) noexcept {
45 for (int i = 0; i < Block::FACE_COUNT; ++i) {
46 face[i] = other.face[i];
50 bool operator [](Block::Face f) const noexcept {
57 const glm::vec3 &color = { 1, 1, 1 },
58 const Shape *shape = &DEFAULT_SHAPE
61 static const NullShape DEFAULT_SHAPE;
63 bool FaceFilled(const Block &block, Block::Face face) const noexcept {
64 return fill[block.OrientedFace(face)];
68 EntityModel::Buffer &m,
69 const glm::mat4 &transform = glm::mat4(1.0f),
70 EntityModel::Index idx_offset = 0
73 BlockModel::Buffer &m,
74 const glm::mat4 &transform = glm::mat4(1.0f),
75 BlockModel::Index idx_offset = 0
77 void FillOutlineModel(
78 OutlineModel::Buffer &m,
79 const glm::vec3 &pos_offset = { 0, 0, 0 },
80 OutlineModel::Index idx_offset = 0