OGRE 14.3
Object-Oriented Graphics Rendering Engine
Loading...
Searching...
No Matches
Ogre::BillboardParticleRenderer Class Reference

Specialisation of ParticleSystemRenderer to render particles using a BillboardSet. More...

#include <OgreBillboardParticleRenderer.h>

+ Inheritance diagram for Ogre::BillboardParticleRenderer:

Public Member Functions

 BillboardParticleRenderer ()
 
 ~BillboardParticleRenderer ()
 
SortMode _getSortMode (void) const override
 Gets the desired particles sort mode of this renderer.
 
void _notifyAttached (Node *parent, bool isTagPoint=false) override
 Delegated to by ParticleSystem::_notifyAttached.
 
void _notifyBoundingBox (const AxisAlignedBox &aabb) override
 Tells the Renderer about the ParticleSystem bounds.
 
void _notifyCastShadows (bool enabled) override
 Tells the Renderer whether to cast shadows.
 
void _notifyCurrentCamera (Camera *cam) override
 Delegated to by ParticleSystem::_notifyCurrentCamera.
 
void _notifyDefaultDimensions (Real width, Real height) override
 Tells the renderer that the particle default size has changed.
 
void _notifyParticleQuota (size_t quota) override
 Tells the renderer that the particle quota has changed.
 
void _setMaterial (MaterialPtr &mat) override
 Sets the material this renderer must use; called by ParticleSystem.
 
void _updateRenderQueue (RenderQueue *queue, std::vector< Particle * > &currentParticles, bool cullIndividually) override
 Delegated to by ParticleSystem::_updateRenderQueue.
 
BillboardOrigin getBillboardOrigin (void) const
 Gets the point which acts as the origin point for all billboards in this set.
 
BillboardRotationType getBillboardRotationType () const
 Sets billboard rotation type.
 
BillboardSetgetBillboardSet (void) const
 Access BillboardSet in use.
 
BillboardType getBillboardType (void) const
 Returns the billboard type in use.
 
const Vector3getCommonDirection (void) const
 Gets the common direction for all billboards (BBT_ORIENTED_COMMON)
 
const Vector3getCommonUpVector (void) const
 Gets the common up-vector for all billboards (BBT_PERPENDICULAR_SELF and BBT_PERPENDICULAR_COMMON)
 
const Vector2getTextureStacksAndSlices () const
 
const StringgetType (void) const override
 Gets the type of this renderer - must be implemented by subclasses.
 
bool getUseAccurateFacing (void) const
 Gets whether or not billboards use an 'accurate' facing model.
 
bool isPointRenderingEnabled (void) const
 Returns whether point rendering is enabled.
 
void setBillboardOrigin (BillboardOrigin origin)
 Sets the point which acts as the origin point for all billboards in this set.
 
void setBillboardRotationType (BillboardRotationType rotationType)
 Sets billboard rotation type.
 
void setBillboardType (BillboardType bbt)
 Sets the orientation behaviour of the billboards to render.
 
void setCommonDirection (const Vector3 &vec)
 Use this to specify the common direction given to billboards.
 
void setCommonUpVector (const Vector3 &vec)
 Use this to specify the common up-vector given to billboards.
 
void setKeepParticlesInLocalSpace (bool keepLocal) override
 Setting carried over from ParticleSystem.
 
void setPointRenderingEnabled (bool enabled)
 Set whether or not the BillboardSet will use point rendering rather than manually generated quads.
 
void setRenderQueueGroup (uint8 queueID) override
 Sets which render queue group this renderer should target with it's output.
 
void setRenderQueueGroupAndPriority (uint8 queueID, ushort priority) override
 Sets the render queue group and group priority this entity will be rendered through.
 
void setTextureStacksAndSlices (uchar stacks, uchar slices)
 Generate texture coordinate rects for a tiled texture sheet.
 
void setUseAccurateFacing (bool acc)
 Sets whether or not billboards should use an 'accurate' facing model.
 
void visitRenderables (Renderable::Visitor *visitor, bool debugRenderables=false) override
 Required method to allow the renderer to communicate the Renderables it will be using to render the system to a visitor.
 
- Public Member Functions inherited from Ogre::ParticleSystemRenderer
 ParticleSystemRenderer ()
 Constructor.
 
virtual ~ParticleSystemRenderer ()
 Destructor.
 
ParticleVisualData_createVisualData (void)
 
