[657] | 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 __ParticleSystemRenderer_H__
|
---|
| 26 | #define __ParticleSystemRenderer_H__
|
---|
| 27 |
|
---|
| 28 | #include "OgrePrerequisites.h"
|
---|
| 29 | #include "OgreStringInterface.h"
|
---|
| 30 | #include "OgreFactoryObj.h"
|
---|
| 31 | #include "OgreRenderQueue.h"
|
---|
| 32 |
|
---|
| 33 | namespace Ogre {
|
---|
| 34 |
|
---|
| 35 | /** Abstract class defining the interface required to be implemented
|
---|
| 36 | by classes which provide rendering capability to ParticleSystem instances.
|
---|
| 37 | */
|
---|
| 38 | class _OgreExport ParticleSystemRenderer : public StringInterface
|
---|
| 39 | {
|
---|
| 40 | public:
|
---|
| 41 | /// Constructor
|
---|
| 42 | ParticleSystemRenderer() {}
|
---|
| 43 | /// Destructor
|
---|
| 44 | virtual ~ParticleSystemRenderer() {}
|
---|
| 45 |
|
---|
| 46 | /** Gets the type of this renderer - must be implemented by subclasses */
|
---|
| 47 | virtual const String& getType(void) const = 0;
|
---|
| 48 |
|
---|
| 49 | /** Delegated to by ParticleSystem::_updateRenderQueue
|
---|
| 50 | @remarks
|
---|
| 51 | The subclass must update the render queue using whichever Renderable
|
---|
| 52 | instance(s) it wishes.
|
---|
| 53 | */
|
---|
| 54 | virtual void _updateRenderQueue(RenderQueue* queue,
|
---|
| 55 | std::list<Particle*>& currentParticles, bool cullIndividually) = 0;
|
---|
| 56 |
|
---|
| 57 | /** Sets the material this renderer must use; called by ParticleSystem. */
|
---|
| 58 | virtual void _setMaterial(MaterialPtr& mat) = 0;
|
---|
| 59 | /** Delegated to by ParticleSystem::_notifyCurrentCamera */
|
---|
| 60 | virtual void _notifyCurrentCamera(Camera* cam) = 0;
|
---|
| 61 | /** Delegated to by ParticleSystem::_notifyAttached */
|
---|
| 62 | virtual void _notifyAttached(Node* parent, bool isTagPoint = false) = 0;
|
---|
| 63 | /** Optional callback notified when particles are rotated */
|
---|
| 64 | virtual void _notifyParticleRotated(void) {}
|
---|
| 65 | /** Optional callback notified when particles are resized individually */
|
---|
| 66 | virtual void _notifyParticleResized(void) {}
|
---|
| 67 | /** Tells the renderer that the particle quota has changed */
|
---|
| 68 | virtual void _notifyParticleQuota(size_t quota) = 0;
|
---|
| 69 | /** Tells the renderer that the particle default size has changed */
|
---|
| 70 | virtual void _notifyDefaultDimensions(Real width, Real height) = 0;
|
---|
| 71 | /** Create a new ParticleVisualData instance for attachment to a particle.
|
---|
| 72 | @remarks
|
---|
| 73 | If this renderer needs additional data in each particle, then this should
|
---|
| 74 | be held in an instance of a subclass of ParticleVisualData, and this method
|
---|
| 75 | should be overridden to return a new instance of it. The default
|
---|
| 76 | behaviour is to return null.
|
---|
| 77 | */
|
---|
| 78 | virtual ParticleVisualData* _createVisualData(void) { return 0; }
|
---|
| 79 | /** Destroy a ParticleVisualData instance.
|
---|
| 80 | @remarks
|
---|
| 81 | If this renderer needs additional data in each particle, then this should
|
---|
| 82 | be held in an instance of a subclass of ParticleVisualData, and this method
|
---|
| 83 | should be overridden to destroy an instance of it. The default
|
---|
| 84 | behaviour is to do nothing.
|
---|
| 85 | */
|
---|
| 86 | virtual void _destroyVisualData(ParticleVisualData* vis) { assert (vis == 0); }
|
---|
| 87 |
|
---|
| 88 | /** Sets which render queue group this renderer should target with it's
|
---|
| 89 | output.
|
---|
| 90 | */
|
---|
| 91 | virtual void setRenderQueueGroup(RenderQueueGroupID queueID) = 0;
|
---|
| 92 |
|
---|
| 93 |
|
---|
| 94 | };
|
---|
| 95 |
|
---|
| 96 | /** Abstract class definition of a factory object for ParticleSystemRenderer. */
|
---|
| 97 | class _OgreExport ParticleSystemRendererFactory : public FactoryObj<ParticleSystemRenderer>
|
---|
| 98 | {
|
---|
| 99 | public:
|
---|
| 100 | // No methods, must just override all methods inherited from FactoryObj
|
---|
| 101 | };
|
---|
| 102 |
|
---|
| 103 | }
|
---|
| 104 |
|
---|
| 105 | #endif
|
---|