OGRE  1.9
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties 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-2014 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 #include "OgreHeaderPrefix.h"
38 
39 namespace Ogre {
67  class _OgreExport Billboard : public FXAlloc
68  {
69  friend class BillboardSet;
71  protected:
78  public:
79  // Note the intentional public access to main internal variables used at runtime
80  // Forcing access via get/set would be too costly for 000's of billboards
87 
90  Billboard();
91 
94  ~Billboard();
95 
98  Billboard(const Vector3& position, BillboardSet* owner, const ColourValue& colour = ColourValue::White);
99 
104  const Radian& getRotation(void) const { return mRotation; }
105 
110  void setRotation(const Radian& rotation);
111 
117  void setPosition(const Vector3& position);
118 
124  void setPosition(Real x, Real y, Real z);
125 
131  const Vector3& getPosition(void) const;
132 
140  void setDimensions(Real width, Real height);
141 
143  void resetDimensions(void) { mOwnDimensions = false; }
150  void setColour(const ColourValue& colour);
151 
154  const ColourValue& getColour(void) const;
155 
161  bool hasOwnDimensions(void) const;
162 
164  Real getOwnWidth(void) const;
165 
167  Real getOwnHeight(void) const;
168 
171  void _notifyOwner(BillboardSet* owner);
172 
182  bool isUseTexcoordRect(void) const { return mUseTexcoordRect; }
183 
191  void setTexcoordIndex(uint16 texcoordIndex);
192 
198  uint16 getTexcoordIndex(void) const { return mTexcoordIndex; }
199 
205  void setTexcoordRect(const FloatRect& texcoordRect);
206 
212  void setTexcoordRect(Real u0, Real v0, Real u1, Real v1);
213 
218  const FloatRect& getTexcoordRect(void) const { return mTexcoordRect; }
219  };
220 
224 }
225 
226 #include "OgreHeaderSuffix.h"
227 
228 #endif
ColourValue mColour
Definition: OgreBillboard.h:85
float Real
Software floating point type.
#define _OgreExport
Definition: OgrePlatform.h:260
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
Index into the BillboardSet array of texture coordinates.
Definition: OgreBillboard.h:75
Specialisation of ParticleSystemRenderer to render particles using a BillboardSet.
Standard 3-dimensional vector.
Definition: OgreVector3.h:51
uint16 mTexcoordIndex
Definition: OgreBillboard.h:74
Wrapper class which indicates a given angle value is in Radians.
Definition: OgreMath.h:47
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:67
Vector3 mDirection
Normalised direction vector.
Definition: OgreBillboard.h:83
BillboardSet * mParentSet
Definition: OgreBillboard.h:84
unsigned short uint16
Definition: OgrePlatform.h:345
const FloatRect & getTexcoordRect(void) const
getTexcoordRect() returns the previous value set by setTexcoordRect().
Real mWidth
Individual texture coordinates.
Definition: OgreBillboard.h:76
void resetDimensions(void)
Resets this Billboard to use the parent BillboardSet's dimensions instead of it's own...