void _destroyVisualData (ParticleVisualData *)
 
virtual void _notifyParticleCleared (std::vector< Particle * > &currentParticles)
 Optional callback notified when particles cleared.
 
virtual void _notifyParticleEmitted (Particle *particle)
 Optional callback notified when particle emitted.
 
virtual void _notifyParticleExpired (Particle *particle)
 Optional callback notified when particle expired.
 
virtual void _notifyParticleMoved (std::vector< Particle * > &currentParticles)
 Optional callback notified when particles moved.
 
- Public Member Functions inherited from Ogre::StringInterface
 StringInterface ()
 
virtual ~StringInterface ()
 Virtual destructor, see Effective C++.
 
void copyParametersTo (StringInterface *dest) const
 Method for copying this object's parameters to another object.
 
ParamDictionarygetParamDictionary (void)
 Retrieves the parameter dictionary for this class.
 
const ParamDictionarygetParamDictionary (void) const
 
String getParameter (const String &name) const
 Generic parameter retrieval method.
 
const ParameterListgetParameters (void) const
 Retrieves a list of parameters valid for this object.
 
bool setParameter (const String &name, const String &value)
 Generic parameter setting method.
 
void setParameterList (const NameValuePairList &paramList)
 Generic multiple parameter setting method.
 

Additional Inherited Members

