OGRE  1.9.0
OgreBillboard.h
Go to the documentation of this file.
1/*
2-----------------------------------------------------------------------------
3This source file is part of OGRE
4 (Object-oriented Graphics Rendering Engine)
5For the latest info, see http://www.ogre3d.org/
6
7Copyright (c) 2000-2014 Torus Knot Software Ltd
8
9Permission is hereby granted, free of charge, to any person obtaining a copy
10of this software and associated documentation files (the "Software"), to deal
11in the Software without restriction, including without limitation the rights
12to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13copies of the Software, and to permit persons to whom the Software is
14furnished to do so, subject to the following conditions:
15
16The above copyright notice and this permission notice shall be included in
17all copies or substantial portions of the Software.
18
19THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25THE 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
39namespace Ogre {
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
91
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
172
182 bool isUseTexcoordRect(void) const { return mUseTexcoordRect; }
183
192
198 uint16 getTexcoordIndex(void) const { return mTexcoordIndex; }
199
206
213
218 const FloatRect& getTexcoordRect(void) const { return mTexcoordRect; }
219 };
220
224}
225
226#include "OgreHeaderSuffix.h"
227
228#endif
#define _OgreExport
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
Specialisation of ParticleSystemRenderer to render particles using a BillboardSet.
A collection of billboards (faces which are always facing the given direction) with the same (default...
A billboard is a primitive which always faces the camera in every frame.
void setPosition(Real x, Real y, Real z)
Set the position of the billboard.
void setTexcoordRect(const FloatRect &texcoordRect)
setTexcoordRect() sets the individual texture coordinate rect of this billboard will use when renderi...
Real getOwnHeight(void) const
Retrieves the billboard's personal height, if hasOwnDimensions is true.
Billboard()
Default constructor.
bool isUseTexcoordRect(void) const
Returns true if this billboard use individual texture coordinate rect (i.e.
~Billboard()
Default destructor.
Vector3 mDirection
Normalised direction vector.
uint16 getTexcoordIndex(void) const
getTexcoordIndex() returns the previous value set by setTexcoordIndex().
void setTexcoordRect(Real u0, Real v0, Real u1, Real v1)
setTexcoordRect() sets the individual texture coordinate rect of this billboard will use when renderi...
const Radian & getRotation(void) const
Get the rotation of the billboard.
Real getOwnWidth(void) const
Retrieves the billboard's personal width, if hasOwnDimensions is true.
FloatRect mTexcoordRect
Index into the BillboardSet array of texture coordinates.
void _notifyOwner(BillboardSet *owner)
Internal method for notifying the billboard of it's owner.
const ColourValue & getColour(void) const
Gets the colour of this billboard.
void setRotation(const Radian &rotation)
Set the rotation of the billboard.
void setColour(const ColourValue &colour)
Sets the colour of this billboard.
Real mWidth
Individual texture coordinates.
BillboardSet * mParentSet
const FloatRect & getTexcoordRect(void) const
getTexcoordRect() returns the previous value set by setTexcoordRect().
void setDimensions(Real width, Real height)
Sets the width and height for this billboard.
const Vector3 & getPosition(void) const
Get the position of the billboard.
void resetDimensions(void)
Resets this Billboard to use the parent BillboardSet's dimensions instead of it's own.
void setTexcoordIndex(uint16 texcoordIndex)
setTexcoordIndex() sets which texture coordinate rect this billboard will use when rendering.
void setPosition(const Vector3 &position)
Set the position of the billboard.
ColourValue mColour
bool hasOwnDimensions(void) const
Returns true if this billboard deviates from the BillboardSet's default dimensions (i....
Billboard(const Vector3 &position, BillboardSet *owner, const ColourValue &colour=ColourValue::White)
Normal constructor as called by BillboardSet.
Class representing colour.
Wrapper class which indicates a given angle value is in Radians.
Definition OgreMath.h:48
Reference-counted shared pointer, used for objects where implicit destruction is required.
Standard 3-dimensional vector.
Definition OgreVector3.h:52