OGRE: Ogre::v1::Billboard Class Reference

| OGRE 2.2.4 Object-Oriented Graphics Rendering Engine

Public Member Functions | Public Attributes | Friends | List of all members
Ogre::v1::Billboard Class Reference
Core » Effects

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

`#include <OgreBillboard.h>`

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

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

## Public Attributes
ColourValue | mColour
Vector3 | mDirection
| Normalised direction vector. More...
BillboardSet * | mParentSet
Vector3 | mPosition
Radian | mRotation

## Friends
class | BillboardParticleRenderer
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
  BillboardSet

## Constructor & Destructor Documentation

## ◆ Billboard() [1/2]

Ogre::v1::Billboard::Billboard | ( |  | ) |

Default constructor.

## ◆ ~Billboard()

Ogre::v1::Billboard::~Billboard | ( |  | ) |

Default destructor.

## ◆ Billboard() [2/2]

Ogre::v1::Billboard::Billboard | ( | const Vector3 & | position,
|  | BillboardSet * | owner,
|  | const ColourValue & | colour = `ColourValue::White`
| ) |  |

Normal constructor as called by BillboardSet.

## Member Function Documentation

## ◆ _notifyOwner()

void Ogre::v1::Billboard::_notifyOwner | ( | BillboardSet * | owner | ) |

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

## ◆ getColour()

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

Gets the colour of this billboard.

## ◆ getOwnHeight()

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

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

## ◆ getOwnWidth()

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

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

## ◆ getPosition()

const Vector3& Ogre::v1::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.

## ◆ getRotation()

const Radian& Ogre::v1::Billboard::getRotation | ( | void |  | ) | const
| inline

Get the rotation of the billboard.

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

## ◆ getTexcoordIndex()

uint16 Ogre::v1::Billboard::getTexcoordIndex | ( | void |  | ) | const
| inline

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.

## ◆ getTexcoordRect()

const FloatRect& Ogre::v1::Billboard::getTexcoordRect | ( | void |  | ) | const
| inline

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

Remarks
  This value is useful only when isUseTexcoordRect returns true.

## ◆ hasOwnDimensions()

bool Ogre::v1::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

## ◆ isUseTexcoordRect()

bool Ogre::v1::Billboard::isUseTexcoordRect | ( | void |  | ) | const
| inline

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()

## ◆ operator delete() [1/3]

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr | ) |
| inlineinherited

## ◆ operator delete() [2/3]

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr,
|  | const char * | ,
|  | int | ,
|  | const char * |
| ) |  |
| inlineinherited

## ◆ operator delete() [3/3]

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr,
|  | void * |
| ) |  |
| inlineinherited

## ◆ operator delete[]() [1/2]

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete[] | ( | void * | ptr | ) |
| inlineinherited

## ◆ operator delete[]() [2/2]

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete[] | ( | void * | ptr,
|  | const char * | ,
|  | int | ,
|  | const char * |
| ) |  |
| inlineinherited

## ◆ operator new() [1/3]

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz | ) |
| inlineinherited

## ◆ operator new() [2/3]

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz,
|  | const char * | file,
|  | int | line,
|  | const char * | func
| ) |  |
| inlineinherited

operator new, with debug line info

## ◆ operator new() [3/3]

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz,
|  | void * | ptr
| ) |  |
| inlineinherited

placement operator new

## ◆ operator new[]() [1/2]

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new[] | ( | size_t | sz | ) |
| inlineinherited

## ◆ operator new[]() [2/2]

template<class Alloc >

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

array operator new, with debug line info

## ◆ resetDimensions()

void Ogre::v1::Billboard::resetDimensions | ( | void |  | ) |
| inline

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

## ◆ setColour()

void Ogre::v1::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.

## ◆ setDimensions()

void Ogre::v1::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.

## ◆ setPosition() [1/2]

void Ogre::v1::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.

## ◆ setPosition() [2/2]

void Ogre::v1::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.

## ◆ setRotation()

void Ogre::v1::Billboard::setRotation | ( | const Radian & | rotation | ) |

Set the rotation of the billboard.

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

## ◆ setTexcoordIndex()

void Ogre::v1::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()

## ◆ setTexcoordRect() [1/2]

void Ogre::v1::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.

## ◆ setTexcoordRect() [2/2]

void Ogre::v1::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.

## Friends And Related Function Documentation

## ◆ BillboardParticleRenderer

friend class BillboardParticleRenderer
| friend

## ◆ BillboardSet

friend class BillboardSet
| friend

## Member Data Documentation

## ◆ mColour

ColourValue Ogre::v1::Billboard::mColour

## ◆ mDirection

Vector3 Ogre::v1::Billboard::mDirection

Normalised direction vector.

## ◆ mParentSet

BillboardSet* Ogre::v1::Billboard::mParentSet

## ◆ mPosition

Vector3 Ogre::v1::Billboard::mPosition

## ◆ mRotation

Radian Ogre::v1::Billboard::mRotation

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

- OgreBillboard.h