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 #include "OgreCommon.h"
00034 
00035 namespace Ogre {
00036 
00057     class _OgreExport Billboard
00058     {
00059         friend class BillboardSet;
00060         friend class BillboardParticleRenderer;
00061     protected:
00062         bool mOwnDimensions;
00063         bool mUseTexcoordRect;
00064         uint16 mTexcoordIndex;      // index into the BillboardSet array of texture coordinates
00065         FloatRect mTexcoordRect;    // individual texture coordinates
00066         Real mWidth;
00067         Real mHeight;
00068     public:
00069         // Note the intentional public access to main internal variables used at runtime
00070         // Forcing access via get/set would be too costly for 000's of billboards
00071         Vector3 mPosition;
00072         // Normalised direction vector
00073         Vector3 mDirection;
00074         BillboardSet* mParentSet;
00075         ColourValue mColour;
00076         Radian mRotation;
00077 
00080         Billboard();
00081 
00084         ~Billboard();
00085 
00088         Billboard(const Vector3& position, BillboardSet* owner, const ColourValue& colour = ColourValue::White);
00089 
00094         const Radian& getRotation(void) const { return mRotation; }
00095 
00100         void setRotation(const Radian& rotation);
00101 
00107         void setPosition(const Vector3& position);
00108 
00114         void setPosition(Real x, Real y, Real z);
00115 
00121         const Vector3& getPosition(void) const;
00122 
00130         void setDimensions(Real width, Real height);
00131 
00133         void resetDimensions(void) { mOwnDimensions = false; }
00140         void setColour(const ColourValue& colour);
00141 
00144         const ColourValue& getColour(void) const;
00145 
00151         bool hasOwnDimensions(void) const;
00152 
00154         Real getOwnWidth(void) const;
00155 
00157         Real getOwnHeight(void) const;
00158 
00161         void _notifyOwner(BillboardSet* owner);
00162 
00172         bool isUseTexcoordRect(void) const { return mUseTexcoordRect; }
00173 
00181         void setTexcoordIndex(uint16 texcoordIndex);
00182 
00188         uint16 getTexcoordIndex(void) const { return mTexcoordIndex; }
00189 
00195         void setTexcoordRect(const FloatRect& texcoordRect);
00196 
00202         void setTexcoordRect(Real u0, Real v0, Real u1, Real v1);
00203 
00208         const FloatRect& getTexcoordRect(void) const { return mTexcoordRect; }
00209     };
00210 
00211 }
00212 
00213 #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 Mar 12 14:37:37 2006