- /// fill given buffers with this shape's elements with an
- /// optional transform and offset
- void Vertices(
- EntityMesh::Buffer &out,
- float tex_offset = 0.0f
+ std::size_t VertexCount() const noexcept { return vertices.size(); }
+ std::size_t IndexCount() const noexcept { return indices.size(); }
+
+ const glm::vec3 &VertexNormal(size_t idx) const noexcept {
+ return vertices[idx].normal;
+ }
+ glm::vec3 VertexNormal(size_t idx, const glm::mat4 &M) const noexcept {
+ return glm::vec3(M * glm::vec4(VertexNormal(idx), 0.0f));
+ }
+
+ void Fill(
+ EntityMesh::Buffer &,
+ const std::vector<float> &tex_map