MCPcopy Create free account
hub / github.com/OGRECave/ogre-next / getDualGrid

Method getDualGrid

Components/Volume/src/OgreVolumeDualGridGenerator.cpp:510–546  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

508 //-----------------------------------------------------------------------
509
510 Entity* DualGridGenerator::getDualGrid(SceneManager *sceneManager)
511 {
512 if (!mDualGrid && mDualCells.size() > 0)
513 {
514 ManualObject* manual = sceneManager->createManualObject();
515 manual->begin("BaseWhiteNoLighting", RenderOperation::OT_LINE_LIST);
516 manual->colour((Real)0.0, (Real)1.0, (Real)0.0);
517 manual->estimateVertexCount(mDualCells.size() * 8);
518 manual->estimateIndexCount(mDualCells.size() * 24);
519
520 uint32 baseIndex = 0;
521 for (VecDualCell::iterator it = mDualCells.begin(); it != mDualCells.end(); ++it)
522 {
523 MeshBuilder::addCubeToManualObject(
524 manual,
525 it->mC0,
526 it->mC1,
527 it->mC2,
528 it->mC3,
529 it->mC4,
530 it->mC5,
531 it->mC6,
532 it->mC7,
533 baseIndex);
534 }
535
536 manual->end();
537 mDualGridI++;
538 StringStream meshName;
539 meshName << "VolumeDualGridGridMesh" << mDualGridI;
540 manual->convertToMesh(meshName.str());
541 StringStream entityName;
542 entityName << "VolumeDualGrid" << mDualGridI;
543 mDualGrid = sceneManager->createEntity(entityName.str(), meshName.str());
544 }
545 return mDualGrid;
546 }
547
548}
549}

Callers 1

loadGeometryMethod · 0.80

Calls 9

createManualObjectMethod · 0.80
createEntityMethod · 0.80
sizeMethod · 0.45
beginMethod · 0.45
colourMethod · 0.45
estimateVertexCountMethod · 0.45
estimateIndexCountMethod · 0.45
endMethod · 0.45
convertToMeshMethod · 0.45

Tested by

no test coverage detected