1 #ifndef BLANK_WORLD_BLOCKTYPE_HPP_
2 #define BLANK_WORLD_BLOCKTYPE_HPP_
5 #include "../graphics/BlockMesh.hpp"
6 #include "../graphics/EntityMesh.hpp"
7 #include "../graphics/PrimitiveMesh.hpp"
8 #include "../model/Shape.hpp"
10 #include <glm/glm.hpp>
17 /// attributes of a type of block
21 std::vector<float> textures;
24 glm::vec3 outline_color;
26 /// a string to display to the user
34 /// light level that blocks of this type emit
39 /// if true, stops light from propagating and fixes level to luminosity
42 /// whether to check for collisions at all
44 /// if the block should be impenetrable
47 // generation properties
48 /// whether to use this block in generation at all
50 // min/mid/max points for the respective properties
51 // should all be in the (-1,1) range
58 float min_temperature;
59 float mid_temperature;
60 float max_temperature;
64 /// commonness factor, random chance is multiplied by this
69 bool FaceFilled(const Block &block, Block::Face face) const noexcept {
70 return shape && shape->FaceFilled(block.OrientedFace(face));
74 EntityMesh::Buffer &m,
75 const glm::mat4 &transform = glm::mat4(1.0f)
79 const glm::mat4 &transform = glm::mat4(1.0f),
80 BlockMesh::Index idx_offset = 0
82 void OutlinePrimitiveMesh(PrimitiveMesh::Buffer &) const noexcept;