Ogre::Billboard Class Reference
[Effects]

A billboard is a primitive which always faces the camera in every frame. More...

#include <OgreBillboard.h>

Inheritance diagram for Ogre::Billboard:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 Billboard ()
 Default constructor.
 ~Billboard ()
 Default destructor.
 Billboard (const Vector3 &position, BillboardSet *owner, const ColourValue &colour=ColourValue::White)
 Normal constructor as called by BillboardSet.
const RadiangetRotation (void) const
 Get the rotation of the billboard.
void setRotation (const Radian &rotation)
 Set the rotation of the billboard.
void setPosition (const Vector3 &position)
 Set the position of the billboard.
void setPosition (Real x, Real y, Real z)
 Set the position of the billboard.
const Vector3getPosition (void) const
 Get the position of the billboard.
void setDimensions (Real width, Real height)
 Sets the width and height for this billboard.
void resetDimensions (void)
 Resets this Billboard to use the parent BillboardSet's dimensions instead of it's own.
void setColour (const ColourValue &colour)
 Sets the colour of this billboard.
const ColourValuegetColour (void) const
 Gets the colour of this billboard.
bool hasOwnDimensions (void) const
 Returns true if this billboard deviates from the BillboardSet's default dimensions (i.e.
Real getOwnWidth (void) const
 Retrieves the billboard's personal width, if hasOwnDimensions is true.
Real getOwnHeight (void) const
 Retrieves the billboard's personal width, if hasOwnDimensions is true.
void _notifyOwner (BillboardSet *owner)
 Internal method for notifying the billboard of it's owner.
bool isUseTexcoordRect (void) const
 Returns true if this billboard use individual texture coordinate rect (i.e.
void setTexcoordIndex (uint16 texcoordIndex)
 setTexcoordIndex() sets which texture coordinate rect this billboard will use when rendering.
uint16 getTexcoordIndex (void) const
 getTexcoordIndex() returns the previous value set by setTexcoordIndex().
void setTexcoordRect (const FloatRect &texcoordRect)
 setTexcoordRect() sets the individual texture coordinate rect of this billboard will use when rendering.
void setTexcoordRect (Real u0, Real v0, Real u1, Real v1)
 setTexcoordRect() sets the individual texture coordinate rect of this billboard will use when rendering.
const FloatRectgetTexcoordRect (void) const
 getTexcoordRect() returns the previous value set by setTexcoordRect().
void * operator new (size_t sz, const char *file, int line, const char *func)
 operator new, with debug line info
void * operator new (size_t sz)
void * operator new (size_t sz, void *ptr)
 placement operator new
void * operator new[] (size_t sz, const char *file, int line, const char *func)
 array operator new, with debug line info
void * operator new[] (size_t sz)
void operator delete (void *ptr)
void operator delete (void *ptr, void *)
void operator delete (void *ptr, const char *, int, const char *)
void operator delete[] (void *ptr)
void operator delete[] (void *ptr, const char *, int, const char *)

Public Attributes

Vector3 mPosition
Vector3 mDirection
BillboardSetmParentSet
ColourValue mColour
Radian mRotation

Protected Attributes

bool mOwnDimensions
bool mUseTexcoordRect
uint16 mTexcoordIndex
FloatRect mTexcoordRect
Real mWidth
Real mHeight

Friends

class BillboardSet
class BillboardParticleRenderer

Detailed Description

A billboard is a primitive which always faces the camera in every frame.

Remarks:
Billboards can be used for special effects or some other trickery which requires the triangles to always facing the camera no matter where it is. Ogre groups billboards into sets for efficiency, so you should never create a billboard on it's own (it's ok to have a set of one if you need it).
Billboards have their geometry generated every frame depending on where the camera is. It is most beneficial for all billboards in a set to be identically sized since Ogre can take advantage of this and save some calculations - useful when you have sets of hundreds of billboards as is possible with special effects. You can deviate from this if you wish (example: a smoke effect would probably have smoke puffs expanding as they rise, so each billboard will legitimately have it's own size) but be aware the extra overhead this brings and try to avoid it if you can.
Billboards are just the mechanism for rendering a range of effects such as particles. It is other classes which use billboards to create their individual effects, so the methods here are quite generic.
See also:
BillboardSet

Definition at line 66 of file OgreBillboard.h.


Constructor & Destructor Documentation

Ogre::Billboard::Billboard (  ) 

Default constructor.

Ogre::Billboard::~Billboard (  ) 

Default destructor.

Ogre::Billboard::Billboard ( const Vector3 position,
BillboardSet owner,
const ColourValue colour = ColourValue::White 
)

Normal constructor as called by BillboardSet.


Member Function Documentation

void Ogre::Billboard::_notifyOwner ( BillboardSet owner  ) 

Internal method for notifying the billboard of it's owner.

const ColourValue& Ogre::Billboard::getColour ( void   )  const

Gets the colour of this billboard.

Real Ogre::Billboard::getOwnHeight ( void   )  const

Retrieves the billboard's personal width, if hasOwnDimensions is true.

Real Ogre::Billboard::getOwnWidth ( void   )  const

Retrieves the billboard's personal width, if hasOwnDimensions is true.

const Vector3& Ogre::Billboard::getPosition ( void   )  const

Get the position of the billboard.

Remarks:
This position is relative to a point on the quad which is the billboard. Depending on the BillboardSet, this may be the center of the quad, the top-left etc. See BillboardSet::setBillboardOrigin for more info.
const Radian& Ogre::Billboard::getRotation ( void   )  const

Get the rotation of the billboard.

Remarks:
This rotation is relative to the center of the billboard.

Definition at line 103 of file OgreBillboard.h.

uint16 Ogre::Billboard::getTexcoordIndex ( void   )  const

getTexcoordIndex() returns the previous value set by setTexcoordIndex().

The default value is 0, which is always a valid texture coordinate set.

Remarks:
This value is useful only when isUseTexcoordRect return false.

Definition at line 197 of file OgreBillboard.h.

const FloatRect& Ogre::Billboard::getTexcoordRect ( void   )  const

getTexcoordRect() returns the previous value set by setTexcoordRect().

Remarks:
This value is useful only when isUseTexcoordRect return true.

Definition at line 217 of file OgreBillboard.h.

bool Ogre::Billboard::hasOwnDimensions ( void   )  const

Returns true if this billboard deviates from the BillboardSet's default dimensions (i.e.

if the Billboard::setDimensions method has been called for this instance).

