1 | #pragma once
|
---|
2 |
|
---|
3 | #ifdef GAMETOOLS_ILLUMINATION_MODULE
|
---|
4 |
|
---|
5 | #include "OgreBillboardParticleRenderer.h"
|
---|
6 | #include "SpriteSet.h"
|
---|
7 |
|
---|
8 | namespace Ogre {
|
---|
9 |
|
---|
10 | /** Specialisation of ParticleSystemRenderer to render particles using
|
---|
11 | a BillboardSet.
|
---|
12 | @remarks
|
---|
13 | This renderer has a few more options than the standard particle system,
|
---|
14 | which will be passed to it automatically when the particle system itself
|
---|
15 | does not understand them.
|
---|
16 | */
|
---|
17 | class _OgreExport SpriteParticleRenderer : public ParticleSystemRenderer
|
---|
18 | {
|
---|
19 | protected:
|
---|
20 | /// The billboard set that's doing the rendering
|
---|
21 | SpriteSet* mSpriteSet;
|
---|
22 | int particleSorting;
|
---|
23 |
|
---|
24 | public:
|
---|
25 | SpriteParticleRenderer();
|
---|
26 | ~SpriteParticleRenderer();
|
---|
27 |
|
---|
28 | void setParticleSorting(int sorting, Camera* cam);
|
---|
29 |
|
---|
30 |
|
---|
31 | /// @copydoc ParticleSystemRenderer::getType
|
---|
32 | const String& getType(void) const;
|
---|
33 | /// @copydoc ParticleSystemRenderer::_updateRenderQueue
|
---|
34 | void _updateRenderQueue(RenderQueue* queue,
|
---|
35 | std::list<Particle*>& currentParticles, bool cullIndividually);
|
---|
36 | /// @copydoc ParticleSystemRenderer::_setMaterial
|
---|
37 | void _setMaterial(MaterialPtr& mat);
|
---|
38 | /// @copydoc ParticleSystemRenderer::_notifyCurrentCamera
|
---|
39 | void _notifyCurrentCamera(Camera* cam);
|
---|
40 | /// @copydoc ParticleSystemRenderer::_notifyParticleRotated
|
---|
41 | void _notifyParticleRotated(void){}
|
---|
42 | /// @copydoc ParticleSystemRenderer::_notifyParticleResized
|
---|
43 | void _notifyParticleResized(void);
|
---|
44 | /// @copydoc ParticleSystemRenderer::_notifyParticleQuota
|
---|
45 | void _notifyParticleQuota(size_t quota);
|
---|
46 | /// @copydoc ParticleSystemRenderer::_notifyAttached
|
---|
47 | void _notifyAttached(Node* parent, bool isTagPoint = false);
|
---|
48 | /// @copydoc ParticleSystemRenderer::_notifyDefaultDimensions
|
---|
49 | void _notifyDefaultDimensions(Real width, Real height);
|
---|
50 | /// @copydoc ParticleSystemRenderer::setRenderQueueGroup
|
---|
51 | void setRenderQueueGroup(uint8 queueID);
|
---|
52 | virtual void setKeepParticlesInLocalSpace(bool keepLocal)
|
---|
53 | {
|
---|
54 | mSpriteSet->setBillboardsInWorldSpace(!keepLocal);
|
---|
55 | }
|
---|
56 | virtual SortMode _getSortMode(void) const
|
---|
57 | {
|
---|
58 | return mSpriteSet->_getSortMode();
|
---|
59 | }
|
---|
60 |
|
---|
61 | /// Access SpriteSet in use
|
---|
62 | SpriteSet* getSpriteSet(void) const { return mSpriteSet; }
|
---|
63 |
|
---|
64 | };
|
---|
65 |
|
---|
66 | /** Factory class for BillboardParticleRenderer */
|
---|
67 | class _OgreExport SpriteParticleRendererFactory : public ParticleSystemRendererFactory
|
---|
68 | {
|
---|
69 | public:
|
---|
70 | /// @copydoc FactoryObj::getType
|
---|
71 | const String& getType() const;
|
---|
72 | /// @copydoc FactoryObj::createInstance
|
---|
73 | ParticleSystemRenderer* createInstance( const String& name );
|
---|
74 | /// @copydoc FactoryObj::destroyInstance
|
---|
75 | void destroyInstance( ParticleSystemRenderer* inst);
|
---|
76 | };
|
---|
77 |
|
---|
78 | }
|
---|
79 |
|
---|
80 |
|
---|
81 | #endif |
---|