diff --git a/OgreMain/include/OgreSceneManager.h b/OgreMain/include/OgreSceneManager.h index e5adbffb0d0..f593c0166dd 100644 --- a/OgreMain/include/OgreSceneManager.h +++ b/OgreMain/include/OgreSceneManager.h @@ -1649,7 +1649,7 @@ namespace Ogre ParticleSystemDef *createParticleSystemDef( const String &name ); /** Creates an instance the next generation of ParticleFX. - This instanec must be based off a ParticleSystemDef already setup. + This instance must be based off a ParticleSystemDef already setup. See createParticleSystemDef(). @param systemDef @@ -1665,8 +1665,37 @@ namespace Ogre void destroyParticleSystem2( ParticleSystem2 *obj ); + /// Destroys all particle systems created with createParticleSystem2. + /// Do not hold any more references to those pointers as they will become dangling! void destroyAllParticleSystems2(); + /** Creates an instance of the new generation of billboards. + See ParticleSystemManager2::createBillboardSet. + @remark + This is the same as doing: + sceneMgr->getParticleSystemManager2()->createBillboardSet(); + */ + BillboardSet *createBillboardSet2(); + + /** Destroys a BillboardSet created with createBillboardSet2(). + See ParticleSystemManager2::destroyBillboardSet. + @remark + This is the same as doing: + sceneMgr->getParticleSystemManager2()->destroyBillboardSet( s ); + @param billboardSet + Set to destroy. + */ + void destroyBillboardSet2( BillboardSet *billboardSet ); + + /** Destroys all BillboardSet created with createBillboardSet2(). + Do not hold any more references to those pointers as they will become dangling! + See ParticleSystemManager2::destroyAllBillboardSets. + @remark + This is the same as doing: + sceneMgr->getParticleSystemManager2()->destroyAllBillboardSets(); + */ + void destroyAllBillboardSets2(); + ParticleSystemManager2 *getParticleSystemManager2() { return mParticleSystemManager2; } /** Empties the entire scene, inluding all SceneNodes, Entities, Lights, diff --git a/OgreMain/src/OgreSceneManager.cpp b/OgreMain/src/OgreSceneManager.cpp index b2317bbee23..c9ff9cf76a8 100644 --- a/OgreMain/src/OgreSceneManager.cpp +++ b/OgreMain/src/OgreSceneManager.cpp @@ -823,6 +823,21 @@ namespace Ogre mParticleSystemManager2->destroyAllParticleSystems(); } //----------------------------------------------------------------------- + BillboardSet *SceneManager::createBillboardSet2() + { + return mParticleSystemManager2->createBillboardSet(); + } + //----------------------------------------------------------------------- + void SceneManager::destroyBillboardSet2( BillboardSet *billboardSet ) + { + return mParticleSystemManager2->destroyBillboardSet( billboardSet ); + } + //----------------------------------------------------------------------- + void SceneManager::destroyAllBillboardSets2() + { + return mParticleSystemManager2->destroyAllBillboardSets(); + } + //----------------------------------------------------------------------- void SceneManager::clearScene( bool deleteIndestructibleToo, bool reattachCameras ) { destroyAllMovableObjects(); diff --git a/Samples/2.0/ApiUsage/ParticleFX2/ParticleFX2GameState.cpp b/Samples/2.0/ApiUsage/ParticleFX2/ParticleFX2GameState.cpp index 3258b385a2e..1af3e5102b6 100644 --- a/Samples/2.0/ApiUsage/ParticleFX2/ParticleFX2GameState.cpp +++ b/Samples/2.0/ApiUsage/ParticleFX2/ParticleFX2GameState.cpp @@ -96,8 +96,9 @@ void ParticleFX2GameState::createScene01() Ogre::ParticleSystem2 *pSystem1 = sceneManager->createParticleSystem2( "Examples/Aureola" ); Ogre::ParticleSystem2 *pSystem2 = sceneManager->createParticleSystem2( "Particle/SmokePBS" ); - Ogre::BillboardSet *billboardSet = sceneManager->getParticleSystemManager2()->createBillboardSet(); - billboardSet->setParticleQuota( 10u ); + Ogre::BillboardSet *billboardSet = sceneManager->createBillboardSet2(); + // Try to be as tight as possible. In this sample we only need 1. + billboardSet->setParticleQuota( 1u ); billboardSet->setMaterialName( "Marble", Ogre::ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME ); billboardSet->init( sceneManager->getDestinationRenderSystem()->getVaoManager() );