const glm::vec3 &outline_color = { -1, -1, -1 })
: id(-1), visible(v), shape(shape), color(color), outline_color(outline_color) { }
- static const BlockType DEFAULT;
static const NullShape DEFAULT_SHAPE;
- void FillVBO(
- const glm::vec3 &pos,
- std::vector<glm::vec3> &vertices,
- std::vector<glm::vec3> &colors,
- std::vector<glm::vec3> &normals
+ void FillModel(
+ Model &m,
+ const glm::vec3 &pos_offset = { 0, 0, 0 },
+ Model::Index idx_offset = 0
) const;
-
- void FillModel(const glm::vec3 &pos, Model &m) const {
- FillVBO(pos, m.vertices, m.colors, m.normals);
- m.Invalidate();
- }
-
-
- void FillOutlineVBO(
- std::vector<glm::vec3> &vertices,
- std::vector<glm::vec3> &colors
+ void FillOutlineModel(
+ OutlineModel &m,
+ const glm::vec3 &pos_offset = { 0, 0, 0 },
+ OutlineModel::Index idx_offset = 0
) const;
- void FillOutlineModel(OutlineModel &m) const {
- FillOutlineVBO(m.vertices, m.colors);
- m.Invalidate();
- }
-
};
/// single 1x1x1 cube
struct Block {
- const BlockType *type;
+ using Pos = glm::vec3;
+
+ int type;
- constexpr explicit Block(const BlockType *t = &BlockType::DEFAULT)
- : type(t) { }
+ constexpr explicit Block(int type = 0)
+ : type(type) { }
};