Particle Universe  1.2
ParticleUniverse::ParticleRenderer Class Referenceabstract

#include <ParticleUniverseRenderer.h>

Inheritance diagram for ParticleUniverse::ParticleRenderer:

Public Member Functions

 ParticleRenderer (void)
 
virtual ~ParticleRenderer (void)
 
const StringgetRendererType (void) const
 
void setRendererType (String rendererType)
 
ParticleTechniquegetParentTechnique (void) const
 
void setParentTechnique (ParticleTechnique *parentTechnique)
 
bool isRendererInitialised (void) const
 
void setRendererInitialised (bool rendererInitialised)
 
virtual void _notifyStart (void)
 
virtual void _notifyStop (void)
 
virtual void _notifyRescaled (const Vector3 &scale)
 
virtual void setVisible (bool visible=true)
 
virtual void _prepare (ParticleTechnique *technique)=0
 
virtual void _unprepare (ParticleTechnique *particleTechnique)
 
virtual void _processParticle (ParticleTechnique *particleTechnique, Particle *particle, Real timeElapsed, bool firstParticle)
 
bool getUseSoftParticles (void) const
 
void setUseSoftParticles (bool useSoftParticles)
 
Real getSoftParticlesContrastPower (void) const
 
Real getSoftParticlesScale (void) const
 
Real getSoftParticlesDelta (void) const
 
void setSoftParticlesContrastPower (Real softParticlesContrastPower)
 
void setSoftParticlesScale (Real softParticlesScale)
 
void setSoftParticlesDelta (Real softParticlesDelta)
 
virtual void _updateRenderQueue (Ogre::RenderQueue *queue, ParticlePool *pool)
 
virtual void _setMaterialName (const String &materialName)=0
 
virtual void _notifyCurrentCamera (Camera *cam)=0
 
virtual void _notifyAttached (Ogre::Node *parent, bool isTagPoint=false)=0
 
virtual void _notifyParticleQuota (size_t quota)=0
 
virtual void _notifyDefaultDimensions (Real width, Real height, Real depth)=0
 
virtual void _notifyParticleResized (void)=0
 
virtual void _notifyParticleZRotated (void)
 
virtual void setRenderQueueGroup (uint8 queueId)
 
virtual uint8 getRenderQueueGroup (void) const
 
virtual SortMode _getSortMode (void) const =0
 
const bool isSorted (void) const
 
void setSorted (bool sorted)
 
const uchar getTextureCoordsRows (void) const
 
void setTextureCoordsRows (uchar const textureCoordsRows)
 
const uchar getTextureCoordsColumns (void) const
 
void setTextureCoordsColumns (uchar const textureCoordsColumns)
 
size_t getNumTextureCoords (void)
 
virtual void copyAttributesTo (ParticleRenderer *renderer)
 
virtual void copyParentAttributesTo (ParticleRenderer *renderer)
 
void addTextureCoords (const Real u, const Real v, const Real width, const Real height)
 
const vector< Ogre::FloatRect * > & getTextureCoords (void) const
 
- Public Member Functions inherited from ParticleUniverse::IAlias
 IAlias (void)
 
virtual ~IAlias (void)
 
const StringgetAliasName (void) const
 
void setAliasName (String aliasName)
 
const AliasType getAliasType (void) const
 
void setAliasType (AliasType aliasType)
 
- Public Member Functions inherited from ParticleUniverse::IElement
 IElement (void)
 
virtual ~IElement (void)
 

Public Attributes

bool autoRotate
 

Static Public Attributes

static const uint8 DEFAULT_RENDER_QUEUE_GROUP
 
static const bool DEFAULT_SORTED
 
static const uchar DEFAULT_TEXTURECOORDS_ROWS
 
static const uchar DEFAULT_TEXTURECOORDS_COLUMNS
 
static const bool DEFAULT_USE_SOFT_PARTICLES
 
static const Real DEFAULT_SOFT_PARTICLES_CONTRAST_POWER
 
static const Real DEFAULT_SOFT_PARTICLES_SCALE
 
static const Real DEFAULT_SOFT_PARTICLES_DELTA
 

Protected Member Functions

void _createSoftMaterial (void)
 
