1 #ifndef BLANK_WORLD_BLOCKTYPE_HPP_
2 #define BLANK_WORLD_BLOCKTYPE_HPP_
5 #include "BlockGravity.hpp"
6 #include "../graphics/BlockMesh.hpp"
7 #include "../graphics/EntityMesh.hpp"
8 #include "../graphics/PrimitiveMesh.hpp"
9 #include "../model/Shape.hpp"
11 #include <glm/glm.hpp>
19 class TokenStreamReader;
22 /// attributes of a type of block
26 std::vector<float> textures;
29 glm::vec3 outline_color;
31 /// gravity configuration or null if not emitting gravity
32 std::unique_ptr<BlockGravity> gravity;
34 /// a string to display to the user
42 /// light level that blocks of this type emit
47 /// if true, stops light from propagating and fixes level to luminosity
50 /// whether to check for collisions at all
52 /// if the block should be impenetrable
55 // generation properties
56 /// whether to use this block in generation at all
58 // min/mid/max points for the respective properties
59 // should all be in the (-1,1) range
66 float min_temperature;
67 float mid_temperature;
68 float max_temperature;
72 /// commonness factor, random chance is multiplied by this
78 TokenStreamReader &in,
79 ResourceIndex &snd_index,
80 ResourceIndex &tex_index,
81 const ShapeRegistry &shapes);
83 bool FaceFilled(const Block &block, Block::Face face) const noexcept {
84 return shape && shape->FaceFilled(block.OrientedFace(face));
88 EntityMesh::Buffer &m,
89 const glm::mat4 &transform = glm::mat4(1.0f)
93 const glm::mat4 &transform = glm::mat4(1.0f),
94 BlockMesh::Index idx_offset = 0
96 void OutlinePrimitiveMesh(PrimitiveMesh::Buffer &) const noexcept;