# OgreBillboardParticleRenderer.h

Go to the documentation of this file.

    00001 /*
    00002 -----------------------------------------------------------------------------
    00003 This source file is part of OGRE
    00004 (Object-oriented Graphics Rendering Engine)
    00005 For the latest info, see http://www.ogre3d.org/
    00006
    00007 Copyright (c) 2000-2009 Torus Knot Software Ltd
    00008
    00009 Permission is hereby granted, free of charge, to any person obtaining a copy
    00010 of this software and associated documentation files (the "Software"), to deal
    00011 in the Software without restriction, including without limitation the rights
    00012 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    00013 copies of the Software, and to permit persons to whom the Software is
    00014 furnished to do so, subject to the following conditions:
    00015
    00016 The above copyright notice and this permission notice shall be included in
    00017 all copies or substantial portions of the Software.
    00018
    00019 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    00020 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    00021 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    00022 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    00023 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    00024 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    00025 THE SOFTWARE.
    00026 -----------------------------------------------------------------------------
    00027 */
    00028 #ifndef __BillboardParticleRenderer_H__
    00029 #define __BillboardParticleRenderer_H__
    00030
    00031 #include "OgrePrerequisites.h"
    00032 #include "OgreParticleSystemRenderer.h"
    00033 #include "OgreBillboardSet.h"
    00034
    00035 namespace Ogre {
    00036
    00051     class _OgreExport BillboardParticleRenderer : public ParticleSystemRenderer
    00052     {
    00053     protected:
    00055         BillboardSet* mBillboardSet;
    00056     public:
    00057         BillboardParticleRenderer();
    00058         ~BillboardParticleRenderer();
    00059
    00061         class _OgrePrivate CmdBillboardType : public ParamCommand
    00062         {
    00063         public:
    00064             String doGet(const void* target) const;
    00065             void doSet(void* target, const String& val);
    00066         };
    00068         class _OgrePrivate CmdBillboardOrigin : public ParamCommand
    00069         {
    00070         public:
    00071             String doGet(const void* target) const;
    00072             void doSet(void* target, const String& val);
    00073         };
    00075         class _OgrePrivate CmdBillboardRotationType : public ParamCommand
    00076         {
    00077         public:
    00078             String doGet(const void* target) const;
    00079             void doSet(void* target, const String& val);
    00080         };
    00082         class _OgrePrivate CmdCommonDirection : public ParamCommand
    00083         {
    00084         public:
    00085             String doGet(const void* target) const;
    00086             void doSet(void* target, const String& val);
    00087         };
    00089         class _OgrePrivate CmdCommonUpVector : public ParamCommand
    00090         {
    00091         public:
    00092             String doGet(const void* target) const;
    00093             void doSet(void* target, const String& val);
    00094         };
    00096         class _OgrePrivate CmdPointRendering : public ParamCommand
    00097         {
    00098         public:
    00099             String doGet(const void* target) const;
    00100             void doSet(void* target, const String& val);
    00101         };
    00103         class _OgrePrivate CmdAccurateFacing : public ParamCommand
    00104         {
    00105         public:
    00106             String doGet(const void* target) const;
    00107             void doSet(void* target, const String& val);
    00108         };
    00109
    00120         void setBillboardType(BillboardType bbt);
    00121
    00123         BillboardType getBillboardType(void) const;
    00124
    00126         void setUseAccurateFacing(bool acc);
    00128         bool getUseAccurateFacing(void) const;
    00129
    00141         void setBillboardOrigin(BillboardOrigin origin) { mBillboardSet->setBillboardOrigin(origin); }
    00142
    00147         BillboardOrigin getBillboardOrigin(void) const { return mBillboardSet->getBillboardOrigin(); }
    00148
    00158         void setBillboardRotationType(BillboardRotationType rotationType);
    00159
    00164         BillboardRotationType getBillboardRotationType(void) const;
    00165
    00173         void setCommonDirection(const Vector3& vec);
    00174
    00176         const Vector3& getCommonDirection(void) const;
    00177
    00187         void setCommonUpVector(const Vector3& vec);
    00188
    00190         const Vector3& getCommonUpVector(void) const;
    00191
    00193         void setPointRenderingEnabled(bool enabled);
    00194
    00196         bool isPointRenderingEnabled(void) const;
    00197
    00198
    00199
    00201         const String& getType(void) const;
    00203         void _updateRenderQueue(RenderQueue* queue,
    00204             list<Particle*>::type& currentParticles, bool cullIndividually);
    00206         void visitRenderables(Renderable::Visitor* visitor,
    00207             bool debugRenderables = false);
    00209         void _setMaterial(MaterialPtr& mat);
    00211         void _notifyCurrentCamera(Camera* cam);
    00213         void _notifyParticleRotated(void);
    00215         void _notifyParticleResized(void);
    00217         void _notifyParticleQuota(size_t quota);
    00219         void _notifyAttached(Node* parent, bool isTagPoint = false);
    00221         void _notifyDefaultDimensions(Real width, Real height);
    00223         void setRenderQueueGroup(uint8 queueID);
    00225         void setKeepParticlesInLocalSpace(bool keepLocal);
    00227         SortMode _getSortMode(void) const;
    00228
    00230         BillboardSet* getBillboardSet(void) const { return mBillboardSet; }
    00231
    00232     protected:
    00233         static CmdBillboardType msBillboardTypeCmd;
    00234         static CmdBillboardOrigin msBillboardOriginCmd;
    00235         static CmdBillboardRotationType msBillboardRotationTypeCmd;
    00236         static CmdCommonDirection msCommonDirectionCmd;
    00237         static CmdCommonUpVector msCommonUpVectorCmd;
    00238         static CmdPointRendering msPointRenderingCmd;
    00239         static CmdAccurateFacing msAccurateFacingCmd;
    00240
    00241
    00242     };
    00243
    00245     class _OgreExport BillboardParticleRendererFactory : public ParticleSystemRendererFactory
    00246     {
    00247     public:
    00249         const String& getType() const;
    00251         ParticleSystemRenderer* createInstance( const String& name );
    00253         void destroyInstance( ParticleSystemRenderer* inst);
    00254     };
    00258 }
    00259
    00260 #endif
    00261

Copyright © 2008 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Sun May 8 2011 20:28:08