void _stripNameFromSoftPrefix (String &name)
 

Protected Attributes

ParticleTechniquemParentTechnique
 
Ogre::BillboardSetmBillboardSet
 
String mRendererType
 
bool mCullIndividual
 
Real mHeight
 
Real mWidth
 
Real mDepth
 
bool mSorted
 
uint8 mQueueId
 
bool mRendererInitialised
 
Vector3 _mRendererScale
 
vector< Ogre::FloatRect * > mUVList
 
uchar mTextureCoordsRows
 
uchar mTextureCoordsColumns
 
bool mTextureCoordsRowsAndColumnsSet
 
bool mTextureCoordsSet
 
bool mUseSoftParticles
 
Real mSoftParticlesContrastPower
 
Real mSoftParticlesScale
 
Real mSoftParticlesDelta
 
bool mNotifiedDepthMap
 
bool mVisible
 
bool mDepthCheckEnabled
 
bool mDepthWriteEnabled
 
- Protected Attributes inherited from ParticleUniverse::IAlias
String mAliasName
 
AliasType mAliasType
 

Additional Inherited Members

- Public Types inherited from ParticleUniverse::IAlias
enum  AliasType {
  AT_UNDEFINED, AT_TECHNIQUE, AT_RENDERER, AT_EMITTER,
  AT_AFFECTOR, AT_OBSERVER, AT_EXTERN, AT_HANDLER,
  AT_BEHAVIOUR
}
 

Detailed Description

ParticleRenderer is a virtual class and must be subclassed. A subclass of ParticleRenderer is responsible for rendering the visual particles.

Remarks
Several types of renderers are possible. A billboard- and a mesh- renderer are examples.

Constructor & Destructor Documentation

ParticleUniverse::ParticleRenderer::ParticleRenderer ( void  )
virtual ParticleUniverse::ParticleRenderer::~ParticleRenderer ( void  )
virtual

Member Function Documentation

void ParticleUniverse::ParticleRenderer::_createSoftMaterial ( void  )
protected

In case soft particles are used, a new material must be created.

virtual void ParticleUniverse::ParticleRenderer::_notifyDefaultDimensions ( Real  width,
Real  height,
Real  depth 
)
pure virtual
virtual void ParticleUniverse::ParticleRenderer::_notifyParticleQuota ( size_t  quota)
pure virtual
virtual void ParticleUniverse::ParticleRenderer::_notifyParticleResized ( void  )
pure virtual
virtual void ParticleUniverse::ParticleRenderer::_notifyParticleZRotated ( void  )
inlinevirtual
virtual void ParticleUniverse::ParticleRenderer::_notifyRescaled ( const Vector3 scale)
virtual

Notify that the Particle System is rescaled.

Reimplemented in ParticleUniverse::RibbonTrailRenderer.

virtual void ParticleUniverse::ParticleRenderer::_notifyStart ( void  )
virtual

Perform activities when a Renderer is started.

virtual void ParticleUniverse::ParticleRenderer::_notifyStop ( void  )
virtual

Perform activities when a Renderer is stopped.

virtual void ParticleUniverse::ParticleRenderer::_prepare ( ParticleTechnique technique)
pure virtual
virtual void ParticleUniverse::ParticleRenderer::_processParticle ( ParticleTechnique particleTechnique,
Particle particle,
Real  timeElapsed,
bool  firstParticle 
)
inlinevirtual

Entry point for processing an individual particle.

Remarks
Some renderers provide additional functionality besides rendering particles only. This function makes it possible to perform activities that cannot be done in the updateRenderQueue() function. There is no default behaviour.

Reimplemented in ParticleUniverse::LightRenderer, and ParticleUniverse::BeamRenderer.

virtual void ParticleUniverse::ParticleRenderer::_setMaterialName ( const String materialName)
pure virtual
void ParticleUniverse::ParticleRenderer::_stripNameFromSoftPrefix ( String name)
protected

Used to determine the original material name

virtual void ParticleUniverse::ParticleRenderer::_unprepare ( ParticleTechnique particleTechnique)
inlinevirtual
virtual void ParticleUniverse::ParticleRenderer::_updateRenderQueue ( Ogre::RenderQueue queue,
ParticlePool pool 
)
virtual

