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

Ogre::BillboardSet Class Reference

A collection of billboards (faces which are always facing the camera) with the same (default) dimensions, material and which are fairly close proximity to each other. More...

#include <OgreBillboardSet.h>

Inheritance diagram for Ogre::BillboardSet:

Ogre::StringInterface Ogre::MovableObject Ogre::Renderable Ogre::ParticleSystem List of all members.

Public Methods

 BillboardSet (const String &name, unsigned int poolSize=20)
 Usual constructor - this is called by the SceneManager. More...

virtual ~BillboardSet ()
BillboardcreateBillboard (const Vector3 &position, const ColourValue &colour=ColourValue::White)
 Creates a new billboard and adds it to this set. More...

BillboardcreateBillboard (Real x, Real y, Real z, const ColourValue &colour=ColourValue::White)
 Creates a new billboard and adds it to this set. More...

virtual int getNumBillboards (void) const
 Returns the number of active billboards which currently make up this set. More...

virtual void setAutoextend (bool autoextend)
 Tells the set whether to allow automatic extension of the pool of billboards. More...

virtual bool getAutoextend (void) const
 Returns true if the billboard pool automatically extends. More...

virtual void setPoolSize (unsigned int size)
 Adjusts the size of the pool of billboards available in this set. More...

virtual unsigned int getPoolSize (void) const
 Returns the current size of the billboard pool. More...

virtual void clear ()
 Empties this set of all billboards. More...

virtual BillboardgetBillboard (unsigned int index) const
 Returns a pointer to the billboard at the supplied index. More...

virtual void removeBillboard (unsigned int index)
 Removes the billboard at the supplied index. More...

virtual void removeBillboard (Billboard *pBill)
 Removes a billboard from the set. More...

virtual void setBillboardOrigin (BillboardOrigin origin)
 Sets the point which acts as the origin point for all billboards in this set. More...

virtual BillboardOrigin getBillboardOrigin (void) const
 Gets the point which acts as the origin point for all billboards in this set. More...

virtual void setDefaultDimensions (Real width, Real height)
 Sets the default dimensions of the billboards in this set. More...

virtual void setDefaultWidth (Real width)
 See setDefaultDimensions - this sets 1 component individually. More...

virtual Real getDefaultWidth (void)
 See setDefaultDimensions - this gets 1 component individually. More...

virtual void setDefaultHeight (Real height)
 See setDefaultDimensions - this sets 1 component individually. More...

virtual Real getDefaultHeight (void)
 See setDefaultDimensions - this gets 1 component individually. More...

virtual void setMaterialName (const String &name)
 Sets the name of the material to be used for this billboard set. More...

virtual const StringgetMaterialName (void) const
 Sets the name of the material to be used for this billboard set. More...

virtual void _notifyCurrentCamera (Camera *cam)
 Overridden from MovableObject. More...

virtual const AxisAlignedBoxgetBoundingBox (void) const
 Overridden from MovableObject. More...

virtual void _updateRenderQueue (RenderQueue *queue)
 Overridden from MovableObject. More...

virtual MaterialgetMaterial (void) const
 Overridden from MovableObject. More...

virtual void getRenderOperation (RenderOperation &rend)
 Overridden from MovableObject. More...

virtual void getWorldTransforms (Matrix4 *xform)
 Overridden from MovableObject. More...

virtual void _notifyBillboardResized (void)
 Internal callback used by Billboards to notify their parent that they have been resized. More...

virtual bool getCullIndividually (void)
 Returns whether or not billbards in this are tested individually for culling. More...

virtual void setCullIndividually (bool cullIndividual)
 Sets whether culling tests billboards in this individually as well as in a group. More...

virtual void setBillboardType (BillboardType bbt)
 Sets the type of billboard to render. More...

virtual BillboardType getBillboardType (void)
 Returns the billboard type in use. More...

virtual void setCommonDirection (const Vector3 &vec)
 Use this to specify the common direction given to billboards of type BBT_ORIENTED_COMMON. More...

virtual Vector3 getCommonDirection (void)
 Gets the common direction for all billboards (BBT_ORIENTED_COMMON). More...

virtual const StringgetName (void) const
 Overridden from MovableObject. More...

virtual const String getMovableType (void) const
 Overridden from MovableObject. More...

