#pragma once #ifdef GAMETOOLS_ILLUMINATION_MODULE #include "OgreBillboardParticleRenderer.h" #include "SpriteSet.h" namespace Ogre { /** Specialisation of ParticleSystemRenderer to render particles using a BillboardSet. @remarks This renderer has a few more options than the standard particle system, which will be passed to it automatically when the particle system itself does not understand them. */ class _OgreExport SpriteParticleRenderer : public ParticleSystemRenderer { protected: /// The billboard set that's doing the rendering SpriteSet* mSpriteSet; int particleSorting; public: SpriteParticleRenderer(); ~SpriteParticleRenderer(); void setParticleSorting(int sorting, Camera* cam); /// @copydoc ParticleSystemRenderer::getType const String& getType(void) const; /// @copydoc ParticleSystemRenderer::_updateRenderQueue void _updateRenderQueue(RenderQueue* queue, std::list& currentParticles, bool cullIndividually); /// @copydoc ParticleSystemRenderer::_setMaterial void _setMaterial(MaterialPtr& mat); /// @copydoc ParticleSystemRenderer::_notifyCurrentCamera void _notifyCurrentCamera(Camera* cam); /// @copydoc ParticleSystemRenderer::_notifyParticleRotated void _notifyParticleRotated(void){} /// @copydoc ParticleSystemRenderer::_notifyParticleResized void _notifyParticleResized(void); /// @copydoc ParticleSystemRenderer::_notifyParticleQuota void _notifyParticleQuota(size_t quota); /// @copydoc ParticleSystemRenderer::_notifyAttached void _notifyAttached(Node* parent, bool isTagPoint = false); /// @copydoc ParticleSystemRenderer::_notifyDefaultDimensions void _notifyDefaultDimensions(Real width, Real height); /// @copydoc ParticleSystemRenderer::setRenderQueueGroup void setRenderQueueGroup(uint8 queueID); virtual void setKeepParticlesInLocalSpace(bool keepLocal) { mSpriteSet->setBillboardsInWorldSpace(!keepLocal); } virtual SortMode _getSortMode(void) const { return mSpriteSet->_getSortMode(); } /// Access SpriteSet in use SpriteSet* getSpriteSet(void) const { return mSpriteSet; } }; /** Factory class for BillboardParticleRenderer */ class _OgreExport SpriteParticleRendererFactory : public ParticleSystemRendererFactory { public: /// @copydoc FactoryObj::getType const String& getType() const; /// @copydoc FactoryObj::createInstance ParticleSystemRenderer* createInstance( const String& name ); /// @copydoc FactoryObj::destroyInstance void destroyInstance( ParticleSystemRenderer* inst); }; } #endif