OGRE  1.7
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OgreBillboard.h
Go to the documentation of this file.
1 /*
2 -----------------------------------------------------------------------------
3 This source file is part of OGRE
4  (Object-oriented Graphics Rendering Engine)
5 For the latest info, see http://www.ogre3d.org/
6 
7 Copyright (c) 2000-2011 Torus Knot Software Ltd
8 
9 Permission is hereby granted, free of charge, to any person obtaining a copy
10 of this software and associated documentation files (the "Software"), to deal
11 in the Software without restriction, including without limitation the rights
12 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 copies of the Software, and to permit persons to whom the Software is
14 furnished to do so, subject to the following conditions:
15 
16 The above copyright notice and this permission notice shall be included in
17 all copies or substantial portions of the Software.
18 
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 THE SOFTWARE.
26 -----------------------------------------------------------------------------
27 */
28 
29 #ifndef __Billboard_H__
30 #define __Billboard_H__
31 
32 #include "OgrePrerequisites.h"
33 
34 #include "OgreVector3.h"
35 #include "OgreColourValue.h"
36 #include "OgreCommon.h"
37 
38 namespace Ogre {
66  class _OgreExport Billboard : public FXAlloc
67  {
68  friend class BillboardSet;
70  protected:
73  uint16 mTexcoordIndex; // index into the BillboardSet array of texture coordinates
74  FloatRect mTexcoordRect; // individual texture coordinates
77  public:
78  // Note the intentional public access to main internal variables used at runtime
79  // Forcing access via get/set would be too costly for 000's of billboards
81  // Normalised direction vector
86 
89  Billboard();
90 
93  ~Billboard();
94 
97  Billboard(const Vector3& position, BillboardSet* owner, const ColourValue& colour = ColourValue::White);
98 
103  const Radian& getRotation(void) const { return mRotation; }
104 
109  void setRotation(const Radian& rotation);
110 
116  void setPosition(const Vector3& position);
117 
123  void setPosition(Real x, Real y, Real z);
124 
130  const Vector3& getPosition(void) const;
131 
139  void setDimensions(Real width, Real height);
140 
142  void resetDimensions(void) { mOwnDimensions = false; }
149  void setColour(const ColourValue& colour);
150 
153  const ColourValue& getColour(void) const;
154 
160  bool hasOwnDimensions(void) const;
161 
163  Real getOwnWidth(void) const;
164 
166  Real getOwnHeight(void) const;
167 
170  void _notifyOwner(BillboardSet* owner);
171 
181  bool isUseTexcoordRect(void) const { return mUseTexcoordRect; }
182 
190  void setTexcoordIndex(uint16 texcoordIndex);
191 
197  uint16 getTexcoordIndex(void) const { return mTexcoordIndex; }
198 
204  void setTexcoordRect(const FloatRect& texcoordRect);
205 
211  void setTexcoordRect(Real u0, Real v0, Real u1, Real v1);
212 
217  const FloatRect& getTexcoordRect(void) const { return mTexcoordRect; }
218  };
219 
223 }
224 
225 #endif
ColourValue mColour
Definition: OgreBillboard.h:84
float Real
Software floating point type.
#define _OgreExport
Definition: OgrePlatform.h:203
const Radian & getRotation(void) const
Get the rotation of the billboard.
Class representing colour.
static const ColourValue White
A collection of billboards (faces which are always facing the given direction) with the same (default...
bool isUseTexcoordRect(void) const
Returns true if this billboard use individual texture coordinate rect (i.e.
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
FloatRect mTexcoordRect
Definition: OgreBillboard.h:74
Specialisation of ParticleSystemRenderer to render particles using a BillboardSet.
Standard 3-dimensional vector.
Definition: OgreVector3.h:51
uint16 mTexcoordIndex
Definition: OgreBillboard.h:73
Wrapper class which indicates a given angle value is in Radians.
Definition: OgreMath.h:46
uint16 getTexcoordIndex(void) const
getTexcoordIndex() returns the previous value set by setTexcoordIndex().
A billboard is a primitive which always faces the camera in every frame.
Definition: OgreBillboard.h:66
Vector3 mDirection
Definition: OgreBillboard.h:82
BillboardSet * mParentSet
Definition: OgreBillboard.h:83
unsigned short uint16
Definition: OgrePlatform.h:247
const FloatRect & getTexcoordRect(void) const
getTexcoordRect() returns the previous value set by setTexcoordRect().
void resetDimensions(void)
Resets this Billboard to use the parent BillboardSet's dimensions instead of it's own...