X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fblock.cpp;h=6e6ac18533d7cf10173a121b4f79839b4e8c3d21;hb=4485397da18a25dfd1a51e864814887b66ba0f2e;hp=50ade3901fd65aebdf96ef29ebd2499fc6ffbf41;hpb=75e72685a7398d2e30d51fadeaacde849518e188;p=blank.git diff --git a/src/block.cpp b/src/block.cpp index 50ade39..6e6ac18 100644 --- a/src/block.cpp +++ b/src/block.cpp @@ -51,7 +51,9 @@ BlockType::BlockType(bool v, const glm::vec3 &col, const Shape *s) , color(col) , outline_color(-1, -1, -1) , id(0) +, luminosity(0) , visible(v) +, block_light(false) , fill({ false, false, false, false, false, false }) { } @@ -100,6 +102,15 @@ void BlockType::FillModel( buf.colors.insert(buf.colors.end(), shape->VertexCount(), color); } +void BlockType::FillBlockModel( + BlockModel::Buffer &buf, + const glm::mat4 &transform, + BlockModel::Index idx_offset +) const { + shape->Vertices(buf.vertices, buf.normals, buf.indices, transform, idx_offset); + buf.colors.insert(buf.colors.end(), shape->VertexCount(), color); +} + void BlockType::FillOutlineModel( OutlineModel &model, const glm::vec3 &pos_offset,