Updates the renderqueue

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

Reimplemented in ParticleUniverse::RibbonTrailRenderer, ParticleUniverse::BillboardRenderer, ParticleUniverse::BeamRenderer, ParticleUniverse::EntityRenderer, ParticleUniverse::BoxRenderer, and ParticleUniverse::SphereRenderer.

void ParticleUniverse::ParticleRenderer::addTextureCoords ( const Real  u,
const Real  v,
const Real  width,
const Real  height 
)

Add a texture coordinate set, which consist of a the texel position (u, v), width and height

virtual void ParticleUniverse::ParticleRenderer::copyAttributesTo ( ParticleRenderer renderer)
virtual
virtual void ParticleUniverse::ParticleRenderer::copyParentAttributesTo ( ParticleRenderer renderer)
virtual

Copy parent attributes to another renderer.

size_t ParticleUniverse::ParticleRenderer::getNumTextureCoords ( void  )

Return the number of texture coordinates.

ParticleTechnique* ParticleUniverse::ParticleRenderer::getParentTechnique ( void  ) const

Get / set the parent.

const String& ParticleUniverse::ParticleRenderer::getRendererType ( void  ) const
virtual uint8 ParticleUniverse::ParticleRenderer::getRenderQueueGroup ( void  ) const
virtual

Get renderqueue group

Real ParticleUniverse::ParticleRenderer::getSoftParticlesContrastPower ( void  ) const

Contrast Power determines the strength of the alpha that is applied to the particles.

Real ParticleUniverse::ParticleRenderer::getSoftParticlesDelta ( void  ) const

The delta is a threshold value that determines at what 'depth distance' alpha fading is applied.

Real ParticleUniverse::ParticleRenderer::getSoftParticlesScale ( void  ) const

Scale determines the 'velocity' of alpha fading.

const vector<Ogre::FloatRect*>& ParticleUniverse::ParticleRenderer::getTextureCoords ( void  ) const

Returns the list with texture coordinates.

const uchar ParticleUniverse::ParticleRenderer::getTextureCoordsColumns ( void  ) const

Get the number of textureCoords colums (slices) of an atlas texture.

const uchar ParticleUniverse::ParticleRenderer::getTextureCoordsRows ( void  ) const

Get the number of textureCoords rows (stacks) of an atlas texture.

bool ParticleUniverse::ParticleRenderer::getUseSoftParticles ( void  ) const

Returns value that indicates whether usage of soft particles is on or off.

bool ParticleUniverse::ParticleRenderer::isRendererInitialised ( void  ) const

Get / set whether the renderer is initialised.

const bool ParticleUniverse::ParticleRenderer::isSorted ( void  ) const

Returns whether the particles are sorted

void ParticleUniverse::ParticleRenderer::setParentTechnique ( ParticleTechnique parentTechnique)
void ParticleUniverse::ParticleRenderer::setRendererInitialised ( bool  rendererInitialised)
void ParticleUniverse::ParticleRenderer::setRendererType ( String  rendererType)
virtual void ParticleUniverse::ParticleRenderer::setRenderQueueGroup ( uint8  queueId)
virtual
void ParticleUniverse::ParticleRenderer::setSoftParticlesContrastPower ( Real  softParticlesContrastPower)

Todo

void ParticleUniverse::ParticleRenderer::setSoftParticlesDelta ( Real  softParticlesDelta)

Todo

void ParticleUniverse::ParticleRenderer::setSoftParticlesScale ( Real  softParticlesScale)

Todo

void ParticleUniverse::ParticleRenderer::setSorted ( bool  sorted)

Determines whether the particles are sorted

void ParticleUniverse::ParticleRenderer::setTextureCoordsColumns ( uchar const  textureCoordsColumns)

Set the number of textureCoords colums (slices) of an atlas texture.

void ParticleUniverse::ParticleRenderer::setTextureCoordsRows ( uchar const  textureCoordsRows)

Set the number of textureCoords rows (stacks) of an atlas texture.

void ParticleUniverse::ParticleRenderer::setUseSoftParticles ( bool  useSoftParticles)

Set usage of soft particles on or off.

