Go to the documentation of this file.
29 #ifndef __BillboardSet_H__
30 #define __BillboardSet_H__
333 bool externalDataSource =
false);
732 bool debugRenderables =
false);
831 {
return mPointRendering; }
880 #endif // __BillboardSet_H__
VertexData * mVertexData
The vertex position data for all billboards in this set.
virtual void setUseAccurateFacing(bool acc)
Sets whether or not billboards should use an 'accurate' facing model based on the vector from each bi...
virtual void _notifyBillboardRotated(void)
Internal callback used by Billboards to notify their parent that they have been rotated.
bool mPointRendering
Use point rendering?
void genVertices(const Vector3 *const offsets, const Billboard &pBillboard)
Internal method for generating vertex data.
bool mAllDefaultSize
True if no billboards in this set have been resized - greater efficiency.
virtual void setPoolSize(size_t size)
Adjusts the size of the pool of billboards available in this set.
bool mCullIndividual
Flag indicating whether each billboard should be culled separately (default: false)
void _createBuffers(void)
Internal method creates vertex and index buffers.
A billboard is a primitive which always faces the camera in every frame.
void endBillboards(void)
Finish defining billboards.
unsigned short mNumVisibleBillboards
Number of visible billboards (will be == getNumBillboards if mCullIndividual == false)
uint32 getTypeFlags(void) const
Override to return specific type flag.
vector< Ogre::FloatRect >::type TextureCoordSets
BillboardPool mBillboardPool
Pool of billboard instances for use and reuse in the active billboard list.
Vector3 mCommonDirection
Common direction for billboards of type BBT_ORIENTED_COMMON and BBT_PERPENDICULAR_COMMON.
const String & getType(void) const
Get the type of the object to be created.
virtual const Vector3 & getCommonUpVector(void) const
Gets the common up-vector for all billboards (BBT_PERPENDICULAR_SELF and BBT_PERPENDICULAR_COMMON)
@ BBT_PERPENDICULAR_SELF
Billboards are perpendicular to their own direction vector (their own Z axis, the facing direction) a...
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.
A viewpoint from which the scene will be rendered.
BillboardType
The type of billboard to use.
TextureCoordSets mTextureCoords
void _destroyBuffers(void)
Internal method destroys vertex and index buffers.
virtual BillboardRotationType getBillboardRotationType(void) const
Sets billboard rotation type.
virtual void setBillboardOrigin(BillboardOrigin origin)
Sets the point which acts as the origin point for all billboards in this set.
virtual void setMaterial(const MaterialPtr &material)
Sets the name of the material to be used for this billboard set.
virtual Real getDefaultHeight(void) const
See setDefaultDimensions - this gets 1 component individually.
bool billboardVisible(Camera *cam, const Billboard &bill)
Internal method for culling individual billboards.
bool mSortingEnabled
Flag indicating whether the billboards has to be sorted.
virtual const AxisAlignedBox & getBoundingBox(void) const
Overridden from MovableObject.
Real mDefaultHeight
Default height of each billboard.
virtual void setCommonDirection(const Vector3 &vec)
Use this to specify the common direction given to billboards of type BBT_ORIENTED_COMMON or BBT_PERPE...
virtual void removeBillboard(Billboard *pBill)
Removes a billboard from the set.
void injectBillboard(const Billboard &bb)
Define a billboard.
@ BBT_PERPENDICULAR_COMMON
Billboards are perpendicular to a shared direction vector (used as Z axis, the facing direction) and ...
Vector3 sortDir
Direction to sort in.
BillboardSet(const String &name, unsigned int poolSize=20, bool externalDataSource=false)
Usual constructor - this is called by the SceneManager.
virtual void _notifyBillboardResized(void)
Internal callback used by Billboards to notify their parent that they have been resized.
bool mAutoExtendPool
Flag indicating whether to autoextend pool.
virtual void setTextureCoords(Ogre::FloatRect const *coords, uint16 numCoords)
BillboardSet can use custom texture coordinates for various billboards.
virtual void setSortingEnabled(bool sortenable)
Enables sorting for this BillboardSet.
Abstract class defining a movable object in a scene.
virtual BillboardType getBillboardType(void) const
Returns the billboard type in use.
virtual bool getCullIndividually(void) const
Returns whether or not billboards in this are tested individually for culling.
const LightList & getLights(void) const
Gets a list of lights, ordered relative to how close they are to this renderable.
void notifyBillboardDataChanged(void)
When billboard set is not auto updating its GPU buffer, the user is responsible to inform it about an...
virtual void setDefaultWidth(Real width)
See setDefaultDimensions - this sets 1 component individually.
void getParametricOffsets(Real &left, Real &right, Real &top, Real &bottom)
Internal method, generates parametric offsets based on origin.
static String AUTODETECT_RESOURCE_GROUP_NAME
Special resource group name which causes resource group to be automatically determined based on searc...
virtual unsigned int getPoolSize(void) const
Returns the current size of the billboard pool.
float * mLockPtr
Locked pointer to buffer.
A collection of billboards (faces which are always facing the given direction) with the same (default...
void setBounds(const AxisAlignedBox &box, Real radius)
Set the bounds of the BillboardSet.
size_t mPoolSize
The number of billboard in the pool.
BillboardSet()
Private constructor (instances cannot be created directly).
bool mBuffersCreated
Flag indicating whether the HW buffers have been created.
Interface definition for a factory class which produces a certain kind of MovableObject,...
@ BBR_TEXCOORD
Rotate the billboard's texture coordinates.
Real getSquaredViewDepth(const Camera *cam) const
Overridden, see Renderable.
SortMode
Sort mode for billboard-set and particle-system.
void destroyInstance(MovableObject *obj)
Destroy an instance of the object.
map< String, String >::type NameValuePairList
Name / value parameter pair (first = name, second = value)
bool mAutoUpdate
Tell if vertex buffer should be update automatically.
virtual void setBillboardsInWorldSpace(bool ws)
Sets whether billboards should be treated as being in world space.
virtual bool getSortingEnabled(void) const
Returns true if sorting of billboards is enabled based on their distance from the camera.
virtual const MaterialPtr & getMaterial(void) const
Overridden from MovableObject.
Summary class collecting together vertex source information.
Implementation of a Quaternion, i.e.
Class encapsulating a standard 4x4 homogeneous matrix.
virtual void _sortBillboards(Camera *cam)
Sort the billboard set.
static RadixSort< ActiveBillboardList, Billboard *, float > mRadixSorter
virtual void setAutoextend(bool autoextend)
Tells the set whether to allow automatic extension of the pool of billboards.
virtual void setBillboardType(BillboardType bbt)
Sets the type of billboard to render.
bool mAccurateFacing
Use 'true' billboard to cam position facing, rather than camera direcion.
void setAutoUpdate(bool autoUpdate)
Set the auto update state of this billboard set.
@ BBT_ORIENTED_COMMON
Billboards are oriented around a shared direction vector (used as Y axis) and only rotate around this...
bool mBillboardDataChanged
True if the billboard data changed. Will cause vertex buffer update.
MovableObject * createInstanceImpl(const String &name, const NameValuePairList *params)
Internal implementation of create method - must be overridden.
String mMaterialName
Name of the material to use.
virtual SortMode _getSortMode(void) const
Gets the sort mode of this billboard set.
FreeBillboardList mFreeBillboards
Free billboard queue.
Shared pointer implementation used to share vertex buffers.
unsigned char uchar
In order to avoid finger-aches :)
@ BBR_VERTEX
Rotate the billboard's vertices around their facing direction.
bool mExternalData
Is external billboard data in use?
virtual Real getBoundingRadius(void) const
Overridden from MovableObject.
Billboard * createBillboard(Real x, Real y, Real z, const ColourValue &colour=ColourValue::White)
Creates a new billboard and adds it to this set.
virtual void _updateRenderQueue(RenderQueue *queue)
Overridden from MovableObject.
Vector3 sortPos
Position to sort in.
@ BBT_ORIENTED_SELF
Billboards are oriented around their own direction vector (their own Y axis) and only rotate around t...
static String FACTORY_TYPE_NAME
A 3D box aligned with the x/y/z axes.
Sort by direction functor.
Sort by distance functor.
Camera * mCurrentCamera
Current camera.
virtual void getRenderOperation(RenderOperation &op)
Overridden from MovableObject.
virtual void increasePool(size_t size)
Internal method for increasing pool size.
BillboardOrigin
Enum covering what exactly a billboard's position means (center, top-left etc).
Vector3 mCamDir
Camera direction in billboard space.
static const ColourValue White
BillboardRotationType
The rotation type of billboard.
list< Billboard * >::type ActiveBillboardList
vector< Billboard * >::type BillboardPool
Quaternion mCamQ
Camera orientation in billboard space.
IndexData * mIndexData
The vertex index data for all billboards in this set (1 set only)
BillboardType mBillboardType
The type of billboard to render.
virtual void _updateBounds(void)
Update the bounds of the billboardset.
virtual Real getDefaultWidth(void) const
See setDefaultDimensions - this gets 1 component individually.
ActiveBillboardList mActiveBillboards
Active billboard list.
virtual bool getUseAccurateFacing(void) const
Gets whether or not billboards use an 'accurate' facing model based on the vector from each billboard...
Real mDefaultWidth
Default width of each billboard.
virtual bool getAutoextend(void) const
Returns true if the billboard pool automatically extends.
bool getAutoUpdate(void) const
Return the auto update state of this billboard set.
Real mBoundingRadius
Bounding radius.
Class representing colour.
void visitRenderables(Renderable::Visitor *visitor, bool debugRenderables=false)
Method to allow a caller to abstractly iterate over the Renderable instances that this MovableObject ...
virtual Ogre::FloatRect const * getTextureCoords(uint16 *oNumCoords)
getTextureCoords() returns the current texture coordinate rects in effect.
float operator()(Billboard *bill) const
SortByDirectionFunctor(const Vector3 &dir)
virtual void _notifyCurrentCamera(Camera *cam)
Overridden from MovableObject.
Visitor object that can be used to iterate over a collection of Renderable instances abstractly.
virtual void setDefaultDimensions(Real width, Real height)
Sets the default dimensions of the billboards in this set.
virtual BillboardOrigin getBillboardOrigin(void) const
Gets the point which acts as the origin point for all billboards in this set.
Class for performing a radix sort (fast comparison-less sort based on byte value) on various standard...
virtual void clear()
Empties this set of all billboards.
virtual void setBillboardRotationType(BillboardRotationType rotationType)
Sets billboard rotation type.
BillboardRotationType mRotationType
Rotation type of each billboard.
Vector3 mCommonUpVector
Common up-vector for billboards of type BBT_PERPENDICULAR_SELF and BBT_PERPENDICULAR_COMMON.
Abstract class defining the interface all renderable objects must implement.
virtual void setCommonUpVector(const Vector3 &vec)
Use this to specify the common up-vector given to billboards of type BBT_PERPENDICULAR_SELF or BBT_PE...
virtual const String & getMovableType(void) const
Overridden from MovableObject.
HardwareVertexBufferSharedPtr mMainBuf
Shortcut to main buffer (positions, colours, texture coords)
virtual void removeBillboard(unsigned int index)
Removes the billboard at the supplied index.
BillboardOrigin mOriginType
Origin of each billboard.
Billboard * createBillboard(const Vector3 &position, const ColourValue &colour=ColourValue::White)
Creates a new billboard and adds it to this set.
float Real
Software floating point type.
virtual void getWorldTransforms(Matrix4 *xform) const
Overridden from MovableObject.
void genBillboardAxes(Vector3 *pX, Vector3 *pY, const Billboard *pBill=0)
Internal method for generating billboard corners.
virtual bool isPointRenderingEnabled(void) const
Returns whether point rendering is enabled.
virtual void setTextureStacksAndSlices(uchar stacks, uchar slices)
setTextureStacksAndSlices() will generate texture coordinate rects as if the texture for the billboar...
virtual const Vector3 & getCommonDirection(void) const
Gets the common direction for all billboards (BBT_ORIENTED_COMMON)
virtual void setCullIndividually(bool cullIndividual)
Sets whether culling tests billboards in this individually as well as in a group.
MaterialPtr mMaterial
Pointer to the material to use.
virtual void setMaterialName(const String &name, const String &groupName=ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME)
Sets the name of the material to be used for this billboard set.
virtual Billboard * getBillboard(unsigned int index) const
Returns a pointer to the billboard at the supplied index.
Factory object for creating BillboardSet instances.
AxisAlignedBox mAABB
Bounds of all billboards in this set.
float operator()(Billboard *bill) const
Vector3 mCamPos
Camera position in billboard space.
Summary class collecting together index data source information.
virtual void setDefaultHeight(Real height)
See setDefaultDimensions - this sets 1 component individually.
Standard 3-dimensional vector.
void beginBillboards(size_t numBillboards=0)
Begin injection of billboard data; applicable when constructing the BillboardSet for external data us...
'New' rendering operation using vertex buffers.
list< Billboard * >::type FreeBillboardList
Class to manage the scene object rendering queue.
@ BBT_POINT
Standard point billboard (default), always faces the camera completely and is always upright.
virtual int getNumBillboards(void) const
Returns the number of active billboards which currently make up this set.
virtual void setPointRenderingEnabled(bool enabled)
Set whether or not the BillboardSet will use point rendering rather than manually generated quads.
virtual const String & getMaterialName(void) const
Sets the name of the material to be used for this billboard set.
SortByDistanceFunctor(const Vector3 &pos)
Copyright © 2012 Torus Knot Software Ltd

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.