Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

OgreBillboard.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-2005 The OGRE Team
00008 Also see acknowledgements in Readme.html
00009 
00010 This program is free software; you can redistribute it and/or modify it under
00011 the terms of the GNU Lesser General Public License as published by the Free Software
00012 Foundation; either version 2 of the License, or (at your option) any later
00013 version.
00014 
00015 This program is distributed in the hope that it will be useful, but WITHOUT
00016 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00017 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
00018 
00019 You should have received a copy of the GNU Lesser General Public License along with
00020 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
00021 Place - Suite 330, Boston, MA 02111-1307, USA, or go to
00022 http://www.gnu.org/copyleft/lesser.txt.
00023 -----------------------------------------------------------------------------
00024 */
00025 
00026 #ifndef __Billboard_H__
00027 #define __Billboard_H__
00028 
00029 #include "OgrePrerequisites.h"
00030 
00031 #include "OgreVector3.h"
00032 #include "OgreColourValue.h"
00033 
00034 
00035 namespace Ogre {
00036 
00057     class _OgreExport Billboard
00058     {
00059         friend class BillboardSet;
00060         friend class BillboardParticleRenderer;
00061     protected:
00062         bool mOwnDimensions;
00063         Real mWidth;
00064         Real mHeight;
00065     public:
00066         // Note the intentional public access to main internal variables used at runtime
00067         // Forcing access via get/set would be too costly for 000's of billboards
00068         Vector3 mPosition;
00069         // NB direction only relevant for rendering when billboard type = BBT_ORIENTED_SELF
00070         Vector3 mDirection;
00071         BillboardSet* mParentSet;
00072         ColourValue mColour;
00073         Radian mRotation;
00074 
00077         Billboard();
00078 
00081         ~Billboard();
00082 
00085         Billboard(const Vector3& position, BillboardSet* owner, const ColourValue& colour = ColourValue::White);
00086 
00091         const Radian& getRotation(void) const { return mRotation; }
00092 
00097         void setRotation(const Radian& rotation);
00098 
00104         void setPosition(const Vector3& position);
00105 
00111         void setPosition(Real x, Real y, Real z);
00112 
00118         const Vector3& getPosition(void) const;
00119 
00127         void setDimensions(Real width, Real height);
00128 
00130         void resetDimensions(void) { mOwnDimensions = false; }
00137         void setColour(const ColourValue& colour);
00138 
00141         const ColourValue& getColour(void) const;
00142 
00148         bool hasOwnDimensions(void) const;
00149 
00151         Real getOwnWidth(void) const;
00152 
00154         Real getOwnHeight(void) const;
00155 
00158         void _notifyOwner(BillboardSet* owner);
00159 
00160     };
00161 
00162 }
00163 
00164 #endif

Copyright © 2000-2005 by The OGRE Team
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Feb 12 12:59:41 2006