Commit 19115b64 authored by Julius Nehring-Wirxel's avatar Julius Nehring-Wirxel
Browse files

Return handle to first vertex of the newly added sphere.

parent 332c4ccd
......@@ -14,7 +14,7 @@ namespace polymesh::objects
/// Adds a (subdivided) ico_sphere to the given mesh
/// sf is called with (v, x, y, z), with vertex handle v and coordinates (x,y,z) on the unit sphere
template <class SphereF>
void add_ico_sphere(Mesh& m, SphereF&& sf, int subdiv = 0)
vertex_handle add_ico_sphere(Mesh& m, SphereF&& sf, int subdiv = 0)
{
POLYMESH_ASSERT(subdiv >= 0);
......@@ -25,5 +25,6 @@ void add_ico_sphere(Mesh& m, SphereF&& sf, int subdiv = 0)
{
sf(vertex_index(last_vertex_count + i).of(m), positions[i].x, positions[i].y, positions[i].z);
}
return vertex_index(last_vertex_count).of(m);
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment