- /// the number of vertices (and normals) this shape has
- size_t VertexCount() const noexcept { return vtx_pos.size(); }
- /// the number of vertex indices this shape has
- size_t VertexIndexCount() const noexcept { return vtx_idx.size(); }
-
- const EntityMesh::Normal &VertexNormal(size_t idx) const noexcept { return vtx_nrm[idx]; }
- EntityMesh::Normal VertexNormal(
- size_t idx, const glm::mat4 &transform
- ) const noexcept {
- return EntityMesh::Normal(transform * glm::vec4(vtx_nrm[idx], 0.0f));
- }
-
- /// fill given buffers with this shape's elements with an
- /// optional transform and offset
- void Vertices(
- EntityMesh::Buffer &out,
- float tex_offset = 0.0f
- ) const;
- void Vertices(
- EntityMesh::Buffer &out,
- const glm::mat4 &transform,
- float tex_offset = 0.0f,
- EntityMesh::Index idx_offset = 0
- ) const;
- void Vertices(
- BlockMesh::Buffer &out,
- const glm::mat4 &transform,
- float tex_offset = 0.0f,
- BlockMesh::Index idx_offset = 0
- ) const;
-