Skip to content
Snippets Groups Projects
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
Branches feature/template_bases
No related tags found
1 merge request!20Added void add_ico_sphere(...)
...@@ -14,7 +14,7 @@ namespace polymesh::objects ...@@ -14,7 +14,7 @@ namespace polymesh::objects
/// Adds a (subdivided) ico_sphere to the given mesh /// 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 /// sf is called with (v, x, y, z), with vertex handle v and coordinates (x,y,z) on the unit sphere
template <class SphereF> 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); POLYMESH_ASSERT(subdiv >= 0);
...@@ -25,5 +25,6 @@ void add_ico_sphere(Mesh& m, SphereF&& sf, int 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); 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);
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment