MCPcopy Create free account
hub / github.com/assimp/assimp / MakeSphere

Method MakeSphere

code/Common/StandardShapes.cpp:351–364  ·  view source on GitHub ↗

------------------------------------------------------------------------------------------------ Create a subdivision sphere

Source from the content-addressed store, hash-verified

349// ------------------------------------------------------------------------------------------------
350// Create a subdivision sphere
351void StandardShapes::MakeSphere(unsigned int tess,
352 std::vector<aiVector3D> &positions) {
353 // Reserve enough storage. Every subdivision
354 // splits each triangle in 4, the icosahedron consists of 60 verts
355 positions.reserve(positions.size() + 60 * integer_pow(4, tess));
356
357 // Construct an icosahedron to start with
358 MakeIcosahedron(positions);
359
360 // ... and subdivide it until the requested output
361 // tessellation is reached
362 for (unsigned int i = 0; i < tess; ++i)
363 Subdivide(positions);
364}
365
366// ------------------------------------------------------------------------------------------------
367// Build a cone

Callers

nothing calls this directly

Calls 4

integer_powFunction · 0.85
SubdivideFunction · 0.85
reserveMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected