OGRE  1.9.0
OgreParticleSystemRenderer.h
Go to the documentation of this file.
1/*
2-----------------------------------------------------------------------------
3This source file is part of OGRE
4(Object-oriented Graphics Rendering Engine)
5For the latest info, see http://www.ogre3d.org/
6
7Copyright (c) 2000-2014 Torus Knot Software Ltd
8
9Permission is hereby granted, free of charge, to any person obtaining a copy
10of this software and associated documentation files (the "Software"), to deal
11in the Software without restriction, including without limitation the rights
12to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13copies of the Software, and to permit persons to whom the Software is
14furnished to do so, subject to the following conditions:
15
16The above copyright notice and this permission notice shall be included in
17all copies or substantial portions of the Software.
18
19THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25THE SOFTWARE.
26-----------------------------------------------------------------------------
27*/
28#ifndef __ParticleSystemRenderer_H__
29#define __ParticleSystemRenderer_H__
30
31#include "OgrePrerequisites.h"
32#include "OgreStringInterface.h"
33#include "OgreFactoryObj.h"
34#include "OgreRenderQueue.h"
35#include "OgreCommon.h"
36#include "OgreRenderable.h"
37
38namespace Ogre {
39
50 {
51 public:
56
58 virtual const String& getType(void) const = 0;
59
65 virtual void _updateRenderQueue(RenderQueue* queue,
66 list<Particle*>::type& currentParticles, bool cullIndividually) = 0;
67
69 virtual void _setMaterial(MaterialPtr& mat) = 0;
71 virtual void _notifyCurrentCamera(Camera* cam) = 0;
73 virtual void _notifyAttached(Node* parent, bool isTagPoint = false) = 0;
75 virtual void _notifyParticleRotated(void) {}
77 virtual void _notifyParticleResized(void) {}
79 virtual void _notifyParticleQuota(size_t quota) = 0;
81 virtual void _notifyDefaultDimensions(Real width, Real height) = 0;
83 virtual void _notifyParticleEmitted(Particle* particle) {}
85 virtual void _notifyParticleExpired(Particle* particle) {}
87 virtual void _notifyParticleMoved(list<Particle*>::type& currentParticles) {}
89 virtual void _notifyParticleCleared(list<Particle*>::type& currentParticles) {}
97 virtual ParticleVisualData* _createVisualData(void) { return 0; }
105 virtual void _destroyVisualData(ParticleVisualData* vis) { assert (vis == 0); }
106
110 virtual void setRenderQueueGroup(uint8 queueID) = 0;
114 virtual void setRenderQueueGroupAndPriority(uint8 queueID, ushort priority) = 0;
115
118 virtual void setKeepParticlesInLocalSpace(bool keepLocal) = 0;
119
121 virtual SortMode _getSortMode(void) const = 0;
122
127 virtual void visitRenderables(Renderable::Visitor* visitor,
128 bool debugRenderables = false) = 0;
129
130 };
131
133 class _OgreExport ParticleSystemRendererFactory : public FactoryObj<ParticleSystemRenderer>, public FXAlloc
134 {
135 public:
136 // No methods, must just override all methods inherited from FactoryObj
137 };
138
140
141}
142
143#endif
#define _OgreExport
A viewpoint from which the scene will be rendered.
Definition OgreCamera.h:87
Abstract factory class.
Class representing a general-purpose node an articulated scene graph.
Definition OgreNode.h:65
Abstract class definition of a factory object for ParticleSystemRenderer.
virtual void _notifyParticleQuota(size_t quota)=0
Tells the renderer that the particle quota has changed.
virtual void _notifyParticleRotated(void)
Optional callback notified when particles are rotated.
virtual void _updateRenderQueue(RenderQueue *queue, list< Particle * >::type &currentParticles, bool cullIndividually)=0
Delegated to by ParticleSystem::_updateRenderQueue.
virtual SortMode _getSortMode(void) const =0
Gets the desired particles sort mode of this renderer.
virtual void _notifyDefaultDimensions(Real width, Real height)=0
Tells the renderer that the particle default size has changed.
virtual void _notifyCurrentCamera(Camera *cam)=0
Delegated to by ParticleSystem::_notifyCurrentCamera.
virtual void _notifyParticleExpired(Particle *particle)
Optional callback notified when particle expired.
virtual void _notifyParticleResized(void)
Optional callback notified when particles are resized individually.
virtual void _notifyParticleMoved(list< Particle * >::type &currentParticles)
Optional callback notified when particles moved.
virtual void setKeepParticlesInLocalSpace(bool keepLocal)=0
Setting carried over from ParticleSystem.
virtual void _notifyParticleCleared(list< Particle * >::type &currentParticles)
Optional callback notified when particles cleared.
virtual void _notifyAttached(Node *parent, bool isTagPoint=false)=0
Delegated to by ParticleSystem::_notifyAttached.
virtual ParticleVisualData * _createVisualData(void)
Create a new ParticleVisualData instance for attachment to a particle.
virtual void setRenderQueueGroup(uint8 queueID)=0
Sets which render queue group this renderer should target with it's output.
virtual const String & getType(void) const =0
Gets the type of this renderer - must be implemented by subclasses.
virtual void _setMaterial(MaterialPtr &mat)=0
Sets the material this renderer must use; called by ParticleSystem.
virtual void setRenderQueueGroupAndPriority(uint8 queueID, ushort priority)=0
Sets which render queue group and priority this renderer should target with it's output.
virtual void _destroyVisualData(ParticleVisualData *vis)
Destroy a ParticleVisualData instance.
virtual void _notifyParticleEmitted(Particle *particle)
Optional callback notified when particle emitted.
virtual void visitRenderables(Renderable::Visitor *visitor, bool debugRenderables=false)=0
Required method to allow the renderer to communicate the Renderables it will be using to render the s...
Abstract class containing any additional data required to be associated with a particle to perform th...
Class representing a single particle instance.
Class to manage the scene object rendering queue.
Visitor object that can be used to iterate over a collection of Renderable instances abstractly.
SortMode
Sort mode for billboard-set and particle-system.
Definition OgreCommon.h:287
unsigned char uint8
SharedPtr< Material > MaterialPtr
float Real
Software floating point type.
SceneObjAllocatedObject FXAlloc
_StringBase String
unsigned short ushort
std::list< T, A > type