-----------------------------------------------------------------------------
| 435 | } |
| 436 | //----------------------------------------------------------------------------- |
| 437 | MeshPtr ManualObject::convertToMesh(const String& meshName, const String& groupName) |
| 438 | { |
| 439 | OgreAssert(!mCurrentSection, "You cannot call convertToMesh() whilst you are in the middle of " |
| 440 | "defining the object; call end() first."); |
| 441 | OgreAssert(!mSectionList.empty(), "No data defined to convert to a mesh."); |
| 442 | |
| 443 | MeshPtr m = MeshManager::getSingleton().createManual(meshName, groupName); |
| 444 | |
| 445 | for (auto sec : mSectionList) |
| 446 | { |
| 447 | SubMesh* sm = m->createSubMesh(); |
| 448 | sec->convertToSubMesh(sm); |
| 449 | sm->setMaterial(sec->getMaterial()); |
| 450 | } |
| 451 | // update bounds |
| 452 | m->_setBounds(mAABB); |
| 453 | m->_setBoundingSphereRadius(mRadius); |
| 454 | |
| 455 | m->load(); |
| 456 | |
| 457 | return m; |
| 458 | } |
| 459 | //----------------------------------------------------------------------------- |
| 460 | void ManualObject::setUseIdentityProjection(bool useIdentityProjection) |
| 461 | { |