Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Ogre::Billboard Class Reference

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

#include <OgreBillboard.h>

Inheritance diagram for Ogre::Billboard:

Ogre::Particle List of all members.

Public Methods

 Billboard ()
 Default constructor. More...

 ~Billboard ()
 Default destructor. More...

 Billboard (const Vector3 &position, BillboardSet *owner, const ColourValue &colour=ColourValue::White)
 Normal constructor as called by BillboardSet. More...

void setPosition (const Vector3 &position)
 Set the position of the billboard. More...

void setPosition (Real x, Real y, Real z)
 Set the position of the billboard. More...

const Vector3getPosition (void) const
 Get the position of the billboard. More...

void setDimensions (Real width, Real height)
 Sets the width and height for this billboard. More...

void setColour (const ColourValue &colour)
 Sets the colour of this billboard. More...

const ColourValuegetColour (void) const
 Gets the colour of this billboard. More...

bool hasOwnDimensions (void) const
 Returns true if this billboard deviates from the BillboardSet's default dimensions (i.e. More...

Real getOwnWidth (void)
 Retrieves the billboard's personal width, if hasOwnDimensions is true. More...

Real getOwnHeight (void)
 Retrieves the billboard's personal width, if hasOwnDimensions is true. More...

void _notifyOwner (BillboardSet *owner)
 Internal method for notifying the billboard of it's owner. More...


Public Attributes

Vector3 mPosition
Vector3 mDirection
BillboardSetmParentSet
ColourValue mColour

Protected Attributes

bool mOwnDimensions
Real mWidth
Real mHeight

Friends

class BillboardSet

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:
BollboardSet


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   
 

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

Real Ogre::Billboard::getOwnWidth void   
 

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.

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

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 irresective 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.


Friends And Related Function Documentation

friend class BillboardSet [friend]
 


Member Data Documentation

ColourValue Ogre::Billboard::mColour
 

Vector3 Ogre::Billboard::mDirection
 

Real Ogre::Billboard::mHeight [protected]
 

bool Ogre::Billboard::mOwnDimensions [protected]
 

BillboardSet* Ogre::Billboard::mParentSet
 

Vector3 Ogre::Billboard::mPosition
 

Real Ogre::Billboard::mWidth [protected]
 

Copyright © 2002 by The OGRE Team