virtual void ParticleUniverse::ParticleRenderer::setVisible ( bool  visible = true)
inlinevirtual

Member Data Documentation

Vector3 ParticleUniverse::ParticleRenderer::_mRendererScale
protected

Although the scale is on a Particle System level, the renderer can also be scaled.

bool ParticleUniverse::ParticleRenderer::autoRotate
const uint8 ParticleUniverse::ParticleRenderer::DEFAULT_RENDER_QUEUE_GROUP
static
const Real ParticleUniverse::ParticleRenderer::DEFAULT_SOFT_PARTICLES_CONTRAST_POWER
static
const Real ParticleUniverse::ParticleRenderer::DEFAULT_SOFT_PARTICLES_DELTA
static
const Real ParticleUniverse::ParticleRenderer::DEFAULT_SOFT_PARTICLES_SCALE
static
const bool ParticleUniverse::ParticleRenderer::DEFAULT_SORTED
static
const uchar ParticleUniverse::ParticleRenderer::DEFAULT_TEXTURECOORDS_COLUMNS
static
const uchar ParticleUniverse::ParticleRenderer::DEFAULT_TEXTURECOORDS_ROWS
static
const bool ParticleUniverse::ParticleRenderer::DEFAULT_USE_SOFT_PARTICLES
static
Ogre::BillboardSet* ParticleUniverse::ParticleRenderer::mBillboardSet
protected
bool ParticleUniverse::ParticleRenderer::mCullIndividual
protected
Real ParticleUniverse::ParticleRenderer::mDepth
protected
bool ParticleUniverse::ParticleRenderer::mDepthCheckEnabled
protected

Original material (pass) settings.

bool ParticleUniverse::ParticleRenderer::mDepthWriteEnabled
protected
Real ParticleUniverse::ParticleRenderer::mHeight
protected
bool ParticleUniverse::ParticleRenderer::mNotifiedDepthMap
protected

In case soft particles are used, the renderer notifies the ParticleSystemManager until notification succeeded. The notification may be done multiple times, because a camera is needed from the Parent System, and it is not guaranteed that it already exists.

ParticleTechnique* ParticleUniverse::ParticleRenderer::mParentTechnique
protected
uint8 ParticleUniverse::ParticleRenderer::mQueueId
protected

Defines the renderqueue.

bool ParticleUniverse::ParticleRenderer::mRendererInitialised
protected

Determines whether renderer is initialised.

String ParticleUniverse::ParticleRenderer::mRendererType
protected
Real ParticleUniverse::ParticleRenderer::mSoftParticlesContrastPower
protected

Soft particles properties.

Real ParticleUniverse::ParticleRenderer::mSoftParticlesDelta
protected
Real ParticleUniverse::ParticleRenderer::mSoftParticlesScale
protected
bool ParticleUniverse::ParticleRenderer::mSorted
protected

Determines whether the visual particles must be sorted.

uchar ParticleUniverse::ParticleRenderer::mTextureCoordsColumns
protected

If an atlas texture is used, it is possible to define texture coordinates. This is the number of image columns (slices) in the atlas texture.

uchar ParticleUniverse::ParticleRenderer::mTextureCoordsRows
protected

If an atlas texture is used, it is possible to define texture coordinates. This is the number of image rows (stacks) in the atlas texture.

bool ParticleUniverse::ParticleRenderer::mTextureCoordsRowsAndColumnsSet
protected

If mTextureCoordsRows and mTextureCoordsColumns are set, this boolean is set to true, indicating that Texture Coordinates are used.

bool ParticleUniverse::ParticleRenderer::mTextureCoordsSet
protected

If textureCoords are set individually, this boolean is set to true, indicating that Texture Coordinates are used.

bool ParticleUniverse::ParticleRenderer::mUseSoftParticles
protected

Determines whether soft particles are used.

vector<Ogre::FloatRect*> ParticleUniverse::ParticleRenderer::mUVList
protected

List of texture coordinates.

bool ParticleUniverse::ParticleRenderer::mVisible
protected

Determines visibility of the renderer. This means that particles arenīt renderer anymore.

Real ParticleUniverse::ParticleRenderer::mWidth
protected

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