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-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 
00029 #ifndef __Billboard_H__
00030 #define __Billboard_H__
00031 
00032 #include "OgrePrerequisites.h"
00033 
00034 #include "OgreVector3.h"
00035 #include "OgreColourValue.h"
00036 #include "OgreCommon.h"
00037 #include "OgreHeaderPrefix.h"
00038 
00039 namespace Ogre {
00067     class _OgreExport Billboard : public FXAlloc
00068     {
00069         friend class BillboardSet;
00070         friend class BillboardParticleRenderer;
00071     protected:
00072         bool mOwnDimensions;
00073         bool mUseTexcoordRect;
00074         uint16 mTexcoordIndex;      
00075         FloatRect mTexcoordRect;    
00076         Real mWidth;
00077         Real mHeight;
00078     public:
00079         // Note the intentional public access to main internal variables used at runtime
00080         // Forcing access via get/set would be too costly for 000's of billboards
00081         Vector3 mPosition;
00083         Vector3 mDirection;
00084         BillboardSet* mParentSet;
00085         ColourValue mColour;
00086         Radian mRotation;
00087 
00090         Billboard();
00091 
00094         ~Billboard();
00095 
00098         Billboard(const Vector3& position, BillboardSet* owner, const ColourValue& colour = ColourValue::White);
00099 
00104         const Radian& getRotation(void) const { return mRotation; }
00105 
00110         void setRotation(const Radian& rotation);
00111 
00117         void setPosition(const Vector3& position);
00118 
00124         void setPosition(Real x, Real y, Real z);
00125 
00131         const Vector3& getPosition(void) const;
00132 
00140         void setDimensions(Real width, Real height);
00141 
00143         void resetDimensions(void) { mOwnDimensions = false; }
00150         void setColour(const ColourValue& colour);
00151 
00154         const ColourValue& getColour(void) const;
00155 
00161         bool hasOwnDimensions(void) const;
00162 
00164         Real getOwnWidth(void) const;
00165 
00167         Real getOwnHeight(void) const;
00168 
00171         void _notifyOwner(BillboardSet* owner);
00172 
00182         bool isUseTexcoordRect(void) const { return mUseTexcoordRect; }
00183 
00191         void setTexcoordIndex(uint16 texcoordIndex);
00192 
00198         uint16 getTexcoordIndex(void) const { return mTexcoordIndex; }
00199 
00205         void setTexcoordRect(const FloatRect& texcoordRect);
00206 
00212         void setTexcoordRect(Real u0, Real v0, Real u1, Real v1);
00213 
00218         const FloatRect& getTexcoordRect(void) const { return mTexcoordRect; }
00219     };
00220 
00224 }
00225 
00226 #include "OgreHeaderSuffix.h"
00227 
00228 #endif

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