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>
18 class TokenStreamReader;
21 /// attributes of a type of block
25 std::vector<float> textures;
28 glm::vec3 outline_color;
30 /// a string to display to the user
38 /// light level that blocks of this type emit
43 /// if true, stops light from propagating and fixes level to luminosity
46 /// whether to check for collisions at all
48 /// if the block should be impenetrable
51 // generation properties
52 /// whether to use this block in generation at all
54 // min/mid/max points for the respective properties
55 // should all be in the (-1,1) range
62 float min_temperature;
63 float mid_temperature;
64 float max_temperature;
68 /// commonness factor, random chance is multiplied by this
74 TokenStreamReader &in,
75 ResourceIndex &snd_index,
76 ResourceIndex &tex_index,
77 const ShapeRegistry &shapes);
79 bool FaceFilled(const Block &block, Block::Face face) const noexcept {
80 return shape && shape->FaceFilled(block.OrientedFace(face));
84 EntityMesh::Buffer &m,
85 const glm::mat4 &transform = glm::mat4(1.0f)
89 const glm::mat4 &transform = glm::mat4(1.0f),
90 BlockMesh::Index idx_offset = 0
92 void OutlinePrimitiveMesh(PrimitiveMesh::Buffer &) const noexcept;