Real getSquaredViewDepth (const Camera *cam) const
 Overridden, see Renderable. More...

virtual void _updateBounds (void)
 Update the bounds of the billboardset. More...

ParamDictionarygetParamDictionary (void)
 Retrieves the parameter dictionary for this class. More...

const ParameterListgetParameters (void)
 Retrieves a list of parameters valid for this object. More...

virtual bool setParameter (const String &name, const String &value)
 Generic parameter setting method. More...

virtual String getParameter (const String &name)
 Generic parameter retrieval method. More...

virtual void copyParametersTo (StringInterface *dest)
 Method for copying this object's parameters to another object. More...

virtual SceneNodegetParentNode (void)
 Returns the node to which this object is attached. More...

virtual void _notifyAttached (SceneNode *parent)
 Internal method called to notify the object that it has been attached to a node. More...

virtual bool isAttached (void) const
 Returns true if this object is attached to a SceneNode. More...

virtual void setVisible (bool visible)
 Tells this object whether to be visible or not, if it has a renderable component. More...

virtual bool isVisible (void) const
 Returns whether or not this object is supposed to be visible or not. More...

virtual void setUserObject (UserDefinedObject *obj)
 Call this to associate your own custom user object instance with this MovableObject. More...

virtual UserDefinedObjectgetUserObject (void)
 Retrieves a pointer to a custom application object associated with this movable by an earlier call to setUserObject. More...

virtual void setRenderQueueGroup (RenderQueueGroupID queueID)
 Sets the render queue group this entity will be rendered through. More...

virtual RenderQueueGroupID getRenderQueueGroup (void)
 Gets the queue group for this entity, see setRenderQueueGroup for full details. More...

virtual unsigned short getNumWorldTransforms (void)
 Returns the number of world transform matrices this renderable requires. More...

virtual bool useIdentityProjection (void)
 Returns whether or not to use an 'identity' projection. More...

virtual bool useIdentityView (void)
 Returns whether or not to use an 'identity' projection. More...

virtual SceneDetailLevel getRenderDetail ()
 Returns the preferred rasterisation mode of this renderable. More...


Protected Types

typedef std::list< Billboard * > ActiveBillboardList
typedef std::deque< Billboard * > FreeBillboardQueue
typedef std::vector< Billboard * > BillboardPool

Protected Methods

 BillboardSet ()
 Private constructor (instances cannot be created directly). More...

bool billboardVisible (Camera *cam, ActiveBillboardList::iterator bill)
 Internal method for culling individual billboards. More...

virtual void increasePool (unsigned int size)
 Internal method for increasing pool size. More...

virtual void genBillboardAxes (Camera &cam, Vector3 *pX, Vector3 *pY, const Billboard *pBill=0)
 Internal method for generating billboard corners. More...

void getParametricOffsets (Real &left, Real &right, Real &top, Real &bottom)
 Internal method, generates parametric offsets based on origin. More...

void genVertices (Real **pPos, RGBA **pCol, const Vector3 *offsets, const Billboard *pBillboard)
 Internal method for generating vertex data. More...

void genVertOffsets (Real inleft, Real inright, Real intop, Real inbottom, Real width, Real height, const Vector3 &x, const Vector3 &y, Vector3 *pDestVec)
 Internal method generates vertex offsets. More...

bool createParamDictionary (const String &className)
 Internal method for creating a parameter dictionary for the class, if it does not already exist. More...


Protected Attributes

String mName
 Name of the entity; used for location in the scene. More...

AxisAlignedBox mAABB
 Bounds of all billboards in this set. More...

BillboardOrigin mOriginType
 Origin of each billboard. More...

Real mDefaultWidth
 Default width of each billboard. More...

Real mDefaultHeight
 Default height of each billboard. More...

String mMaterialName
 Name of the material to use. More...

MaterialmpMaterial
 Pointer to the material to use. More...

bool mAllDefaultSize
 True if no billboards in this set have been resized - greater efficiency. More...

bool mAutoExtendPool
 Flag indicating whether to autoextend pool. More...

ActiveBillboardList mActiveBillboards
 Active billboard list. More...

FreeBillboardQueue mFreeBillboards
 Free billboard queue. More...

BillboardPool mBillboardPool
 Pool of billboard instances for use and reuse in the active billboard list. More...