- Static Public Member Functions inherited from Ogre::StringInterface
static void cleanupDictionary ()
 Cleans up the static 'msDictionary' required to reset Ogre, otherwise the containers are left with invalid pointers, which will lead to a crash as soon as one of the ResourceManager implementers (e.g.
 

Detailed Description

Specialisation of ParticleSystemRenderer to render particles using a BillboardSet.

This renderer has a few more options than the standard particle system, which will be passed to it automatically when the particle system itself does not understand them.

Constructor & Destructor Documentation

◆ BillboardParticleRenderer()

Ogre::BillboardParticleRenderer::BillboardParticleRenderer ( )

◆ ~BillboardParticleRenderer()

Ogre::BillboardParticleRenderer::~BillboardParticleRenderer ( )

Member Function Documentation

◆ setTextureStacksAndSlices()

void Ogre::BillboardParticleRenderer::setTextureStacksAndSlices ( uchar  stacks,
uchar  slices 
)
inline

Generate texture coordinate rects for a tiled texture sheet.

A texture sheet is a grid of images that can be used to create simple animations. This method will generate the uv coordinates for the individual sub-rectangles.

These can then be addressed by Ogre::Billboard::setTexcoordIndex().

If the texture size is 512x512 and 'stacks' is 4 and 'slices' is 8, each sub-rectangle of the texture would be 128 texels tall and 64 texels wide.

The numbering counts first across, then down, so top-left is 0, the one to the right of that is 1, and the lower-right is stacks*slices-1.

If you need more flexibility, you can use Ogre::BillboardSet::setTextureCoords() instead.

Parameters
stacksnumber of vertical tiles (rows)
slicesnumber of horizontal tiles (columns)

◆ getTextureStacksAndSlices()

const Vector2 & Ogre::BillboardParticleRenderer::getTextureStacksAndSlices ( ) const
inline

◆ setBillboardType()

void Ogre::BillboardParticleRenderer::setBillboardType ( BillboardType  bbt)
inline

Sets the orientation behaviour of the billboards to render.

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 independent Y axis and only the X axis is generated, perpendicular to both the local Y and the camera Z.

In some case you might want the billboard has fixed Z axis and doesn't need to face to camera (e.g. an aureola around the player and parallel to the ground). You can use BBT_PERPENDICULAR_SELF which the billboard plane perpendicular to the billboard own direction. Or BBT_PERPENDICULAR_COMMON which the billboard plane perpendicular to the common direction.

Note
BBT_PERPENDICULAR_SELF and BBT_PERPENDICULAR_COMMON can't guarantee counterclockwise, you might use double-side material (CULL_NONE) to ensure no billboard are culled.
Parameters
bbtThe type of billboard to render

◆ getBillboardType()

BillboardType Ogre::BillboardParticleRenderer::getBillboardType ( void  ) const
inline

Returns the billboard type in use.

◆ setUseAccurateFacing()

void Ogre::BillboardParticleRenderer::setUseAccurateFacing ( bool  acc)
inline

Sets whether or not billboards should use an 'accurate' facing model.

By default, the axes for all billboards are calculated using the camera's view direction, not the vector from the camera position to the billboard. The former is faster, and most of the time the difference is not noticeable. However for some purposes (e.g. very large, static billboards) the changing billboard orientation when rotating the camera can be off putting, therefore you can enable this option to use a more expensive, but more accurate version.

Parameters
accTrue to use the slower but more accurate model. Default is false.

◆ getUseAccurateFacing()

bool Ogre::BillboardParticleRenderer::getUseAccurateFacing ( void  ) const
inline

Gets whether or not billboards use an 'accurate' facing model.

based on the vector from each billboard to the camera, rather than an optimised version using just the camera direction.

◆ setBillboardOrigin()

void Ogre::BillboardParticleRenderer::setBillboardOrigin ( BillboardOrigin  origin)
inline

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

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
originA member of the BillboardOrigin enum specifying the origin for all the billboards in this set.

◆ getBillboardOrigin()

BillboardOrigin Ogre::BillboardParticleRenderer::getBillboardOrigin ( void  ) const
inline

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.

◆ setBillboardRotationType()

void Ogre::BillboardParticleRenderer::setBillboardRotationType ( BillboardRotationType  rotationType)
inline

Sets billboard rotation type.

This setting controls the billboard rotation type, you can deciding rotate the billboard's vertices around their facing direction or rotate the billboard's texture coordinates.

The default settings is BBR_TEXCOORD.

Parameters
rotationTypeA member of the BillboardRotationType enum specifying the rotation type for all the billboards in this set.

◆ getBillboardRotationType()

BillboardRotationType Ogre::BillboardParticleRenderer::getBillboardRotationType ( ) const
inline

Sets billboard rotation type.

Returns
A member of the BillboardRotationType enum specifying the rotation type for all the billboards in this set.

◆ setCommonDirection()

void Ogre::BillboardParticleRenderer::setCommonDirection ( const Vector3 vec)
inline

Use this to specify the common direction given to billboards.

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.

The common direction also use in BBT_PERPENDICULAR_COMMON, in this case the common direction treat as Z axis, and an additional common up-vector was use to determine billboard X and Y axis.

Parameters
vecThe direction for all billboards. The vector is expected to be unit-length (normalised)
See also
setCommonUpVector

◆ getCommonDirection()

const Vector3 & Ogre::BillboardParticleRenderer::getCommonDirection ( void  ) const
inline

Gets the common direction for all billboards (BBT_ORIENTED_COMMON)

◆ setCommonUpVector()

void Ogre::BillboardParticleRenderer::setCommonUpVector ( const Vector3 vec)
inline

Use this to specify the common up-vector given to billboards.

Use BBT_PERPENDICULAR_SELF or BBT_PERPENDICULAR_COMMON when you want oriented billboards perpendicular to specify direction vector (or, Z axis), and doesn't face to camera. In this case, we need an additional up-vector to determine the billboard X and Y axis. The generated billboard plane and X-axis guarantee perpendicular to specify direction.

The specify direction is billboard own direction when billboard type is BBT_PERPENDICULAR_SELF, and it's shared common direction when billboard type is BBT_PERPENDICULAR_COMMON.

Parameters
vecThe up-vector for all billboards. The vector is expected to be unit-length (normalised)
See also
setCommonDirection

◆ getCommonUpVector()

const Vector3 & Ogre::BillboardParticleRenderer::getCommonUpVector ( void  ) const
inline

Gets the common up-vector for all billboards (BBT_PERPENDICULAR_SELF and BBT_PERPENDICULAR_COMMON)

◆ setPointRenderingEnabled()

void Ogre::BillboardParticleRenderer::setPointRenderingEnabled ( bool  enabled)
inline

Set whether or not the BillboardSet will use point rendering rather than manually generated quads.

By default a billboardset is rendered by generating geometry for a textured quad in memory, taking into account the size and orientation settings, and uploading it to the video card. The alternative is to use hardware point rendering, which means that only one position needs to be sent per billboard rather than 4 and the hardware sorts out how this is rendered based on the render state.

Using point rendering is faster than generating quads manually, but is more restrictive. The following restrictions apply:

You will almost certainly want to enable in your material pass both point attenuation and point sprites if you use this option.

◆ isPointRenderingEnabled()

bool Ogre::BillboardParticleRenderer::isPointRenderingEnabled ( void  ) const
inline

Returns whether point rendering is enabled.

◆ getType()

const String & Ogre::BillboardParticleRenderer::getType ( void  ) const
overridevirtual

Gets the type of this renderer - must be implemented by subclasses.

Implements Ogre::ParticleSystemRenderer.

◆ _updateRenderQueue()

void Ogre::BillboardParticleRenderer::_updateRenderQueue ( RenderQueue queue,
std::vector< Particle * > &  currentParticles,
bool  cullIndividually 
)
overridevirtual

Delegated to by ParticleSystem::_updateRenderQueue.

The subclass must update the render queue using whichever Renderable instance(s) it wishes.

Implements Ogre::ParticleSystemRenderer.

◆ visitRenderables()

void Ogre::BillboardParticleRenderer::visitRenderables ( Renderable::Visitor visitor,
bool  debugRenderables = false 
)
inlineoverridevirtual

Required method to allow the renderer to communicate the Renderables it will be using to render the system to a visitor.

See also
MovableObject::visitRenderables

Implements Ogre::ParticleSystemRenderer.

◆ _setMaterial()

void Ogre::BillboardParticleRenderer::_setMaterial ( MaterialPtr mat)
inlineoverridevirtual

Sets the material this renderer must use; called by ParticleSystem.

Implements Ogre::ParticleSystemRenderer.

◆ _notifyCurrentCamera()

void Ogre::BillboardParticleRenderer::_notifyCurrentCamera ( Camera cam)
inlineoverridevirtual

◆ _notifyParticleQuota()

void Ogre::BillboardParticleRenderer::_notifyParticleQuota ( size_t  quota)
inlineoverridevirtual

Tells the renderer that the particle quota has changed.

Implements Ogre::ParticleSystemRenderer.

◆ _notifyAttached()

void Ogre::BillboardParticleRenderer::_notifyAttached ( Node parent,
bool  isTagPoint = false 
)
inlineoverridevirtual

◆ _notifyDefaultDimensions()

void Ogre::BillboardParticleRenderer::_notifyDefaultDimensions ( Real  width,
Real  height 
)
inlineoverridevirtual

Tells the renderer that the particle default size has changed.

Implements Ogre::ParticleSystemRenderer.

◆ setRenderQueueGroup()

void Ogre::BillboardParticleRenderer::setRenderQueueGroup ( uint8  queueID)
inlineoverridevirtual

Sets which render queue group this renderer should target with it's output.

Implements Ogre::ParticleSystemRenderer.

◆ setRenderQueueGroupAndPriority()

void Ogre::BillboardParticleRenderer::setRenderQueueGroupAndPriority ( uint8  queueID,
ushort  priority 
)
inlineoverridevirtual

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

Render queues are grouped to allow you to more tightly control the ordering of rendered objects. Within a single render group there another type of grouping called priority which allows further control. If you do not call this method, all Entity objects default to the default queue and priority (RenderQueue::getDefaultQueueGroup, RenderQueue::getDefaultRenderablePriority), 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
queueIDEnumerated value of the queue group to use. See the enum RenderQueueGroupID for what kind of values can be used here.
priorityThe priority within a group to use.

Implements Ogre::ParticleSystemRenderer.

◆ setKeepParticlesInLocalSpace()

void Ogre::BillboardParticleRenderer::setKeepParticlesInLocalSpace ( bool  keepLocal)
inlineoverridevirtual

Setting carried over from ParticleSystem.

Implements Ogre::ParticleSystemRenderer.

◆ _getSortMode()

SortMode Ogre::BillboardParticleRenderer::_getSortMode ( void  ) const
inlineoverridevirtual

Gets the desired particles sort mode of this renderer.

Implements Ogre::ParticleSystemRenderer.

◆ getBillboardSet()

BillboardSet * Ogre::BillboardParticleRenderer::getBillboardSet ( void  ) const
inline

Access BillboardSet in use.

◆ _notifyBoundingBox()

void Ogre::BillboardParticleRenderer::_notifyBoundingBox ( const AxisAlignedBox aabb)
overridevirtual

Tells the Renderer about the ParticleSystem bounds.

Reimplemented from Ogre::ParticleSystemRenderer.

◆ _notifyCastShadows()

void Ogre::BillboardParticleRenderer::_notifyCastShadows ( bool  enabled)
inlineoverridevirtual

Tells the Renderer whether to cast shadows.

Reimplemented from Ogre::ParticleSystemRenderer.


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