6 const NullShape BlockType::DEFAULT_SHAPE;
8 BlockType::BlockType(bool v, const glm::vec3 &col, const Shape *s)
11 , outline_color(-1, -1, -1)
14 , fill({ false, false, false, false, false, false }) {
18 void BlockType::FillModel(
20 const glm::vec3 &pos_offset,
21 Model::Index idx_offset
23 shape->Vertices(buf.vertices, buf.normals, buf.indices, pos_offset, idx_offset);
24 buf.colors.insert(buf.colors.end(), shape->VertexCount(), color);
27 void BlockType::FillOutlineModel(
29 const glm::vec3 &pos_offset,
30 OutlineModel::Index idx_offset
32 shape->Outline(model.vertices, model.indices, pos_offset, idx_offset);
33 model.colors.insert(model.colors.end(), shape->OutlineCount(), outline_color);
37 BlockTypeRegistry::BlockTypeRegistry() {
41 Block::Type BlockTypeRegistry::Add(const BlockType &t) {
42 int id = types.size();