RealmpPositions
 The vertex position data for all billboards in this set. More...

RGBAmpColours
 The vertex colour data for all billboards in this set. More...

RealmpTexCoords
 The texture coordinates for all billboards in this set. More...

unsigned short * mpIndexes
 The vertex index data for all billboards in this set (1 set only). More...

bool mCullIndividual
 Flag indicating whether each billboard should be culled separately (default: false). More...

BillboardType mBillboardType
 The type of billboard to render. More...

Vector3 mCommonDirection
 Common direction for billboards of type BBT_ORIENTED_COMMON. More...

unsigned short mNumVisibleBillboards
String mParamDictName
 Class name for this instance to be used as a lookup (must be initialised by subclasses). More...

SceneNodemParentNode
 node to which this object is attached. More...

bool mVisible
 Is this object visible? More...

UserDefinedObjectmUserObject
 User defined object which is linked to this object. More...

RenderQueueGroupID mRenderQueueID
 The render queue to use when rendering this object. More...


Static Protected Attributes

String msMovableType = "BillboardSet"
 Shared class-level name for Movable type. More...

ParamDictionaryMap msDictionary
 Dictionary of parameters. More...


Detailed Description

A collection of billboards (faces which are always facing the camera) with the same (default) dimensions, material and which are fairly close proximity to each other.

