- Timestamp:
- 03/17/06 19:36:46 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/src/LBBCManager.cpp
r699 r709 188 188 } 189 189 190 void 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 190 207 void 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 193 215 mOgreMeshSerializer->setEntity(mLeaves->getBillboardCloud()->getEntity()); 194 216 mOgreMeshSerializer->exportMesh(mSampleCf.getBillboardCloudFolder() + 195 217 mSampleCf.getBillboardCloudMeshPrefixFilename() + "Splitted.mesh",false, false); 196 218 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"); 197 220 } 198 221 199 222 void Manager::saveBillboardCloudMerged() 200 223 { 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 } 202 238 mOgreMeshSerializer->setEntity(mLeaves->getBillboardCloud()->getEntity()); 239 240 Ogre::LogManager::getSingleton().logMessage("Num.SubEntities:" + Ogre::StringConverter::toString(mLeaves->getBillboardCloud()->getEntity()->getNumSubEntities())); 203 241 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"); 209 245 } 210 246 … … 338 374 if (mSampleCf.getBillboardCloudMergedBillboards()) 339 375 { 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 341 397 if (mSampleCf.getBillboardCloudDiffuseColorTextureAtlasGeneration()) 342 398 { 399 mBillboardCloudUVMapper->clear(); 343 400 mBillboardCloudUVMapper->setBillboardCloud(mLeaves->getBillboardCloud()); 344 401 mBillboardCloudUVMapper->setTextureWidth(mSampleCf.getBillboardCloudDiffuseColorTextureSize()); … … 347 404 mBillboardCloudUVMapper->setTextureAtlasHeight(mSampleCf.getBillboardCloudDiffuseColorTextureAtlasSize()); 348 405 mBillboardCloudUVMapper->initialize(); 349 mBillboardCloudUVMapper->generateTextureAtlasTextureCoords(mSampleCf.getBillboardCloudMergedBillboards()); 350 } 406 mBillboardCloudUVMapper->generateTextureAtlasTextureCoords(false, mSampleCf.getBillboardCloudGroupedBillboards(), 1); 407 } 408 409 mLeaves->getBillboardCloud()->generateBillboardCloudGroups(); 410 351 411 saveBillboardCloudMerged(); 352 412 } 353 413 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 358 419 if (mSampleCf.getBillboardCloudDiffuseColorTextureAtlasGeneration()) 359 420 { 421 mBillboardCloudUVMapper->clear(); 360 422 mBillboardCloudUVMapper->setBillboardCloud(mLeaves->getBillboardCloud()); 361 423 mBillboardCloudUVMapper->setTextureWidth(mSampleCf.getBillboardCloudDiffuseColorTextureSize()); … … 364 426 mBillboardCloudUVMapper->setTextureAtlasHeight(mSampleCf.getBillboardCloudDiffuseColorTextureAtlasSize()); 365 427 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); 367 449 } 368 450 saveBillboardCloudSplitted(); … … 377 459 } 378 460 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.