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
23 glm::vec3 outline_color;
25 /// a string to display to the user
30 /// light level that blocks of this type emit
35 /// if true, stops light from propagating and fixes level to luminosity
38 /// whether to check for collisions at all
40 /// if the block should be impenetrable
43 // generation properties
44 /// whether to use this block in generation at all
46 // min/mid/max points for the respective properties
47 // should all be in the (-1,1) range
54 float min_temperature;
55 float mid_temperature;
56 float max_temperature;
60 /// commonness factor, random chance is multiplied by this
64 bool face[Block::FACE_COUNT];
65 Faces &operator =(const Faces &other) noexcept {
66 for (int i = 0; i < Block::FACE_COUNT; ++i) {
67 face[i] = other.face[i];
71 bool operator [](Block::Face f) const noexcept {
78 static const NullShape DEFAULT_SHAPE;
80 bool FaceFilled(const Block &block, Block::Face face) const noexcept {
81 return fill[block.OrientedFace(face)];
85 EntityModel::Buffer &m,
86 const glm::mat4 &transform = glm::mat4(1.0f),
87 EntityModel::Index idx_offset = 0
90 BlockModel::Buffer &m,
91 const glm::mat4 &transform = glm::mat4(1.0f),
92 BlockModel::Index idx_offset = 0
94 void FillOutlineModel(OutlineModel::Buffer &m) const noexcept;