Ignore:
Timestamp:
03/17/06 19:36:46 (19 years ago)
Author:
igarcia
Message:
 
File:
1 edited

Legend:

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

    r699 r709  
    188188} 
    189189 
     190void Manager::saveBillboardCloudGrouped() 
     191{ 
     192        for (unsigned int iSubEntity = 0; iSubEntity < mLeaves->getBillboardCloud()->getEntity()->getNumSubEntities(); iSubEntity++) 
     193        { 
     194                BBC::SubEntity *subEntity = mLeaves->getBillboardCloud()->getEntity()->getSubEntity(iSubEntity); 
     195                subEntity->setMaterialName(mSampleCf.getBillboardCloudMaterialPrefixFilename()); 
     196        } 
     197        mOgreMeshSerializer->setEntity(mLeaves->getBillboardCloud()->getEntity()); 
     198    
     199        Ogre::LogManager::getSingleton().logMessage("Num.SubEntities:" + Ogre::StringConverter::toString(mLeaves->getBillboardCloud()->getEntity()->getNumSubEntities())); 
     200        mOgreMeshSerializer->exportMesh(mSampleCf.getBillboardCloudFolder() + 
     201                                mSampleCf.getBillboardCloudMeshPrefixFilename() + "Grouped.mesh",false, false); 
     202        mMeshSerializer->exportMesh(mLeaves->getBillboardCloud()->getEntity()->getMesh(), mSampleCf.getBillboardCloudFolder() + mSampleCf.getBillboardCloudMeshPrefixFilename() + "Grouped.mesh"); 
     203        mXMLMeshSerializer->exportMesh(mLeaves->getBillboardCloud()->getEntity()->getMesh(), mSampleCf.getBillboardCloudFolder() + mSampleCf.getBillboardCloudMeshPrefixFilename() + "Grouped.mesh.xml"); 
     204} 
     205 
     206 
    190207void Manager::saveBillboardCloudSplitted() 
    191 { 
    192         //exportBillboardCloudMesh()     
     208{        
     209        for (unsigned int iSubEntity = 0; iSubEntity < mLeaves->getBillboardCloud()->getEntity()->getNumSubEntities(); iSubEntity++) 
     210        { 
     211                BBC::SubEntity *subEntity = mLeaves->getBillboardCloud()->getEntity()->getSubEntity(iSubEntity); 
     212                subEntity->setMaterialName(mSampleCf.getBillboardCloudMaterialPrefixFilename()); 
     213        } 
     214 
    193215        mOgreMeshSerializer->setEntity(mLeaves->getBillboardCloud()->getEntity()); 
    194216        mOgreMeshSerializer->exportMesh(mSampleCf.getBillboardCloudFolder() + 
    195217                                mSampleCf.getBillboardCloudMeshPrefixFilename() + "Splitted.mesh",false, false); 
    196218        mMeshSerializer->exportMesh(mLeaves->getBillboardCloud()->getEntity()->getMesh(), mSampleCf.getBillboardCloudFolder() + mSampleCf.getBillboardCloudMeshPrefixFilename() + "Splitted.mesh"); 
     219        mXMLMeshSerializer->exportMesh(mLeaves->getBillboardCloud()->getEntity()->getMesh(), mSampleCf.getBillboardCloudFolder() + mSampleCf.getBillboardCloudMeshPrefixFilename() + "Splitted.mesh.xml"); 
    197220} 
    198221 
    199222void Manager::saveBillboardCloudMerged() 
    200223{        
    201         mLeaves->getBillboardCloud()->getEntity()->getSubEntity(0)->setMaterialName(mSampleCf.getBillboardCloudMaterialPrefixFilename()); 
     224        //mLeaves->getBillboardCloud()->getEntity()->getSubEntity(0)->setMaterialName(mSampleCf.getBillboardCloudMaterialPrefixFilename()); 
     225        //mOgreMeshSerializer->setEntity(mLeaves->getBillboardCloud()->getEntity()); 
     226        //mOgreMeshSerializer->exportMesh(mSampleCf.getBillboardCloudFolder() + 
     227        //                      mSampleCf.getBillboardCloudMeshPrefixFilename() + "Merged.mesh", mSampleCf.getBillboardCloudMergedBillboards(), false); 
     228        //mMeshSerializer->exportMesh(mLeaves->getBillboardCloud()->getEntity()->getMesh(),  
     229        //                      mSampleCf.getBillboardCloudFolder() + mSampleCf.getBillboardCloudMeshPrefixFilename() + "Merged.mesh"); 
     230        //mXMLMeshSerializer->exportMesh(mLeaves->getBillboardCloud()->getEntity()->getMesh(), mSampleCf.getBillboardCloudFolder() + mSampleCf.getBillboardCloudMeshPrefixFilename() + "Merged.mesh.xml"); 
     231         
     232 
     233        for (unsigned int iSubEntity = 0; iSubEntity < mLeaves->getBillboardCloud()->getEntity()->getNumSubEntities(); iSubEntity++) 
     234        { 
     235                BBC::SubEntity *subEntity = mLeaves->getBillboardCloud()->getEntity()->getSubEntity(iSubEntity); 
     236                subEntity->setMaterialName(mSampleCf.getBillboardCloudMaterialPrefixFilename()); 
     237        } 
    202238        mOgreMeshSerializer->setEntity(mLeaves->getBillboardCloud()->getEntity()); 
     239    
     240        Ogre::LogManager::getSingleton().logMessage("Num.SubEntities:" + Ogre::StringConverter::toString(mLeaves->getBillboardCloud()->getEntity()->getNumSubEntities())); 
    203241        mOgreMeshSerializer->exportMesh(mSampleCf.getBillboardCloudFolder() + 
    204                                 mSampleCf.getBillboardCloudMeshPrefixFilename() + "Merged.mesh", mSampleCf.getBillboardCloudMergedBillboards(), false); 
    205         mMeshSerializer->exportMesh(mLeaves->getBillboardCloud()->getEntity()->getMesh(),  
    206                                 mSampleCf.getBillboardCloudFolder() + mSampleCf.getBillboardCloudMeshPrefixFilename()                             
    207  
    208                                 + "Merged.mesh"); 
     242                                mSampleCf.getBillboardCloudMeshPrefixFilename() + "Merged.mesh",false, false); 
     243        mMeshSerializer->exportMesh(mLeaves->getBillboardCloud()->getEntity()->getMesh(), mSampleCf.getBillboardCloudFolder() + mSampleCf.getBillboardCloudMeshPrefixFilename() + "Merged.mesh"); 
     244        mXMLMeshSerializer->exportMesh(mLeaves->getBillboardCloud()->getEntity()->getMesh(), mSampleCf.getBillboardCloudFolder() + mSampleCf.getBillboardCloudMeshPrefixFilename() + "Merged.mesh.xml"); 
    209245} 
    210246 
     
    338374        if (mSampleCf.getBillboardCloudMergedBillboards()) 
    339375        { 
    340                 mLeaves->getBillboardCloud()->generateBillboardCloud(mSampleCf.getBillboardCloudMergedBillboards()); 
     376                //mLeaves->getBillboardCloud()->generateBillboardCloud(mSampleCf.getBillboardCloudMergedBillboards()); 
     377                //mLeaves->getBillboardCloud()->initializeBillboardCloudGroups(1); 
     378 
     379                //if (mSampleCf.getBillboardCloudDiffuseColorTextureAtlasGeneration()) 
     380                //{ 
     381                //      mBillboardCloudUVMapper->clear(); 
     382                //      mBillboardCloudUVMapper->setBillboardCloud(mLeaves->getBillboardCloud()); 
     383                //      mBillboardCloudUVMapper->setTextureWidth(mSampleCf.getBillboardCloudDiffuseColorTextureSize()); 
     384                //      mBillboardCloudUVMapper->setTextureHeight(mSampleCf.getBillboardCloudDiffuseColorTextureSize()); 
     385                //      mBillboardCloudUVMapper->setTextureAtlasWidth(mSampleCf.getBillboardCloudDiffuseColorTextureAtlasSize()); 
     386                //      mBillboardCloudUVMapper->setTextureAtlasHeight(mSampleCf.getBillboardCloudDiffuseColorTextureAtlasSize()); 
     387                //      mBillboardCloudUVMapper->initialize(); 
     388                //      mBillboardCloudUVMapper->generateTextureAtlasTextureCoords(false, mSampleCf.getBillboardCloudGroupedBillboards(), 1);  
     389                //} 
     390 
     391                //mLeaves->getBillboardCloud()->generateBillboardCloudGroups(); 
     392                //saveBillboardCloudMerged(); 
     393 
     394                mLeaves->getBillboardCloud()->generateBillboardCloud(false); 
     395                mLeaves->getBillboardCloud()->initializeBillboardCloudGroups(1); 
     396                 
    341397                if (mSampleCf.getBillboardCloudDiffuseColorTextureAtlasGeneration()) 
    342398                { 
     399                        mBillboardCloudUVMapper->clear(); 
    343400                        mBillboardCloudUVMapper->setBillboardCloud(mLeaves->getBillboardCloud()); 
    344401                        mBillboardCloudUVMapper->setTextureWidth(mSampleCf.getBillboardCloudDiffuseColorTextureSize()); 
     
    347404                        mBillboardCloudUVMapper->setTextureAtlasHeight(mSampleCf.getBillboardCloudDiffuseColorTextureAtlasSize()); 
    348405                        mBillboardCloudUVMapper->initialize(); 
    349                         mBillboardCloudUVMapper->generateTextureAtlasTextureCoords(mSampleCf.getBillboardCloudMergedBillboards());  
    350                 } 
     406                        mBillboardCloudUVMapper->generateTextureAtlasTextureCoords(false, mSampleCf.getBillboardCloudGroupedBillboards(), 1);  
     407                } 
     408 
     409                mLeaves->getBillboardCloud()->generateBillboardCloudGroups(); 
     410 
    351411                saveBillboardCloudMerged(); 
    352412        } 
    353413 
    354  
    355         if (mSampleCf.getBillboardCloudSplittedBillboards()) 
    356         {                
    357                 mLeaves->getBillboardCloud()->generateBillboardCloud(!mSampleCf.getBillboardCloudSplittedBillboards()); 
     414        if (mSampleCf.getBillboardCloudGroupedBillboards()) 
     415        {                                
     416                mLeaves->getBillboardCloud()->generateBillboardCloud(false); 
     417                mLeaves->getBillboardCloud()->initializeBillboardCloudGroups(mSampleCf.getBillboardCloudGroups()); 
     418                 
    358419                if (mSampleCf.getBillboardCloudDiffuseColorTextureAtlasGeneration()) 
    359420                { 
     421                        mBillboardCloudUVMapper->clear(); 
    360422                        mBillboardCloudUVMapper->setBillboardCloud(mLeaves->getBillboardCloud()); 
    361423                        mBillboardCloudUVMapper->setTextureWidth(mSampleCf.getBillboardCloudDiffuseColorTextureSize()); 
     
    364426                        mBillboardCloudUVMapper->setTextureAtlasHeight(mSampleCf.getBillboardCloudDiffuseColorTextureAtlasSize()); 
    365427                        mBillboardCloudUVMapper->initialize(); 
    366                         mBillboardCloudUVMapper->generateTextureAtlasTextureCoords(!mSampleCf.getBillboardCloudSplittedBillboards());  
     428                        mBillboardCloudUVMapper->generateTextureAtlasTextureCoords(false, mSampleCf.getBillboardCloudGroupedBillboards(), mSampleCf.getBillboardCloudGroups());  
     429                } 
     430 
     431                mLeaves->getBillboardCloud()->generateBillboardCloudGroups(); 
     432 
     433                saveBillboardCloudGrouped(); 
     434        } 
     435 
     436        if (mSampleCf.getBillboardCloudSplittedBillboards()) 
     437        {                
     438                mLeaves->getBillboardCloud()->generateBillboardCloud(!mSampleCf.getBillboardCloudSplittedBillboards()); 
     439                if (mSampleCf.getBillboardCloudDiffuseColorTextureAtlasGeneration()) 
     440                { 
     441                        mBillboardCloudUVMapper->clear(); 
     442                        mBillboardCloudUVMapper->setBillboardCloud(mLeaves->getBillboardCloud()); 
     443                        mBillboardCloudUVMapper->setTextureWidth(mSampleCf.getBillboardCloudDiffuseColorTextureSize()); 
     444                        mBillboardCloudUVMapper->setTextureHeight(mSampleCf.getBillboardCloudDiffuseColorTextureSize()); 
     445                        mBillboardCloudUVMapper->setTextureAtlasWidth(mSampleCf.getBillboardCloudDiffuseColorTextureAtlasSize()); 
     446                        mBillboardCloudUVMapper->setTextureAtlasHeight(mSampleCf.getBillboardCloudDiffuseColorTextureAtlasSize()); 
     447                        mBillboardCloudUVMapper->initialize(); 
     448                        mBillboardCloudUVMapper->generateTextureAtlasTextureCoords(!mSampleCf.getBillboardCloudSplittedBillboards(),false);  
    367449                } 
    368450                saveBillboardCloudSplitted(); 
     
    377459} 
    378460 
    379 //exportEntities() 
    380 /* 
    381 BBC::Entity *entityLeaves =  new BBC::Entity(); 
    382 entityLeaves->setMesh(leavesMesh); 
    383 entityLeaves->loadMesh(true); 
    384 entityLeaves->getSubEntity(0)->setMaterialName(mSampleCf.getEntityClustersMaterialPrefixFilename() + ".material"); 
    385 mOgreMeshSerializer->setEntity(entityLeaves); 
    386 mOgreMeshSerializer->exportMesh(mSampleCf.getEntityDistributionFolder() +  
    387         mSampleCf.getEntitySampleMeshPrefixFilename() + "New.mesh", false, false); 
    388 mXMLMeshSerializer->exportMesh(entityLeaves->getMesh(), mSampleCf.getEntityDistributionFolder() +  
    389         mSampleCf.getEntitySampleMeshPrefixFilename() + "New.mesh.xml"); 
    390 */ 
    391  
    392 } 
     461} 
Note: See TracChangeset for help on using the changeset viewer.