[692] | 1 | /*
|
---|
| 2 | -----------------------------------------------------------------------------
|
---|
| 3 | This source file is part of OGRE
|
---|
| 4 | (Object-oriented Graphics Rendering Engine)
|
---|
| 5 | For the latest info, see http://www.ogre3d.org/
|
---|
| 6 |
|
---|
| 7 | Copyright (c) 2000-2005 The OGRE Team
|
---|
| 8 | Also see acknowledgements in Readme.html
|
---|
| 9 |
|
---|
| 10 | This program is free software; you can redistribute it and/or modify it under
|
---|
| 11 | the terms of the GNU Lesser General Public License as published by the Free Software
|
---|
| 12 | Foundation; either version 2 of the License, or (at your option) any later
|
---|
| 13 | version.
|
---|
| 14 |
|
---|
| 15 | This program is distributed in the hope that it will be useful, but WITHOUT
|
---|
| 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
---|
| 17 | FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
---|
| 18 |
|
---|
| 19 | You should have received a copy of the GNU Lesser General Public License along with
|
---|
| 20 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
---|
| 21 | Place - Suite 330, Boston, MA 02111-1307, USA, or go to
|
---|
| 22 | http://www.gnu.org/copyleft/lesser.txt.
|
---|
| 23 | -----------------------------------------------------------------------------
|
---|
| 24 | */
|
---|
| 25 | #ifndef __ParticleEmitterFactory_H__
|
---|
| 26 | #define __ParticleEmitterFactory_H__
|
---|
| 27 |
|
---|
| 28 |
|
---|
| 29 | #include "OgrePrerequisites.h"
|
---|
| 30 | #include "OgreParticleEmitter.h"
|
---|
| 31 | #include "OgreString.h"
|
---|
| 32 |
|
---|
| 33 | namespace Ogre {
|
---|
| 34 |
|
---|
| 35 | /** Abstract class defining the interface to be implemented by creators of ParticleEmitter subclasses.
|
---|
| 36 | @remarks
|
---|
| 37 | Plugins or 3rd party applications can add new types of particle emitters to Ogre by creating
|
---|
| 38 | subclasses of the ParticleEmitter class. Because multiple instances of these emitters may be
|
---|
| 39 | required, a factory class to manage the instances is also required.
|
---|
| 40 | @par
|
---|
| 41 | ParticleEmitterFactory subclasses must allow the creation and destruction of ParticleEmitter
|
---|
| 42 | subclasses. They must also be registered with the ParticleSystemManager. All factories have
|
---|
| 43 | a name which identifies them, examples might be 'point', 'cone', or 'box', and these can be
|
---|
| 44 | also be used from particle system scripts.
|
---|
| 45 | */
|
---|
| 46 | class _OgreExport ParticleEmitterFactory
|
---|
| 47 | {
|
---|
| 48 | protected:
|
---|
| 49 | std::vector<ParticleEmitter*> mEmitters;
|
---|
| 50 | public:
|
---|
| 51 | ParticleEmitterFactory() {};
|
---|
| 52 | virtual ~ParticleEmitterFactory();
|
---|
| 53 |
|
---|
| 54 | /** Returns the name of the factory, the name which identifies the particle emitter type this factory creates. */
|
---|
| 55 | virtual String getName() const = 0;
|
---|
| 56 |
|
---|
| 57 | /** Creates a new emitter instance.
|
---|
| 58 | @remarks
|
---|
| 59 | The subclass MUST add a pointer to the created instance to mEmitters.
|
---|
| 60 | */
|
---|
| 61 | virtual ParticleEmitter* createEmitter(ParticleSystem* psys) = 0;
|
---|
| 62 |
|
---|
| 63 | /** Destroys the emitter pointed to by the parameter (for early clean up if reauired). */
|
---|
| 64 | virtual void destroyEmitter(ParticleEmitter* e);
|
---|
| 65 |
|
---|
| 66 | };
|
---|
| 67 |
|
---|
| 68 |
|
---|
| 69 | }
|
---|
| 70 |
|
---|
| 71 |
|
---|
| 72 | #endif
|
---|
| 73 |
|
---|