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-2013 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 #include "OgreHeaderPrefix.h"
00035 
00036 namespace Ogre {
00037 
00052     class _OgreExport BillboardParticleRenderer : public ParticleSystemRenderer
00053     {
00054     protected:
00056         BillboardSet* mBillboardSet;
00057     public:
00058         BillboardParticleRenderer();
00059         ~BillboardParticleRenderer();
00060 
00062         class _OgrePrivate CmdBillboardType : public ParamCommand
00063         {
00064         public:
00065             String doGet(const void* target) const;
00066             void doSet(void* target, const String& val);
00067         };
00069         class _OgrePrivate CmdBillboardOrigin : public ParamCommand
00070         {
00071         public:
00072             String doGet(const void* target) const;
00073             void doSet(void* target, const String& val);
00074         };
00076         class _OgrePrivate CmdBillboardRotationType : public ParamCommand
00077         {
00078         public:
00079             String doGet(const void* target) const;
00080             void doSet(void* target, const String& val);
00081         };
00083         class _OgrePrivate CmdCommonDirection : public ParamCommand
00084         {
00085         public:
00086             String doGet(const void* target) const;
00087             void doSet(void* target, const String& val);
00088         };
00090         class _OgrePrivate CmdCommonUpVector : public ParamCommand
00091         {
00092         public:
00093             String doGet(const void* target) const;
00094             void doSet(void* target, const String& val);
00095         };
00097         class _OgrePrivate CmdPointRendering : public ParamCommand
00098         {
00099         public:
00100             String doGet(const void* target) const;
00101             void doSet(void* target, const String& val);
00102         };
00104         class _OgrePrivate CmdAccurateFacing : public ParamCommand
00105         {
00106         public:
00107             String doGet(const void* target) const;
00108             void doSet(void* target, const String& val);
00109         };
00110 
00121         void setBillboardType(BillboardType bbt);
00122 
00124         BillboardType getBillboardType(void) const;
00125 
00127         void setUseAccurateFacing(bool acc);
00129         bool getUseAccurateFacing(void) const;
00130 
00142         void setBillboardOrigin(BillboardOrigin origin) { mBillboardSet->setBillboardOrigin(origin); }
00143 
00148         BillboardOrigin getBillboardOrigin(void) const { return mBillboardSet->getBillboardOrigin(); }
00149 
00159         void setBillboardRotationType(BillboardRotationType rotationType);
00160 
00165         BillboardRotationType getBillboardRotationType(void) const;
00166 
00174         void setCommonDirection(const Vector3& vec);
00175 
00177         const Vector3& getCommonDirection(void) const;
00178 
00188         void setCommonUpVector(const Vector3& vec);
00189 
00191         const Vector3& getCommonUpVector(void) const;
00192 
00194         void setPointRenderingEnabled(bool enabled);
00195 
00197         bool isPointRenderingEnabled(void) const;
00198 
00199 
00200 
00202         const String& getType(void) const;
00204         void _updateRenderQueue(RenderQueue* queue, 
00205             list<Particle*>::type& currentParticles, bool cullIndividually);
00207         void visitRenderables(Renderable::Visitor* visitor, 
00208             bool debugRenderables = false);
00210         void _setMaterial(MaterialPtr& mat);
00212         void _notifyCurrentCamera(Camera* cam);
00214         void _notifyParticleRotated(void);
00216         void _notifyParticleResized(void);
00218         void _notifyParticleQuota(size_t quota);
00220         void _notifyAttached(Node* parent, bool isTagPoint = false);
00222         void _notifyDefaultDimensions(Real width, Real height);
00224         void setRenderQueueGroup(uint8 queueID);
00226         void setRenderQueueGroupAndPriority(uint8 queueID, ushort priority);
00228         void setKeepParticlesInLocalSpace(bool keepLocal);
00230         SortMode _getSortMode(void) const;
00231 
00233         BillboardSet* getBillboardSet(void) const { return mBillboardSet; }
00234 
00235     protected:
00236         static CmdBillboardType msBillboardTypeCmd;
00237         static CmdBillboardOrigin msBillboardOriginCmd;
00238         static CmdBillboardRotationType msBillboardRotationTypeCmd;
00239         static CmdCommonDirection msCommonDirectionCmd;
00240         static CmdCommonUpVector msCommonUpVectorCmd;
00241         static CmdPointRendering msPointRenderingCmd;
00242         static CmdAccurateFacing msAccurateFacingCmd;
00243 
00244 
00245     };
00246 
00248     class _OgreExport BillboardParticleRendererFactory : public ParticleSystemRendererFactory
00249     {
00250     public:
00252         const String& getType() const;
00254         ParticleSystemRenderer* createInstance( const String& name );
00256         void destroyInstance(ParticleSystemRenderer* ptr);
00257     };
00261 } // namespace Ogre
00262 
00263 #include "OgreHeaderSuffix.h"
00264 
00265 #endif // __BillboardParticleRenderer_H__
00266 

Copyright © 2012 Torus Knot Software Ltd
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Mon Jul 27 2020 13:40:40