| 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 | } |
no test coverage detected