/src/ogre/OgreMain/include/OgreParticleSystemRenderer.h
Line | Count | Source |
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-2014 Torus Knot Software Ltd |
8 | | |
9 | | Permission is hereby granted, free of charge, to any person obtaining a copy |
10 | | of this software and associated documentation files (the "Software"), to deal |
11 | | in the Software without restriction, including without limitation the rights |
12 | | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
13 | | copies of the Software, and to permit persons to whom the Software is |
14 | | furnished to do so, subject to the following conditions: |
15 | | |
16 | | The above copyright notice and this permission notice shall be included in |
17 | | all copies or substantial portions of the Software. |
18 | | |
19 | | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
20 | | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
21 | | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
22 | | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
23 | | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
24 | | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
25 | | THE 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 | | |
38 | | namespace Ogre { |
39 | | class ParticleVisualData; |
40 | | /** \addtogroup Core |
41 | | * @{ |
42 | | */ |
43 | | /** \addtogroup Effects |
44 | | * @{ |
45 | | */ |
46 | | /** Abstract class defining the interface required to be implemented |
47 | | by classes which provide rendering capability to ParticleSystem instances. |
48 | | */ |
49 | | class _OgreExport ParticleSystemRenderer : public StringInterface, public FXAlloc |
50 | | { |
51 | | public: |
52 | | /// Constructor |
53 | 0 | ParticleSystemRenderer() {} |
54 | | /// Destructor |
55 | 0 | virtual ~ParticleSystemRenderer() {} |
56 | | |
57 | | /** Gets the type of this renderer - must be implemented by subclasses */ |
58 | | virtual const String& getType(void) const = 0; |
59 | | |
60 | | /** Delegated to by ParticleSystem::_updateRenderQueue |
61 | | |
62 | | The subclass must update the render queue using whichever Renderable |
63 | | instance(s) it wishes. |
64 | | */ |
65 | | virtual void _updateRenderQueue(RenderQueue* queue, |
66 | | std::vector<Particle*>& currentParticles, bool cullIndividually) = 0; |
67 | | |
68 | | /** Sets the material this renderer must use; called by ParticleSystem. */ |
69 | | virtual void _setMaterial(MaterialPtr& mat) = 0; |
70 | | /** Delegated to by ParticleSystem::_notifyCurrentCamera */ |
71 | | virtual void _notifyCurrentCamera(Camera* cam) = 0; |
72 | | /** Delegated to by ParticleSystem::_notifyAttached */ |
73 | | virtual void _notifyAttached(Node* parent, bool isTagPoint = false) = 0; |
74 | | /** Tells the renderer that the particle quota has changed */ |
75 | | virtual void _notifyParticleQuota(size_t quota) = 0; |
76 | | /** Tells the renderer that the particle default size has changed */ |
77 | | virtual void _notifyDefaultDimensions(Real width, Real height) = 0; |
78 | | /** Optional callback notified when particle emitted */ |
79 | 0 | virtual void _notifyParticleEmitted(Particle* particle) {} |
80 | | /** Optional callback notified when particle expired */ |
81 | 0 | virtual void _notifyParticleExpired(Particle* particle) {} |
82 | | /** Optional callback notified when particles moved */ |
83 | 0 | virtual void _notifyParticleMoved(std::vector<Particle*>& currentParticles) {} |
84 | | /** Optional callback notified when particles cleared */ |
85 | 0 | virtual void _notifyParticleCleared(std::vector<Particle*>& currentParticles) {} |
86 | | /// @deprecated do not use |
87 | 0 | OGRE_DEPRECATED ParticleVisualData* _createVisualData(void) { return 0; } |
88 | | /// @deprecated do not use |
89 | 0 | OGRE_DEPRECATED void _destroyVisualData(ParticleVisualData*) {} |
90 | | |
91 | | /** Sets which render queue group this renderer should target with it's |
92 | | output. |
93 | | */ |
94 | | virtual void setRenderQueueGroup(uint8 queueID) = 0; |
95 | | /** Sets which render queue group and priority this renderer should target with it's |
96 | | output. |
97 | | */ |
98 | | virtual void setRenderQueueGroupAndPriority(uint8 queueID, ushort priority) = 0; |
99 | | |
100 | | /** Setting carried over from ParticleSystem. |
101 | | */ |
102 | | virtual void setKeepParticlesInLocalSpace(bool keepLocal) = 0; |
103 | | |
104 | | /** Gets the desired particles sort mode of this renderer */ |
105 | | virtual SortMode _getSortMode(void) const = 0; |
106 | | |
107 | | /** Required method to allow the renderer to communicate the Renderables |
108 | | it will be using to render the system to a visitor. |
109 | | @see MovableObject::visitRenderables |
110 | | */ |
111 | | virtual void visitRenderables(Renderable::Visitor* visitor, |
112 | | bool debugRenderables = false) = 0; |
113 | | |
114 | | /// Tells the Renderer about the ParticleSystem bounds |
115 | 0 | virtual void _notifyBoundingBox(const AxisAlignedBox& aabb) {} |
116 | | |
117 | | /// Tells the Renderer whether to cast shadows |
118 | 0 | virtual void _notifyCastShadows(bool enabled) {} |
119 | | }; |
120 | | |
121 | | /** @} */ |
122 | | /** @} */ |
123 | | |
124 | | } |
125 | | |
126 | | #endif |