MCPcopy Create free account
hub / github.com/OGRECave/ogre / createSphere

Method createSphere

Samples/DeferredShading/src/GeomUtils.cpp:25–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23using namespace Ogre;
24
25void GeomUtils::createSphere( const String& strName
26 , float radius
27 , int nRings, int nSegments
28 , bool bNormals
29 , bool bTexCoords)
30{
31 MeshPtr pSphere = MeshManager::getSingleton().createManual(strName, ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
32 SubMesh *pSphereVertex = pSphere->createSubMesh();
33 pSphere->createVertexData();
34
35 createSphere(pSphere->sharedVertexData, pSphereVertex->indexData
36 , radius
37 , nRings, nSegments
38 , bNormals // need normals
39 , bTexCoords // need texture co-ordinates
40 );
41
42 // Generate face list
43 pSphereVertex->useSharedVertices = true;
44
45 // the original code was missing this line:
46 pSphere->_setBounds( AxisAlignedBox( Vector3(-radius, -radius, -radius), Vector3(radius, radius, radius) ), false );
47 pSphere->_setBoundingSphereRadius(radius);
48 // this line makes clear the mesh is loaded (avoids memory leaks)
49 pSphere->load();
50}
51
52void GeomUtils::createSphere(VertexData*& vertexData, IndexData*& indexData
53 , float radius

Callers

nothing calls this directly

Calls 14

Vector3Class · 0.85
_setBoundsMethod · 0.80
getVertexSizeMethod · 0.80
setBindingMethod · 0.80
unlockMethod · 0.80
AxisAlignedBoxClass · 0.50
createManualMethod · 0.45
createSubMeshMethod · 0.45
loadMethod · 0.45
getSizeMethod · 0.45
createVertexBufferMethod · 0.45

Tested by

no test coverage detected