-Subproject commit 424ac96eaafa7e1eb49fabcc9f670a5aa3f54ca3
+Subproject commit 7f1ebb8448f866ac28ea14b0dd8792edebedcf5a
type.texture = tex_index.GetID(tex_name);
} else if (name == "color") {
in.ReadVec(type.color);
+ } else if (name == "outline") {
+ in.ReadVec(type.outline_color);
} else if (name == "label") {
in.ReadString(type.label);
} else if (name == "luminosity") {
/// the number of vertex indices this shape's outline has
size_t OutlineIndexCount() const { return out_idx.size(); }
- /// fill given buffers with this shape's outline's elements with
- /// an optional offset
- void Outline(
- OutlineModel::Buffer &out,
- const OutlineModel::Position &offset = { 0.0f, 0.0f, 0.0f },
- OutlineModel::Index idx_offset = 0
- ) const;
+ /// fill given buffers with this shape's outline's elements
+ void Outline(OutlineModel::Buffer &out) const;
/// Check if given ray would pass though this shape if it were
/// transformed with given matrix.
}
}
-void Shape::Outline(
- OutlineModel::Buffer &out,
- const OutlineModel::Position &elem_offset,
- OutlineModel::Index idx_offset
-) const {
- for (const auto &pos : out_pos) {
- out.vertices.emplace_back(elem_offset + pos);
- }
- for (auto idx : out_idx) {
- out.indices.emplace_back(idx_offset + idx);
- }
+void Shape::Outline(OutlineModel::Buffer &out) const {
+ out.vertices.insert(out.vertices.end(), out_pos.begin(), out_pos.end());
+ out.indices.insert(out.indices.end(), out_idx.begin(), out_idx.end());
}
void Shape::SetShape(
const glm::mat4 &transform = glm::mat4(1.0f),
BlockModel::Index idx_offset = 0
) const noexcept;
- void FillOutlineModel(
- OutlineModel::Buffer &m,
- const glm::vec3 &pos_offset = { 0, 0, 0 },
- OutlineModel::Index idx_offset = 0
- ) const noexcept;
+ void FillOutlineModel(OutlineModel::Buffer &m) const noexcept;
};
buf.colors.insert(buf.colors.end(), shape->VertexCount(), color);
}
-void BlockType::FillOutlineModel(
- OutlineModel::Buffer &buf,
- const glm::vec3 &pos_offset,
- OutlineModel::Index idx_offset
-) const noexcept {
- shape->Outline(buf, pos_offset, idx_offset);
+void BlockType::FillOutlineModel(OutlineModel::Buffer &buf) const noexcept {
+ shape->Outline(buf);
buf.colors.insert(buf.colors.end(), shape->OutlineCount(), outline_color);
}