See also:
Billboard::setDimensions
bool Ogre::Billboard::isUseTexcoordRect ( void   )  const

Returns true if this billboard use individual texture coordinate rect (i.e.

if the Billboard::setTexcoordRect method has been called for this instance), or returns false if use texture coordinates defined in the parent BillboardSet's texture coordinates array (i.e. if the Billboard::setTexcoordIndex method has been called for this instance).

See also:
Billboard::setTexcoordIndex() Billboard::setTexcoordRect()

Definition at line 181 of file OgreBillboard.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr,
const char *  ,
int  ,
const char *   
) [inherited]

Definition at line 107 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr,
void *   
) [inherited]

Definition at line 101 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr  )  [inherited]

Definition at line 95 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete[] ( void *  ptr,
const char *  ,
int  ,
const char *   
) [inherited]

Definition at line 118 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete[] ( void *  ptr  )  [inherited]

Definition at line 112 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz,
void *  ptr 
) [inherited]

placement operator new

Definition at line 78 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz  )  [inherited]

Definition at line 72 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz,
const char *  file,
int  line,
const char *  func 
) [inherited]

operator new, with debug line info

Definition at line 67 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new[] ( size_t  sz  )  [inherited]

Definition at line 90 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new[] ( size_t  sz,
const char *  file,
int  line,
const char *  func 
) [inherited]

array operator new, with debug line info

Definition at line 85 of file OgreMemoryAllocatedObject.h.

void Ogre::Billboard::resetDimensions ( void   ) 

Resets this Billboard to use the parent BillboardSet's dimensions instead of it's own.

Definition at line 142 of file OgreBillboard.h.

void Ogre::Billboard::setColour ( const ColourValue colour  ) 

Sets the colour of this billboard.

Remarks:
Billboards can be tinted based on a base colour. This allows variations in colour irrespective of the base colour of the material allowing more varied billboards. The default colour is white. The tinting is effected using vertex colours.
void Ogre::Billboard::setDimensions ( Real  width,
Real  height 
)

Sets the width and height for this billboard.

Remarks:
Note that it is most efficient for every billboard in a BillboardSet to have the same dimensions. If you choose to alter the dimensions of an individual billboard the set will be less efficient. Do not call this method unless you really need to have different billboard dimensions within the same set. Otherwise just call the BillboardSet::setDefaultDimensions method instead.
void Ogre::Billboard::setPosition ( Real  x,
Real  y,
Real  z 
)

Set the position of the billboard.

Remarks:
This position is relative to a point on the quad which is the billboard. Depending on the BillboardSet, this may be the center of the quad, the top-left etc. See BillboardSet::setBillboardOrigin for more info.
void Ogre::Billboard::setPosition ( const Vector3 position  ) 

Set the position of the billboard.

Remarks:
This position is relative to a point on the quad which is the billboard. Depending on the BillboardSet, this may be the center of the quad, the top-left etc. See BillboardSet::setBillboardOrigin for more info.
void Ogre::Billboard::setRotation ( const Radian rotation  ) 

Set the rotation of the billboard.

Remarks:
This rotation is relative to the center of the billboard.
void Ogre::Billboard::setTexcoordIndex ( uint16  texcoordIndex  ) 

setTexcoordIndex() sets which texture coordinate rect this billboard will use when rendering.

The parent billboard set may contain more than one, in which case a billboard can be textured with different pieces of a larger texture sheet very efficiently.

See also:
BillboardSet::setTextureCoords()
void Ogre::Billboard::setTexcoordRect ( Real  u0,
Real  v0,
Real  u1,
Real  v1 
)

setTexcoordRect() sets the individual texture coordinate rect of this billboard will use when rendering.

The parent billboard set may contain more than one, in which case a billboard can be textured with different pieces of a larger texture sheet very efficiently.

void Ogre::Billboard::setTexcoordRect ( const FloatRect texcoordRect  ) 

setTexcoordRect() sets the individual texture coordinate rect of this billboard will use when rendering.

The parent billboard set may contain more than one, in which case a billboard can be textured with different pieces of a larger texture sheet very efficiently.


Friends And Related Function Documentation

friend class BillboardParticleRenderer [friend]

Definition at line 69 of file OgreBillboard.h.

friend class BillboardSet [friend]

Definition at line 68 of file OgreBillboard.h.


Member Data Documentation

Definition at line 84 of file OgreBillboard.h.

Definition at line 82 of file OgreBillboard.h.

Definition at line 76 of file OgreBillboard.h.

Definition at line 71 of file OgreBillboard.h.

Definition at line 83 of file OgreBillboard.h.

Definition at line 80 of file OgreBillboard.h.

Definition at line 85 of file OgreBillboard.h.

Definition at line 73 of file OgreBillboard.h.

Definition at line 74 of file OgreBillboard.h.

Definition at line 72 of file OgreBillboard.h.

Definition at line 75 of file OgreBillboard.h.


The documentation for this class was generated from the following file:

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 Fri May 25 23:37:08 2012