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

Method getDualGrid

Components/Volume/src/OgreVolumeDualGridGenerator.cpp:511–547  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

loadGeometryMethod · 0.80

Calls 8

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

Tested by

no test coverage detected