Remarks:
Billboards are rectangles made up of 2 tris which are always facing the camera. They are typically used for special effects like particles. This class collects together a set of billboards with the same (default) dimensions, material and relative locality in order to process them more efficiently. The entire set of billboards will be culled as a whole (by default, although this can be changed if you want a large set of billboards which are spread out and you want them culled individually), individual Billboards have locations which are relative to the set (which itself derives it's position from the SceneNode it is attached to since it is a MoveableObject), they will be rendered as a single rendering operation, and some calculations will be sped up by the fact that they use the same dimensions so some workings can be reused.

A BillboardSet can be created using the SceneManager::createBillboardSet method. They can also be used internally by other classes to create effects.


Member Typedef Documentation

typedef std::list<Billboard*> Ogre::BillboardSet::ActiveBillboardList [protected]
 

typedef std::vector<Billboard*> Ogre::BillboardSet::BillboardPool [protected]
 

typedef std::deque<Billboard*> Ogre::BillboardSet::FreeBillboardQueue [protected]
 


Constructor & Destructor Documentation

Ogre::BillboardSet::BillboardSet   [protected]
 

Private constructor (instances cannot be created directly).

Ogre::BillboardSet::BillboardSet const String   name,
unsigned int    poolSize = 20
 

Usual constructor - this is called by the SceneManager.

Parameters:
name  The name to give the billboard set (must be unique)
poolSize  The initial size of the billboard pool. Estimate of the number of billboards which will be required, and pass it using this parameter. The set will preallocate this number to avoid memory fragmentation. The default behaviour once this pool has run out is to double it.
See also:
BillboardSet::setAutoextend

Ogre::BillboardSet::~BillboardSet   [virtual]
 


Member Function Documentation

void Ogre::MovableObject::_notifyAttached SceneNode   parent [virtual, inherited]
 

Internal method called to notify the object that it has been attached to a node.

Reimplemented in Ogre::SimpleRenderable.

void Ogre::BillboardSet::_notifyBillboardResized void    [virtual]
 

Internal callback used by Billboards to notify their parent that they have been resized.

void Ogre::BillboardSet::_notifyCurrentCamera Camera   cam [virtual]
 

Overridden from MovableObject.

See also:
MovableObject

Implements Ogre::MovableObject.

void Ogre::BillboardSet::_updateBounds void    [virtual]
 

Update the bounds of the billboardset.

Reimplemented in Ogre::ParticleSystem.

void Ogre::BillboardSet::_updateRenderQueue RenderQueue   queue [virtual]
 

Overridden from MovableObject.

See also:
MovableObject

Implements Ogre::MovableObject.

bool Ogre::BillboardSet::billboardVisible Camera   cam,
ActiveBillboardList::iterator    bill
[inline, protected]
 

Internal method for culling individual billboards.

void Ogre::BillboardSet::clear   [virtual]
 

Empties this set of all billboards.

virtual void Ogre::StringInterface::copyParametersTo StringInterface   dest [inline, virtual, inherited]
 

Method for copying this object's parameters to another object.

Remarks:
This method takes the values of all the object's parameters and tries to set the same values on the destination object. This provides a completely type independent way to copy parameters to other objects. Note that because of the String manipulation involved, this should not be regarded as an efficient process and should be saved for times outside of the rendering loop.

Any unrecognised parameters will be ignored as with setParameter method.

Parameters:
dest  Pointer to object to have it's parameters set the same as this object.

Billboard * Ogre::BillboardSet::createBillboard Real    x,
Real    y,
Real    z,
const ColourValue   colour = ColourValue::White
 

Creates a new billboard and adds it to this set.

Remarks:
Behaviour once the billboard pool has been exhausted depends on the BillboardSet::setAutoextendPool option.
Parameters:
x 
y 
z  The position of the new billboard realtive to the certer of the set
colour  Optional base colour of the billboard.
Returns:
On success, a pointer to a newly created Billboard is returned.

On failiure (i.e. no more space and can't autoextend), NULL is returned.

See also:
BillboardSet::setAutoextend

Billboard * Ogre::BillboardSet::createBillboard const Vector3   position,
const ColourValue   colour = ColourValue::White
 

Creates a new billboard and adds it to this set.

Remarks:
Behaviour once the billboard pool has been exhausted depends on the BillboardSet::setAutoextendPool option.
Parameters:
position  The position of the new billboard realtive to the certer of the set
colour  Optional base colour of the billboard.
Returns:
On success, a pointer to a newly created Billboard is returned.

On failiure (i.e. no more space and can't autoextend), NULL is returned.

See also:
BillboardSet::setAutoextend

bool Ogre::StringInterface::createParamDictionary const String   className [inline, protected, inherited]
 

Internal method for creating a parameter dictionary for the class, if it does not already exist.

Remarks:
This method will check to see if a parameter dictionary exist for this class yet, and if not will create one. NB you must supply the name of the class (RTTI is not used or performance).
Parameters:
className  the name of the class using the dictionary
Returns:
true if a new dictionary was created, false if it was already there

void Ogre::BillboardSet::genBillboardAxes Camera   cam,
Vector3   pX,
Vector3   pY,
const Billboard   pBill = 0
[protected, virtual]
 

Internal method for generating billboard corners.

Remarks:
Optional parameter pBill is only present for type BBT_ORIENTED_SELF

Reimplemented in Ogre::ParticleSystem.

void Ogre::BillboardSet::genVertices Real **    pPos,
RGBA **    pCol,
const Vector3   offsets,
const Billboard   pBillboard
[inline, protected]
 

Internal method for generating vertex data.

Parameters:
pPos  Pointer to pointer to vertex positions, will be updated
pCol  Pointer to pointer to vertex colours, will be updated
offsets  Array of 4 Vector3 offsets
pBillboard  Pointer to billboard
Returns:
new vertex index

void Ogre::BillboardSet::genVertOffsets Real    inleft,
Real    inright,
Real    intop,
Real    inbottom,
Real    width,
Real    height,
const Vector3   x,
const Vector3   y,
Vector3   pDestVec
[inline, protected]
 

Internal method generates vertex offsets.

Remarks:
Takes in parametric offsets as generated from getParametericOffsets, width and height values and billboard x and y axes as generated from genBillboardAxes. Fills output array of 4 vectors with vector offsets from origin for left-top, right-top, left-bottom, right-bottom corners.

bool Ogre::BillboardSet::getAutoextend void    const [virtual]
 

Returns true if the billboard pool automatically extends.

See also:
BillboardSet::setAutoextend

Billboard * Ogre::BillboardSet::getBillboard unsigned int    index const [virtual]
 

Returns a pointer to the billboard at the supplied index.

Note:
This method requires linear time since the billboard list is a linked list.
Parameters:
index  The index of the billboard that is requested.
Returns:
On success, a valid pointer to the requested billboard is returned.

On failiure, NULL is returned.

BillboardOrigin Ogre::BillboardSet::getBillboardOrigin void    const [virtual]
 

Gets the point which acts as the origin point for all billboards in this set.

Returns:
A member of the BillboardOrigin enum specifying the origin for all the billboards in this set.

BillboardType Ogre::BillboardSet::getBillboardType void    [virtual]
 

Returns the billboard type in use.

const AxisAlignedBox & Ogre::BillboardSet::getBoundingBox void    const [virtual]
 

Overridden from MovableObject.

See also:
MovableObject

Implements Ogre::MovableObject.

Vector3 Ogre::BillboardSet::getCommonDirection void    [virtual]
 

Gets the common direction for all billboards (BBT_ORIENTED_COMMON).

bool Ogre::BillboardSet::getCullIndividually void    [virtual]
 

Returns whether or not billbards in this are tested individually for culling.

Real Ogre::BillboardSet::getDefaultHeight void    [virtual]
 

See setDefaultDimensions - this gets 1 component individually.

Real Ogre::BillboardSet::getDefaultWidth void    [virtual]
 

See setDefaultDimensions - this gets 1 component individually.

Material * Ogre::BillboardSet::getMaterial void    const [virtual]
 

Overridden from MovableObject.

See also:
MovableObject

Implements Ogre::Renderable.

const String & Ogre::BillboardSet::getMaterialName void    const [virtual]
 

Sets the name of the material to be used for this billboard set.

Returns:
The name of the material that is used for this set.

const String Ogre::BillboardSet::getMovableType void    const [virtual]
 

Overridden from MovableObject.

Implements Ogre::MovableObject.

const String & Ogre::BillboardSet::getName void    const [virtual]
 

Overridden from MovableObject.

Implements Ogre::MovableObject.

Reimplemented in Ogre::ParticleSystem.

int Ogre::BillboardSet::getNumBillboards void    const [virtual]
 

Returns the number of active billboards which currently make up this set.

virtual unsigned short Ogre::Renderable::getNumWorldTransforms void    [inline, virtual, inherited]
 

Returns the number of world transform matrices this renderable requires.

Remarks:
When a renderable uses vertex blending, it uses multiple world matrices instead of a single one. Each vertex sent to the pipeline can reference one or more matrices in this list with given weights. If a renderable does not use vertex blending this method returns 1, which is the default for simplicity.

Reimplemented in Ogre::SubEntity.

ParamDictionary* Ogre::StringInterface::getParamDictionary void    [inline, inherited]
 

Retrieves the parameter dictionary for this class.

Remarks:
Only valid to call this after createParamDictionary.
Returns:
Pointer to ParamDictionary shared by all instances of this class which you can add parameters to, retrieve parameters etc.

virtual String Ogre::StringInterface::getParameter const String   name [inline, virtual, inherited]
 

Generic parameter retrieval method.

Remarks:
Call this method with the name of a parameter to retrieve a string-format value of the parameter in question. If in doubt, check the parameter definition in the list returned from getParameters for the type of this parameter. If you like you can use StringConverter to convert this string back into a native type.
Parameters:
name  The name of the parameter to get
Returns:
String value of parameter, blank if not found

const ParameterList& Ogre::StringInterface::getParameters void    [inline, inherited]
 

Retrieves a list of parameters valid for this object.

Returns:
A reference to a static list of ParameterDef objects.

void Ogre::BillboardSet::getParametricOffsets Real   left,
Real   right,
Real   top,
Real   bottom
[inline, protected]
 

Internal method, generates parametric offsets based on origin.

SceneNode * Ogre::MovableObject::getParentNode void    [virtual, inherited]
 

Returns the node to which this object is attached.

Remarks:
An object is not visible in the scene unless attached to a SceneNode.

Attaching an object is done via the SceneNode::attachObject method.

Reimplemented in Ogre::SimpleRenderable.

unsigned int Ogre::BillboardSet::getPoolSize void    const [virtual]
 

Returns the current size of the billboard pool.

Returns:
The current size of the billboard pool.
See also:
BillboardSet::setAutoextend

virtual SceneDetailLevel Ogre::Renderable::getRenderDetail   [inline, virtual, inherited]
 

Returns the preferred rasterisation mode of this renderable.

Reimplemented in Ogre::SubEntity.

void Ogre::BillboardSet::getRenderOperation RenderOperation   rend [virtual]
 

Overridden from MovableObject.

See also:
MovableObject

Implements Ogre::Renderable.

RenderQueueGroupID Ogre::MovableObject::getRenderQueueGroup void    [virtual, inherited]
 

Gets the queue group for this entity, see setRenderQueueGroup for full details.

Real Ogre::BillboardSet::getSquaredViewDepth const Camera   cam const [virtual]
 

Overridden, see Renderable.

Implements Ogre::Renderable.

virtual UserDefinedObject* Ogre::MovableObject::getUserObject void    [inline, virtual, inherited]
 

Retrieves a pointer to a custom application object associated with this movable by an earlier call to setUserObject.

void Ogre::BillboardSet::getWorldTransforms Matrix4   xform [virtual]
 

Overridden from MovableObject.

See also:
MovableObject

Implements Ogre::Renderable.

Reimplemented in Ogre::ParticleSystem.

void Ogre::BillboardSet::increasePool unsigned int    size [protected, virtual]
 

Internal method for increasing pool size.

Reimplemented in Ogre::ParticleSystem.

bool Ogre::MovableObject::isAttached void    const [virtual, inherited]
 

Returns true if this object is attached to a SceneNode.

bool Ogre::MovableObject::isVisible void    const [virtual, inherited]
 

Returns whether or not this object is supposed to be visible or not.

void Ogre::BillboardSet::removeBillboard Billboard   pBill [virtual]
 

Removes a billboard from the set.

Note:
This version is more efficient than removing by index.

void Ogre::BillboardSet::removeBillboard unsigned int    index [virtual]
 

Removes the billboard at the supplied index.

Note:
This method requires linear time since the billboard list is a linked list.

void Ogre::BillboardSet::setAutoextend bool    autoextend [virtual]
 

Tells the set whether to allow automatic extension of the pool of billboards.

Remarks:
A BillboardSet stores a pool of pre-constructed billboards which are used as needed when a new billboard is requested. This allows applications to create / remove billboards efficiently without incurring construction / destruction costs (a must for sets with lots of billboards like particle effects). This method allows you to configure the behaviour when a new billboard is requested but the billboard pool has been exhausted.

The default behaviour is to allow the pool to extend (typically this allocates double the current pool of billboards when the pool is expended), equivalent to calling this method with autoExtend = true. If you set the parameter to false however, any attempt to create a new billboard when the pool has expired will simply fail silently, returning a null pointer.

Parameters:
autoextend  true to double the pool every time it runs out, false to fail silently.

void Ogre::BillboardSet::setBillboardOrigin BillboardOrigin    origin [virtual]
 

Sets the point which acts as the origin point for all billboards in this set.

Remarks:
This setting controls the fine tuning of where a billboard appears in relation to it's position. It could be that a billboard's position represents it's center (e.g. for fireballs), it could mean the center of the bottom edge (e.g. a tree which is positioned on the ground), the top-left corner (e.g. a cursor).

The default setting is BBO_CENTER.

Parameters:
origin  A member of the BillboardOrigin enum specifying the origin for all the billboards in this set.

void Ogre::BillboardSet::setBillboardType BillboardType    bbt [virtual]
 

Sets the type of billboard to render.

Remarks:
The default sort of billboard (BBT_POINT), always has both x and y axes parallel to the camera's local axes. This is fine for 'point' style billboards (e.g. flares, smoke, anything which is symmetrical about a central point) but does not look good for billboards which have an orientation (e.g. an elongated raindrop). In this case, the oriented billboards are more suitable (BBT_ORIENTED_COMMON or BBT_ORIENTED_SELF) since they retain an independant Y axis and only the X axis is generated, perpendicular to both the local Y and the camera Z.
Parameters:
bbt  The type of billboard to render

void Ogre::BillboardSet::setCommonDirection const Vector3   vec [virtual]
 

Use this to specify the common direction given to billboards of type BBT_ORIENTED_COMMON.

Remarks:
Use BBT_ORIENTED_COMMON when you want oriented billboards but you know they are always going to be oriented the same way (e.g. rain in calm weather). It is faster for the system to calculate the billboard vertices if they have a common direction.
Parameters:
vec  The direction for all billboards.

void Ogre::BillboardSet::setCullIndividually bool    cullIndividual [virtual]
 

Sets whether culling tests billboards in this individually as well as in a group.

Remarks:
Billboard sets are always culled as a whole group, based on a bounding box which encloses all billboards in the set. For fairly localised sets, this is enough. However, you can optionally tell the set to also cull individual billboards in the set, i.e. to test each individual billboard before rendering. The default is not to do this.

This is useful when you have a large, fairly distributed set of billboards, like maybe trees on a landscape. You probably still want to group them into more than one set (maybe one set per section of landscape), which will be culled coarsely, but you also want to cull the billboards individually because they are spread out. Whilst you could have lots of single-tree sets which are culled separately, this would be inefficient to render because each tree would be issued as it's own rendering operation.

By calling this method with a parameter of true, you can have large billboard sets which are spaced out and so get the benefit of batch rendering and coarse culling, but also have fine-grained culling so unnecessary rendering is avoided.

Parameters:
cullIndividual  If true, each billboard is tested before being sent to the pipeline as well as the whole set having to pass the coarse group bounding test.

void Ogre::BillboardSet::setDefaultDimensions Real    width,
Real    height
[virtual]
 

Sets the default dimensions of the billboards in this set.

Remarks:
All billboards in a set are created with these default dimensions. The set will render most efficiently if all the billboards in the set are the default size. It is possible to alter the size of individual billboards at the expense of extra calculation. See the Billboard class for more info.
Parameters:
width  The new default width for the billboards in this set.
height  The new default height for the billboards in this set.

void Ogre::BillboardSet::setDefaultHeight Real    height [virtual]
 

See setDefaultDimensions - this sets 1 component individually.

void Ogre::BillboardSet::setDefaultWidth Real    width [virtual]
 

See setDefaultDimensions - this sets 1 component individually.

void Ogre::BillboardSet::setMaterialName const String   name [virtual]
 

Sets the name of the material to be used for this billboard set.

Parameters:
name  The new name of the material to use for this set.

bool Ogre::StringInterface::setParameter const String   name,
const String   value
[virtual, inherited]
 

Generic parameter setting method.

Remarks:
Call this method with the name of a parameter and a string version of the value to set. The implementor will convert the string to a native type internally. If in doubt, check the parameter definition in the list returned from StringInterface::getParameters.
Parameters:
name  The name of the parameter to set
value  String value. Must be in the right format for the type specified in the parameter definition. See the StringConverter class for more information.
Returns:
true if set was successful, false otherwise (NB no exceptions thrown - tolerant method)

void Ogre::BillboardSet::setPoolSize unsigned int    size [virtual]
 

Adjusts the size of the pool of billboards available in this set.

Remarks:
See the BillboardSet::setAutoextend method for full details of the billboard pool. This method adjusts the preallocated size of the pool. If you try to reduce the size of the pool, the set has the option of ignoring you if too many billboards are already in use. Bear in mind that calling this method will incur significant construction / destruction calls so should be avoided in time-critical code. The same goes for auto-extension, try to avoid it by estimating the pool size correctly up-front.
Parameters:
size  The new size for the pool.

void Ogre::MovableObject::setRenderQueueGroup RenderQueueGroupID    queueID [virtual, inherited]
 

Sets the render queue group this entity will be rendered through.

Remarks:
Render queues are grouped to allow you to more tightly control the ordering of rendered objects. If you do not call this method, all Entity objects default to RENDER_QUEUE_MAIN which is fine for most objects. You may want to alter this if you want this entity to always appear in front of other objects, e.g. for a 3D menu system or such.

See RenderQueue for more details.

Parameters:
queueID  Enumerated value of the queue group to use.

virtual void Ogre::MovableObject::setUserObject UserDefinedObject   obj [inline, virtual, inherited]
 

Call this to associate your own custom user object instance with this MovableObject.

Remarks:
By simply making your game / application object a subclass of UserDefinedObject, you can establish a link between an OGRE instance of MovableObject and your own application classes. Call this method to establish the link.

void Ogre::MovableObject::setVisible bool    visible [virtual, inherited]
 

Tells this object whether to be visible or not, if it has a renderable component.

Reimplemented in Ogre::Light.

virtual bool Ogre::Renderable::useIdentityProjection void    [inline, virtual, inherited]
 

Returns whether or not to use an 'identity' projection.

Remarks:
Usually Renderable objects will use a projection matrix as determined by the active camera. However, if they want they can cancel this out and use an identity projection, which effectively projects in 2D using a {-1, 1} view space. Useful for overlay rendering. Normal renderables need not override this.

Reimplemented in Ogre::GuiElement.

virtual bool Ogre::Renderable::useIdentityView void    [inline, virtual, inherited]
 

Returns whether or not to use an 'identity' projection.

Remarks:
Usually Renderable objects will use a view matrix as determined by the active camera. However, if they want they can cancel this out and use an identity matrix, which means all geometry is assumed to be relative to camera space already. Useful for overlay rendering. Normal renderables need not override this.

Reimplemented in Ogre::GuiElement.


Member Data Documentation

AxisAlignedBox Ogre::BillboardSet::mAABB [protected]
 

Bounds of all billboards in this set.

ActiveBillboardList Ogre::BillboardSet::mActiveBillboards [protected]
 

Active billboard list.

Remarks:
This is a linked list of pointers to billboards in the billboard pool.

This allows very fast instertions and deletions from anywhere in the list to activate / deactivate billboards (required for particle systems etc) as well as resuse of Billboard instances in the pool without construction & destruction which avoids memory thrashing.

bool Ogre::BillboardSet::mAllDefaultSize [protected]
 

True if no billboards in this set have been resized - greater efficiency.

bool Ogre::BillboardSet::mAutoExtendPool [protected]
 

Flag indicating whether to autoextend pool.

BillboardPool Ogre::BillboardSet::mBillboardPool [protected]
 

Pool of billboard instances for use and reuse in the active billboard list.

Remarks:
This vector will be preallocated with the estimated size of the set,and will extend as required.

BillboardType Ogre::BillboardSet::mBillboardType [protected]
 

The type of billboard to render.

Vector3 Ogre::BillboardSet::mCommonDirection [protected]
 

Common direction for billboards of type BBT_ORIENTED_COMMON.

bool Ogre::BillboardSet::mCullIndividual [protected]
 

Flag indicating whether each billboard should be culled separately (default: false).

Real Ogre::BillboardSet::mDefaultHeight [protected]
 

Default height of each billboard.

Real Ogre::BillboardSet::mDefaultWidth [protected]
 

Default width of each billboard.

FreeBillboardQueue Ogre::BillboardSet::mFreeBillboards [protected]
 

Free billboard queue.

Remarks:
This contains a list of the billboards free for use as new instances as required by the set. Billboard instances are preconstructed up to the estimated size in the mBillboardPool vector and are referenced on this deque at startup. As they get used this deque reduces, as they get released back to to the set they get added back to the deque.

String Ogre::BillboardSet::mMaterialName [protected]
 

Name of the material to use.

String Ogre::BillboardSet::mName [protected]
 

Name of the entity; used for location in the scene.

Reimplemented in Ogre::ParticleSystem.

unsigned short Ogre::BillboardSet::mNumVisibleBillboards [protected]
 

BillboardOrigin Ogre::BillboardSet::mOriginType [protected]
 

Origin of each billboard.

String Ogre::StringInterface::mParamDictName [protected, inherited]
 

Class name for this instance to be used as a lookup (must be initialised by subclasses).

SceneNode* Ogre::MovableObject::mParentNode [protected, inherited]
 

node to which this object is attached.

RGBA* Ogre::BillboardSet::mpColours [protected]
 

The vertex colour data for all billboards in this set.

unsigned short* Ogre::BillboardSet::mpIndexes [protected]
 

The vertex index data for all billboards in this set (1 set only).

Material* Ogre::BillboardSet::mpMaterial [protected]
 

Pointer to the material to use.

Real* Ogre::BillboardSet::mpPositions [protected]
 

The vertex position data for all billboards in this set.

Real* Ogre::BillboardSet::mpTexCoords [protected]
 

The texture coordinates for all billboards in this set.

RenderQueueGroupID Ogre::MovableObject::mRenderQueueID [protected, inherited]
 

The render queue to use when rendering this object.

ParamDictionaryMap Ogre::StringInterface::msDictionary [static, protected, inherited]
 

Dictionary of parameters.

String Ogre::BillboardSet::msMovableType = "BillboardSet" [static, protected]
 

Shared class-level name for Movable type.

UserDefinedObject* Ogre::MovableObject::mUserObject [protected, inherited]
 

User defined object which is linked to this object.

bool Ogre::MovableObject::mVisible [protected, inherited]
 

Is this object visible?

Copyright © 2002 by The OGRE Team