Ignore:
Timestamp:
04/06/06 20:48:19 (18 years ago)
Author:
igarcia
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/src/LBBCManager.cpp

    r721 r731  
    44namespace LBBC { 
    55 
    6 Manager::Manager()  
    7         : BBC::Manager()  
     6LBBCManager::LBBCManager()  
     7        : BBC::BBCManager()  
    88{ 
    99        mBillboardCloudSerializer = new KMeansClusterSerializer(); 
     
    1515} 
    1616 
    17 Manager::~Manager()  
     17LBBCManager::~LBBCManager()  
    1818{ 
    1919        if (mOgreMeshSerializer) 
     
    2121                delete mOgreMeshSerializer; 
    2222        } 
    23         if (mSampleConfigFile) 
    24         { 
    25                 delete mSampleConfigFile; 
    26         } 
     23        // Gametools -- BUG: 06/04/2006 
     24        //if (mSampleConfigFile) 
     25        //{ 
     26        //      delete mSampleConfigFile; 
     27        //} 
    2728        if (mLeafDistributionSerializer) 
    2829        { 
     
    5253} 
    5354 
    54 SampleConfigFile* Manager::getSampleConfigFile() 
     55SampleConfigFile* LBBCManager::getSampleConfigFile() 
    5556{ 
    5657        return mSampleConfigFile; 
    5758} 
    5859 
    59 void Manager::setSampleConfigFile(SampleConfigFile *sampleConfigFile) 
     60void LBBCManager::setSampleConfigFile(SampleConfigFile *sampleConfigFile) 
    6061{ 
    6162        mSampleConfigFile = sampleConfigFile; 
    6263} 
    6364 
    64 void Manager::loadSampleConfigFile(Ogre::String sampleConfigFile) 
     65void LBBCManager::loadSampleConfigFile(Ogre::String sampleConfigFile) 
    6566{ 
    6667        mSampleConfigFile = new SampleConfigFile(); 
     
    6869} 
    6970 
    70 void Manager::runSampleConfigFile() 
     71void LBBCManager::runSampleConfigFile() 
    7172{ 
    7273        mLeaves = new Leaves(); 
    7374         
    7475        BBC::EntityPtr entityLeaves(new BBC::Entity); 
    75         BBC::MeshPtr meshLeaves(new BBC::Mesh(this->loadMesh(mSampleConfigFile->getEntitiesFolder(), mSampleConfigFile->getEntitiesMeshPrefixFilename() + ".mesh")) ); 
     76        BBC::MeshPtr meshLeaves(new BBC::Mesh(this->loadMesh(mSampleConfigFile->getEntitiesFolder(), mSampleConfigFile->getEntitiesMeshPrefixName() + ".mesh")) ); 
    7677        entityLeaves->setMesh(meshLeaves);       
    7778        mLeaves->setEntity(entityLeaves); 
     
    8788        } 
    8889         
     90        if (mSampleConfigFile->getEntitySampleMeshGeneration()) 
     91        { 
     92                saveSingleEntity(); 
     93        } 
     94 
    8995        if (mSampleConfigFile->getEntityClustersGeneration()) 
    9096        { 
     
    96102                generateBillboardCloud(); 
    97103        }        
    98 } 
    99  
    100 void Manager::createEntityDistribution() 
     104 
     105} 
     106 
     107void LBBCManager::createEntityDistribution() 
    101108{ 
    102109        mLeafDistributionGenerator->setDistribution(mLeaves->getDistribution()); 
     
    105112} 
    106113 
    107 void Manager::saveEntityDistributionSplitted() 
     114void LBBCManager::saveEntityDistributionSplitted() 
    108115{ 
    109116        BBC::EntityPtr entity; 
     
    143150                        mOgreMeshSerializer->setEntity(entity); 
    144151                        mOgreMeshSerializer->exportMesh(mSampleConfigFile->getEntityClustersFolder() + 
    145                                 mSampleConfigFile->getEntityClustersMeshPrefixFilename() + "Splitted.mesh", false, false); 
     152                                mSampleConfigFile->getEntityClustersMeshPrefixName() + "Splitted.mesh", false, false); 
    146153                         
    147                         OBA::OgreBase::getSingleton().getMeshSerializer()->exportMesh(entity->getMesh()->get(), mSampleConfigFile->getEntityDistributionFolder() + mSampleConfigFile->getEntitiesMeshPrefixFilename() + "Splitted.mesh"); 
    148                         //OBA::OgreBase::getSingleton().getXMLMeshSerializer()->exportMesh(entity->getMesh().get(), mSampleConfigFile->getEntityClustersFolder() + mSampleConfigFile->getEntitiesMeshPrefixFilename() + "Splitted.mesh" + ".xml");                       
     154                        OBA::OgreBase::getSingleton().getMeshSerializer()->exportMesh(entity->getMesh()->get(), mSampleConfigFile->getEntityDistributionFolder() + mSampleConfigFile->getEntitiesMeshPrefixName() + "Splitted.mesh"); 
     155                        //OBA::OgreBase::getSingleton().getXMLMeshSerializer()->exportMesh(entity->getMesh().get(), mSampleConfigFile->getEntityClustersFolder() + mSampleConfigFile->getEntitiesMeshPrefixName() + "Splitted.mesh" + ".xml");                   
    149156                } 
    150157        } 
     
    157164                mOgreMeshSerializer->setEntity(entity); 
    158165                mOgreMeshSerializer->exportMesh(mSampleConfigFile->getEntityClustersFolder() + 
    159                         mSampleConfigFile->getEntityClustersMeshPrefixFilename() + "Merged.mesh", false, false); 
    160                  
    161                 OBA::OgreBase::getSingleton().getMeshSerializer()->exportMesh((Ogre::Mesh*)entity->getMesh().get(), mSampleConfigFile->getEntityDistributionFolder() + mSampleConfigFile->getEntitiesMeshPrefixFilename() + "Merged.mesh"); 
    162                 //OBA::OgreBase::getSingleton().getXMLMeshSerializer()->exportMesh(entity->getMesh(), mSampleConfigFile->getEntityClustersFolder() + mSampleConfigFile->getEntitiesMeshPrefixFilename() + "Merged.mesh" + ".xml");               
    163  
    164                 //Ogre::MeshManager::getSingleton().unload(mSampleConfigFile->getEntitiesMeshPrefixFilename() + "Merged.mesh"); 
    165         } 
    166 } 
    167  
    168 void Manager::saveEntityDistributionXML() 
     166                        mSampleConfigFile->getEntityClustersMeshPrefixName() + "Merged.mesh", false, false); 
     167                 
     168                OBA::OgreBase::getSingleton().getMeshSerializer()->exportMesh((Ogre::Mesh*)entity->getMesh().get(), mSampleConfigFile->getEntityDistributionFolder() + mSampleConfigFile->getEntitiesMeshPrefixName() + "Merged.mesh"); 
     169                //OBA::OgreBase::getSingleton().getXMLMeshSerializer()->exportMesh(entity->getMesh(), mSampleConfigFile->getEntityClustersFolder() + mSampleConfigFile->getEntitiesMeshPrefixName() + "Merged.mesh" + ".xml");                           
     170        } 
     171} 
     172 
     173void LBBCManager::saveEntityDistributionXML() 
    169174{ 
    170175        TiXmlDocument *document = mLeafDistributionSerializer->create( 
    171176                                                                        mSampleConfigFile->getEntityDistributionFolder() + 
    172                                                                         mSampleConfigFile->getEntityDistributionXMLPrefixFilename() + ".xml"); 
     177                                                                        mSampleConfigFile->getEntityDistributionXMLPrefixName() + ".xml"); 
    173178        mLeafDistributionSerializer->setLeafDistribution(mLeaves->getDistribution()); 
    174179        mLeafDistributionSerializer->writeLeafDistribution(document);    
     
    176181} 
    177182 
    178 void Manager::loadEntityDistribution() 
     183void LBBCManager::loadEntityDistribution() 
    179184{ 
    180185        TiXmlDocument *document = mLeafDistributionSerializer->load( 
    181186                                                                        mSampleConfigFile->getEntityDistributionFolder() + 
    182                                                                         mSampleConfigFile->getEntityDistributionXMLPrefixFilename() + ".xml"); 
     187                                                                        mSampleConfigFile->getEntityDistributionXMLPrefixName() + ".xml"); 
    183188        mLeafDistributionSerializer->setLeafDistribution(mLeaves->getDistribution()); 
    184189        mLeafDistributionSerializer->getEntity()->setMesh(mLeaves->getEntity()->getMesh()); 
     
    188193        BBC::EntityDistribution *entityDistribution; 
    189194 
    190         BBC::MeshPtr pMeshLeavesSplitted(new BBC::Mesh(this->loadMesh(mSampleConfigFile->getEntitiesFolder(), mSampleConfigFile->getEntitiesMeshPrefixFilename() + "Splitted.mesh"))); 
     195        BBC::MeshPtr pMeshLeavesSplitted(new BBC::Mesh(this->loadMesh(mSampleConfigFile->getEntitiesFolder(), mSampleConfigFile->getEntitiesMeshPrefixName() + "Splitted.mesh"))); 
    191196        entity = BBC::EntityPtr(new BBC::Entity()); 
    192197        entity->setMesh(pMeshLeavesSplitted); 
     
    211216} 
    212217 
    213 void Manager::generateEntityDistribution() 
     218void LBBCManager::generateEntityDistribution() 
    214219{ 
    215220        if (mSampleConfigFile->getEntityDistributionGeneration()) 
     
    221226} 
    222227 
    223 void Manager::saveBillboardCloudGrouped() 
     228void LBBCManager::saveBillboardCloudGrouped() 
    224229{ 
    225230        for (unsigned int iSubEntity = 0; iSubEntity < mLeaves->getBillboardCloud()->getEntity()->getNumSubEntities(); iSubEntity++) 
    226231        { 
    227232                BBC::SubEntityPtr subEntity = mLeaves->getBillboardCloud()->getEntity()->getSubEntity(iSubEntity); 
    228                 subEntity->setMaterialName(mSampleConfigFile->getBillboardCloudMaterialPrefixFilename()); 
     233                subEntity->setMaterialName(mSampleConfigFile->getBillboardCloudBillboardGroupMaterialPrefixName()); 
    229234        } 
    230235        mOgreMeshSerializer->setEntity(mLeaves->getBillboardCloud()->getEntity()); 
     
    232237        Ogre::LogManager::getSingleton().logMessage("Num.SubEntities:" + Ogre::StringConverter::toString(mLeaves->getBillboardCloud()->getEntity()->getNumSubEntities())); 
    233238        mOgreMeshSerializer->exportMesh(mSampleConfigFile->getBillboardCloudFolder() + 
    234                                 mSampleConfigFile->getBillboardCloudMeshPrefixFilename() + "Grouped.mesh",false, false); 
    235         OBA::OgreBase::getSingleton().getMeshSerializer()->exportMesh(mLeaves->getBillboardCloud()->getEntity()->getMesh()->get(), mSampleConfigFile->getBillboardCloudFolder() + mSampleConfigFile->getBillboardCloudMeshPrefixFilename() + "Grouped.mesh"); 
    236         OBA::OgreBase::getSingleton().getXMLMeshSerializer()->exportMesh(mLeaves->getBillboardCloud()->getEntity()->getMesh()->get(), mSampleConfigFile->getBillboardCloudFolder() + mSampleConfigFile->getBillboardCloudMeshPrefixFilename() + "Grouped.mesh.xml"); 
    237  
    238         //Ogre::MeshManager::getSingleton().unload(mSampleConfigFile->getBillboardCloudMeshPrefixFilename() + "Grouped.mesh"); 
    239 } 
    240  
    241  
    242 void Manager::saveBillboardCloudSplitted() 
     239                                mSampleConfigFile->getBillboardCloudMeshPrefixName() + "Grouped.mesh",false, false); 
     240        OBA::OgreBase::getSingleton().getMeshSerializer()->exportMesh(mLeaves->getBillboardCloud()->getEntity()->getMesh()->get(), mSampleConfigFile->getBillboardCloudFolder() + mSampleConfigFile->getBillboardCloudMeshPrefixName() + "Grouped.mesh"); 
     241        OBA::OgreBase::getSingleton().getXMLMeshSerializer()->exportMesh(mLeaves->getBillboardCloud()->getEntity()->getMesh()->get(), mSampleConfigFile->getBillboardCloudFolder() + mSampleConfigFile->getBillboardCloudMeshPrefixName() + "Grouped.mesh.xml"); 
     242} 
     243 
     244 
     245void LBBCManager::saveBillboardCloudSplitted() 
    243246{        
    244247        for (unsigned int iSubEntity = 0; iSubEntity < mLeaves->getBillboardCloud()->getEntity()->getNumSubEntities(); iSubEntity++) 
    245248        { 
    246249                BBC::SubEntityPtr subEntity = mLeaves->getBillboardCloud()->getEntity()->getSubEntity(iSubEntity); 
    247                 subEntity->setMaterialName(mSampleConfigFile->getBillboardCloudMaterialPrefixFilename()); 
     250                subEntity->setMaterialName(mSampleConfigFile->getBillboardCloudBillboardMaterialPrefixName()); 
    248251        } 
    249252 
     
    253256 
    254257        mOgreMeshSerializer->exportMesh(mSampleConfigFile->getBillboardCloudFolder() + 
    255                                 mSampleConfigFile->getBillboardCloudMeshPrefixFilename() + "Splitted.mesh",false, false); 
    256  
    257         OBA::OgreBase::getSingleton().getMeshSerializer()->exportMesh(mLeaves->getBillboardCloud()->getEntity()->getMesh()->get(), mSampleConfigFile->getBillboardCloudFolder() + mSampleConfigFile->getBillboardCloudMeshPrefixFilename() + "Splitted.mesh"); 
    258  
    259         OBA::OgreBase::getSingleton().getXMLMeshSerializer()->exportMesh(mLeaves->getBillboardCloud()->getEntity()->getMesh()->get(), mSampleConfigFile->getBillboardCloudFolder() + mSampleConfigFile->getBillboardCloudMeshPrefixFilename() + "Splitted.mesh.xml"); 
    260 } 
    261  
    262 void Manager::saveBillboardCloudMerged() 
     258                                mSampleConfigFile->getBillboardCloudMeshPrefixName() + "Splitted.mesh",false, false); 
     259 
     260        OBA::OgreBase::getSingleton().getMeshSerializer()->exportMesh(mLeaves->getBillboardCloud()->getEntity()->getMesh()->get(), mSampleConfigFile->getBillboardCloudFolder() + mSampleConfigFile->getBillboardCloudMeshPrefixName() + "Splitted.mesh"); 
     261 
     262        OBA::OgreBase::getSingleton().getXMLMeshSerializer()->exportMesh(mLeaves->getBillboardCloud()->getEntity()->getMesh()->get(), mSampleConfigFile->getBillboardCloudFolder() + mSampleConfigFile->getBillboardCloudMeshPrefixName() + "Splitted.mesh.xml"); 
     263} 
     264 
     265void LBBCManager::saveBillboardCloudMerged() 
    263266{        
    264         //mLeaves->getBillboardCloud()->getEntity()->getSubEntity(0)->setMaterialName(mSampleConfigFile->getBillboardCloudMaterialPrefixFilename()); 
     267        //mLeaves->getBillboardCloud()->getEntity()->getSubEntity(0)->setMaterialName(mSampleConfigFile->getBillboardCloudMaterialPrefixName()); 
    265268        //mOgreMeshSerializer->setEntity(mLeaves->getBillboardCloud()->getEntity()); 
    266269        //mOgreMeshSerializer->exportMesh(mSampleConfigFile->getBillboardCloudFolder() + 
    267         //                      mSampleConfigFile->getBillboardCloudMeshPrefixFilename() + "Merged.mesh", mSampleConfigFile->getBillboardCloudMergedBillboards(), false); 
     270        //                      mSampleConfigFile->getBillboardCloudMeshPrefixName() + "Merged.mesh", mSampleConfigFile->getBillboardCloudMergedBillboards(), false); 
    268271        //OBA::OgreBase::getSingleton().getMeshSerializer()->exportMesh(mLeaves->getBillboardCloud()->getEntity()->getMesh(),  
    269         //                      mSampleConfigFile->getBillboardCloudFolder() + mSampleConfigFile->getBillboardCloudMeshPrefixFilename() + "Merged.mesh"); 
    270         //OBA::OgreBase::getSingleton().getXMLMeshSerializer()->exportMesh(mLeaves->getBillboardCloud()->getEntity()->getMesh(), mSampleConfigFile->getBillboardCloudFolder() + mSampleConfigFile->getBillboardCloudMeshPrefixFilename() + "Merged.mesh.xml"); 
     272        //                      mSampleConfigFile->getBillboardCloudFolder() + mSampleConfigFile->getBillboardCloudMeshPrefixName() + "Merged.mesh"); 
     273        //OBA::OgreBase::getSingleton().getXMLMeshSerializer()->exportMesh(mLeaves->getBillboardCloud()->getEntity()->getMesh(), mSampleConfigFile->getBillboardCloudFolder() + mSampleConfigFile->getBillboardCloudMeshPrefixName() + "Merged.mesh.xml"); 
    271274         
    272275 
     
    274277        { 
    275278                BBC::SubEntityPtr subEntity = mLeaves->getBillboardCloud()->getEntity()->getSubEntity(iSubEntity); 
    276                 subEntity->setMaterialName(mSampleConfigFile->getBillboardCloudMaterialPrefixFilename()); 
     279                subEntity->setMaterialName(mSampleConfigFile->getBillboardCloudBillboardGroupMaterialPrefixName()); 
    277280        } 
    278281        mOgreMeshSerializer->setEntity(mLeaves->getBillboardCloud()->getEntity()); 
     
    280283        Ogre::LogManager::getSingleton().logMessage("Num.SubEntities:" + Ogre::StringConverter::toString(mLeaves->getBillboardCloud()->getEntity()->getNumSubEntities())); 
    281284        mOgreMeshSerializer->exportMesh(mSampleConfigFile->getBillboardCloudFolder() + 
    282                                 mSampleConfigFile->getBillboardCloudMeshPrefixFilename() + "Merged.mesh",false, false); 
    283         OBA::OgreBase::getSingleton().getMeshSerializer()->exportMesh(mLeaves->getBillboardCloud()->getEntity()->getMesh()->get(), mSampleConfigFile->getBillboardCloudFolder() + mSampleConfigFile->getBillboardCloudMeshPrefixFilename() + "Merged.mesh");     
    284         OBA::OgreBase::getSingleton().getXMLMeshSerializer()->exportMesh(mLeaves->getBillboardCloud()->getEntity()->getMesh()->get(), mSampleConfigFile->getBillboardCloudFolder() + mSampleConfigFile->getBillboardCloudMeshPrefixFilename() + "Merged.mesh.xml"); 
    285          
    286         //Ogre::MeshManager::getSingleton().unload(mSampleConfigFile->getBillboardCloudMeshPrefixFilename() + "Merged.mesh"); 
    287 } 
    288  
    289 void Manager::saveBillboardCloudXML() 
     285                                mSampleConfigFile->getBillboardCloudMeshPrefixName() + "Merged.mesh",false, false); 
     286        OBA::OgreBase::getSingleton().getMeshSerializer()->exportMesh(mLeaves->getBillboardCloud()->getEntity()->getMesh()->get(), mSampleConfigFile->getBillboardCloudFolder() + mSampleConfigFile->getBillboardCloudMeshPrefixName() + "Merged.mesh");         
     287        OBA::OgreBase::getSingleton().getXMLMeshSerializer()->exportMesh(mLeaves->getBillboardCloud()->getEntity()->getMesh()->get(), mSampleConfigFile->getBillboardCloudFolder() + mSampleConfigFile->getBillboardCloudMeshPrefixName() + "Merged.mesh.xml");  
     288} 
     289 
     290void LBBCManager::saveBillboardCloudXML() 
    290291{ 
    291292        //saveBillboardCloud() 
    292293        TiXmlDocument *document2 = mBillboardCloudSerializer->create( 
    293294                                                                        mSampleConfigFile->getBillboardCloudFolder() +  
    294                                                                         mSampleConfigFile->getBillboardCloudXMLPrefixFilename() + ".xml"); 
     295                                                                        mSampleConfigFile->getBillboardCloudXMLPrefixName() + ".xml"); 
    295296        mBillboardCloudSerializer->setBillboardCloud(mLeaves->getBillboardCloud()); 
    296297        mBillboardCloudSerializer->writeBillboardCloud(document2);       
     
    298299} 
    299300 
    300 void Manager::saveEntityClusters() 
     301void LBBCManager::saveEntityClusters() 
    301302{ 
    302303        BBC::BillboardClusterDataPtr billboardClusterData; 
     
    315316                        {                                        
    316317                                BBC::EntityPtr entityClusterized = entityCluster->getEntity(); 
    317                                 entityClusterized->getSubEntity(0)->setMaterialName(mSampleConfigFile->getEntityClustersMaterialPrefixFilename()); 
     318                                entityClusterized->getSubEntity(0)->setMaterialName(mSampleConfigFile->getEntityClustersMaterialPrefixName()); 
    318319                                mOgreMeshSerializer->setEntity(entityClusterized); 
    319320                                mOgreMeshSerializer->exportMesh(mSampleConfigFile->getEntityDistributionFolder() + 
    320                                         mSampleConfigFile->getEntityClustersMeshPrefixFilename() + 
     321                                        mSampleConfigFile->getEntityClustersMeshPrefixName() + 
    321322                                        Ogre::StringConverter::toString(numSerializedBillboards) + ".mesh", !(mSampleConfigFile->getEntityClustersSplittedClusters()), false); 
    322323                                OBA::OgreBase::getSingleton().getMeshSerializer()->exportMesh(entityClusterized->getMesh()->get(), 
    323324                                        mSampleConfigFile->getEntityClustersFolder() + 
    324                                         mSampleConfigFile->getEntityClustersMeshPrefixFilename() + 
     325                                        mSampleConfigFile->getEntityClustersMeshPrefixName() + 
    325326                                        Ogre::StringConverter::toString(numSerializedBillboards) + ".mesh"); 
    326327                                //OBA::OgreBase::getSingleton().getXMLMeshSerializer()->exportMesh(entityClusterized->getMesh(), entityClusterized->getMesh()->getName() + ".xml"); 
    327  
    328                                 //Ogre::MeshManager::getSingleton().unload(mSampleConfigFile->getEntityClustersMeshPrefixFilename() + Ogre::StringConverter::toString(numSerializedBillboards) + ".mesh"); 
    329328 
    330329                                numSerializedBillboards++; 
     
    347346                        {                        
    348347                                BBC::EntityPtr entityClusterized = entityCluster->getEntity(); 
    349                                 entityClusterized->getSubEntity(0)->setMaterialName(mSampleConfigFile->getEntityClustersMaterialPrefixFilename()); 
     348                                entityClusterized->getSubEntity(0)->setMaterialName(mSampleConfigFile->getEntityClustersMaterialPrefixName()); 
    350349                                BBC::SubEntityPtr subEntity = entityClusterized->getSubEntity(0); 
    351350 
     
    371370                mOgreMeshSerializer->setEntity(entity); 
    372371                mOgreMeshSerializer->exportMesh(mSampleConfigFile->getEntityClustersFolder() + 
    373                         mSampleConfigFile->getEntityClustersMeshPrefixFilename() + "Merged.mesh", false, false); 
    374                  
    375                 OBA::OgreBase::getSingleton().getMeshSerializer()->exportMesh(entity->getMesh()->get(), mSampleConfigFile->getEntityClustersFolder() + mSampleConfigFile->getEntityClustersMeshPrefixFilename() + "Merged.mesh"); 
    376                 //OBA::OgreBase::getSingleton().getXMLMeshSerializer()->exportMesh(entity->getMesh(), mSampleConfigFile->getEntityClustersFolder() + mSampleConfigFile->getEntityClustersMeshPrefixFilename() + "Merged.mesh" + ".xml"); 
    377  
    378                 //Ogre::MeshManager::getSingleton().unload(mSampleConfigFile->getEntityClustersMeshPrefixFilename() + "Merged.mesh"); 
    379  
    380                 Ogre::LogManager::getSingleton().logMessage("Before deleting:" + mSampleConfigFile->getEntityClustersMeshPrefixFilename() + "Merged.mesh");      
    381         } 
    382 } 
    383  
    384 void Manager::createEntityClusters() 
     372                        mSampleConfigFile->getEntityClustersMeshPrefixName() + "Merged.mesh", false, false); 
     373                 
     374                OBA::OgreBase::getSingleton().getMeshSerializer()->exportMesh(entity->getMesh()->get(), mSampleConfigFile->getEntityClustersFolder() + mSampleConfigFile->getEntityClustersMeshPrefixName() + "Merged.mesh"); 
     375                //OBA::OgreBase::getSingleton().getXMLMeshSerializer()->exportMesh(entity->getMesh(), mSampleConfigFile->getEntityClustersFolder() + mSampleConfigFile->getEntityClustersMeshPrefixName() + "Merged.mesh" + ".xml"); 
     376 
     377                Ogre::LogManager::getSingleton().logMessage("Before deleting:" + mSampleConfigFile->getEntityClustersMeshPrefixName() + "Merged.mesh");  
     378        } 
     379} 
     380 
     381void LBBCManager::createEntityClusters() 
    385382{ 
    386383        mBillboardCloudGenerator->setDistribution(mLeaves->getDistribution()); 
     
    392389} 
    393390 
    394 void Manager::saveSingleEntity() 
    395 { 
    396         if (mSampleConfigFile->getEntitySampleMeshGeneration()) 
    397         { 
    398                 BBC::EntityPtr entityLeaf = mLeaves->getDistribution()->getEntity(2); 
    399                 entityLeaf->getSubEntity(0)->setMaterialName(mSampleConfigFile->getEntityClustersMaterialPrefixFilename()); 
    400                 mOgreMeshSerializer->setEntity(entityLeaf); 
    401                 mOgreMeshSerializer->exportMesh(mSampleConfigFile->getEntityDistributionFolder() + 
    402                         mSampleConfigFile->getEntitySampleMeshPrefixFilename(), mSampleConfigFile->getEntityClustersMergedClusters(), false); 
    403                 //OBA::OgreBase::getSingleton().getXMLMeshSerializer()->exportMesh(entityLeaf->getMesh(), entityLeaf->getMesh()->getName() + ".xml"); 
    404  
    405         } 
    406 } 
    407  
    408 void Manager::generateEntityClusters() 
    409 { 
    410         Ogre::LogManager::getSingleton().logMessage("EntityClustersMeshPrefixName:" + mSampleConfigFile->getEntityClustersMeshPrefixFilename()); 
     391void LBBCManager::saveSingleEntity() 
     392{ 
     393        BBC::EntityPtr entityLeaf = mLeaves->getDistribution()->getEntity(2); 
     394        entityLeaf->getSubEntity(0)->setMaterialName(mSampleConfigFile->getEntitySampleMaterialPrefixName()); 
     395        mOgreMeshSerializer->setEntity(entityLeaf); 
     396        mOgreMeshSerializer->exportMesh(mSampleConfigFile->getEntityDistributionFolder() + 
     397                mSampleConfigFile->getEntitySampleMeshPrefixName(), false, false); 
     398        OBA::OgreBase::getSingleton().getMeshSerializer()->exportMesh(entityLeaf->getMesh()->get(), mSampleConfigFile->getEntityDistributionFolder() + mSampleConfigFile->getEntitySampleMeshPrefixName() + ".mesh"); 
     399        OBA::OgreBase::getSingleton().getXMLMeshSerializer()->exportMesh(entityLeaf->getMesh()->get(), mSampleConfigFile->getEntityDistributionFolder() + mSampleConfigFile->getEntitySampleMeshPrefixName() + ".mesh.xml");     
     400} 
     401 
     402void LBBCManager::generateEntityClusters() 
     403{ 
     404        Ogre::LogManager::getSingleton().logMessage("EntityClustersMeshPrefixName:" + mSampleConfigFile->getEntityClustersMeshPrefixName()); 
    411405        createEntityClusters(); 
    412         saveEntityClusters(); 
    413         saveSingleEntity();      
    414 } 
    415  
    416 void Manager::generateBillboardCloud() 
     406        saveEntityClusters();    
     407} 
     408 
     409void LBBCManager::generateBillboardCloud() 
    417410{ 
    418411        if (mSampleConfigFile->getBillboardCloudMergedBillboards()) 
     
    422415                mLeaves->getBillboardCloud()->initializeBillboardCloudGroups(1); 
    423416 
    424                 if (mSampleConfigFile->getBillboardCloudDiffuseColorTextureAtlasGeneration()) 
     417                if (mSampleConfigFile->getBillboardCloudDiffuseColorMergedBillboardsTextureAtlasGeneration()) 
    425418                { 
    426419                        mBillboardCloudUVMapper->shutdown(); 
    427420                        mBillboardCloudUVMapper->setBillboardCloud(mLeaves->getBillboardCloud()); 
    428                         mBillboardCloudUVMapper->setTextureWidth(mSampleConfigFile->getBillboardCloudDiffuseColorTextureSize()); 
    429                         mBillboardCloudUVMapper->setTextureHeight(mSampleConfigFile->getBillboardCloudDiffuseColorTextureSize()); 
    430                         mBillboardCloudUVMapper->setTextureAtlasWidth(mSampleConfigFile->getBillboardCloudDiffuseColorTextureAtlasSize()); 
    431                         mBillboardCloudUVMapper->setTextureAtlasHeight(mSampleConfigFile->getBillboardCloudDiffuseColorTextureAtlasSize()); 
     421                        mBillboardCloudUVMapper->setTextureWidth(mSampleConfigFile->getBillboardCloudDiffuseColorMergedBillboardsTextureSize()); 
     422                        mBillboardCloudUVMapper->setTextureHeight(mSampleConfigFile->getBillboardCloudDiffuseColorMergedBillboardsTextureSize()); 
     423                        mBillboardCloudUVMapper->setTextureAtlasWidth(mSampleConfigFile->getBillboardCloudDiffuseColorMergedBillboardsTextureAtlasSize()); 
     424                        mBillboardCloudUVMapper->setTextureAtlasHeight(mSampleConfigFile->getBillboardCloudDiffuseColorMergedBillboardsTextureAtlasSize()); 
    432425                        mBillboardCloudUVMapper->initialize(); 
    433426 
     
    446439                mLeaves->getBillboardCloud()->initializeBillboardCloudGroups(mSampleConfigFile->getBillboardCloudGroups()); 
    447440                 
    448                 if (mSampleConfigFile->getBillboardCloudDiffuseColorTextureAtlasGeneration()) 
     441                if (mSampleConfigFile->getBillboardCloudDiffuseColorBillboardGroupTextureAtlasGeneration()) 
    449442                { 
    450443                        mBillboardCloudUVMapper->shutdown(); 
    451444                        mBillboardCloudUVMapper->setBillboardCloud(mLeaves->getBillboardCloud()); 
    452                         mBillboardCloudUVMapper->setTextureWidth(mSampleConfigFile->getBillboardCloudDiffuseColorTextureSize()); 
    453                         mBillboardCloudUVMapper->setTextureHeight(mSampleConfigFile->getBillboardCloudDiffuseColorTextureSize()); 
    454                         mBillboardCloudUVMapper->setTextureAtlasWidth(mSampleConfigFile->getBillboardCloudDiffuseColorTextureAtlasSize()); 
    455                         mBillboardCloudUVMapper->setTextureAtlasHeight(mSampleConfigFile->getBillboardCloudDiffuseColorTextureAtlasSize()); 
     445                        mBillboardCloudUVMapper->setTextureWidth(mSampleConfigFile->getBillboardCloudDiffuseColorBillboardGroupTextureSize()); 
     446                        mBillboardCloudUVMapper->setTextureHeight(mSampleConfigFile->getBillboardCloudDiffuseColorBillboardGroupTextureSize()); 
     447                        mBillboardCloudUVMapper->setTextureAtlasWidth(mSampleConfigFile->getBillboardCloudDiffuseColorBillboardGroupTextureAtlasSize()); 
     448                        mBillboardCloudUVMapper->setTextureAtlasHeight(mSampleConfigFile->getBillboardCloudDiffuseColorBillboardGroupTextureAtlasSize()); 
    456449                        mBillboardCloudUVMapper->initialize(); 
    457450                        mBillboardCloudUVMapper->generateTextureAtlasTextureCoords(false, mSampleConfigFile->getBillboardCloudGroupedBillboards(), mSampleConfigFile->getBillboardCloudGroups());  
     
    466459        {                
    467460                mLeaves->getBillboardCloud()->generateBillboardCloud(false); 
    468                 if (mSampleConfigFile->getBillboardCloudDiffuseColorTextureAtlasGeneration()) 
    469                 { 
    470                         mBillboardCloudUVMapper->shutdown(); 
    471                         mBillboardCloudUVMapper->setBillboardCloud(mLeaves->getBillboardCloud()); 
    472                         mBillboardCloudUVMapper->setTextureWidth(mSampleConfigFile->getBillboardCloudDiffuseColorTextureSize()); 
    473                         mBillboardCloudUVMapper->setTextureHeight(mSampleConfigFile->getBillboardCloudDiffuseColorTextureSize()); 
    474                         mBillboardCloudUVMapper->setTextureAtlasWidth(mSampleConfigFile->getBillboardCloudDiffuseColorTextureAtlasSize()); 
    475                         mBillboardCloudUVMapper->setTextureAtlasHeight(mSampleConfigFile->getBillboardCloudDiffuseColorTextureAtlasSize()); 
    476                         mBillboardCloudUVMapper->initialize(); 
    477                         mBillboardCloudUVMapper->generateTextureAtlasTextureCoords(!mSampleConfigFile->getBillboardCloudSplittedBillboards(),false);  
    478                 } 
     461                //if (mSampleConfigFile->getBillboardCloudDiffuseColorTextureAtlasGeneration()) 
     462                //{ 
     463                //      mBillboardCloudUVMapper->shutdown(); 
     464                //      mBillboardCloudUVMapper->setBillboardCloud(mLeaves->getBillboardCloud()); 
     465                //      mBillboardCloudUVMapper->setTextureWidth(mSampleConfigFile->getBillboardCloudDiffuseColorTextureSize()); 
     466                //      mBillboardCloudUVMapper->setTextureHeight(mSampleConfigFile->getBillboardCloudDiffuseColorTextureSize()); 
     467                //      mBillboardCloudUVMapper->setTextureAtlasWidth(mSampleConfigFile->getBillboardCloudDiffuseColorTextureAtlasSize()); 
     468                //      mBillboardCloudUVMapper->setTextureAtlasHeight(mSampleConfigFile->getBillboardCloudDiffuseColorTextureAtlasSize()); 
     469                //      mBillboardCloudUVMapper->initialize(); 
     470                //      mBillboardCloudUVMapper->generateTextureAtlasTextureCoords(!mSampleConfigFile->getBillboardCloudSplittedBillboards(),false);  
     471                //} 
    479472                saveBillboardCloudSplitted(); 
    480473        } 
     
    483476} 
    484477 
    485 Leaves* Manager::getLeaves() 
     478Leaves* LBBCManager::getLeaves() 
    486479{ 
    487480        return mLeaves; 
Note: See TracChangeset for help on using the changeset viewer.