public

Inheritance Graph

graph BT
	ParticleEmitter
	ParticleEmitter --> AbstractNodeBehaviour
	ParticleBoxEmitter --> ParticleEmitter
	ParticlePointEmitter --> ParticleEmitter
	click ParticleEmitter "classMinSG_1_1ParticleEmitter"
	click AbstractNodeBehaviour "classMinSG_1_1AbstractNodeBehaviour"
	click ParticleBoxEmitter "classMinSG_1_1ParticleBoxEmitter"
	click ParticlePointEmitter "classMinSG_1_1ParticlePointEmitter"

Description

An emitter (most likely created using ParticleSystemNode::createEmittter) is used to produce new particles. After creating the emitter is has to be registered with an behavior manager.

ParticleEmitter > AbstractNodeBehaviour

Author: Jans Krems, Benjamin Eikel

Date: 2010-06-15

Protected Attributes

   
   
Geometry::Vec3f direction
   
Geometry::Vec3f up
   
Geometry::Angle directionVarianceAngle
   
float particlesPerSecond
   
float minSpeed
   
float maxSpeed
   
float minLife
   
float maxLife
   
Util::Color4ub minColor
   
Util::Color4ub maxColor
   
uint64_t numEmittedParticles
Number of particles that have been emitted already.
   
float minWidth
   
float maxWidth
   
float minHeight
   
float maxHeight
   
Util::WeakPointer < Node > spawnNode
   
bool enabled
   
std::mt19937 engine
Random number generator.

Public Functions

   
   
  ParticleEmitter( ParticleSystemNode * node)
   
  ~ParticleEmitter()
   
bool isEnabled() const
   
void setSpawnNode( Node * n)
   
Node * getSpawnNode() const
   
const Geometry::Vec3f & getDirection() const
   
void setDirection(const Geometry::Vec3f & dir)
Set direction in which new particles are directed.
   
const Geometry::Angle & getDirectionVarianceAngle() const
Get angle by which the direction can differ.
   
void setDirectionVarianceAngle(const Geometry::Angle & angle)
Set angle by which the direciton can differ.
   
float getParticlesPerSecond() const
Get how many particles should be emitted per second.
   
void setParticlesPerSecond(float pps)
Set how many particles should be emitted per second.
   
float getMinSpeed() const
   
float getMaxSpeed() const
   
void setMinSpeed(float min)
   
void setMaxSpeed(float max)
   
float getMinLife() const
Range of lifetime for newly created particles.
   
float getMaxLife() const
   
void setMinLife(float min)
   
void setMaxLife(float max)
   
const Util::Color4ub & getMinColor() const
Range of color for newly created particles.
   
const Util::Color4ub & getMaxColor() const
   
void setMinColor(const Util::Color4ub & min)
   
void setMaxColor(const Util::Color4ub & max)
   
float getMinWidth() const
Range of size for newly create particles.
   
float getMaxWidth() const
   
float getMinHeight() const
   
float getMaxHeight() const
   
void setMinWidth(float min)
   
void setMaxWidth(float max)
   
void setMinHeight(float min)
   
void setMaxHeight(float max)
   
AbstractBehaviour::timestamp_t getTimeOffset() const
   
void setTimeOffset( AbstractBehaviour::timestamp_t offset)
   
behaviourResult_t doExecute()

Protected Functions

   
   
AbstractBehaviour::timestamp_t getElapsed() const
Return time span between the first execution and the current execution (including the time offset).
   
Geometry::Vec3f getADirection()
[convenience] Generate a direction.
   
Util::Color4ub getAColor() const
[convenience] Generate a color.
   
float getALife() const
[convenience] Generate a life time.
   
float getASpeed() const
[convenience] Generate a speed.
   
Geometry::Vec2f getASize() const
[convenience] Generate a size.
   
void getSpawnCenter( Geometry::Vec3f & v, ParticleSystemNode * psystem) const

Documentation

variable
MinSG::ParticleEmitter::direction

protected
 
 
Geometry::Vec3f direction

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:159


variable
MinSG::ParticleEmitter::up

protected
 
 
Geometry::Vec3f up

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:159


variable
MinSG::ParticleEmitter::directionVarianceAngle

protected
 
 
Geometry::Angle directionVarianceAngle

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:160


variable
MinSG::ParticleEmitter::particlesPerSecond

protected
 
 
float particlesPerSecond

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:161


variable
MinSG::ParticleEmitter::minSpeed

protected
 
 
float minSpeed

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:163


variable
MinSG::ParticleEmitter::maxSpeed

protected
 
 
float maxSpeed

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:163


variable
MinSG::ParticleEmitter::minLife

protected
 
 
float minLife

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:165


variable
MinSG::ParticleEmitter::maxLife

protected
 
 
float maxLife

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:165


variable
MinSG::ParticleEmitter::minColor

protected
 
 
Util::Color4ub minColor

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:167


variable
MinSG::ParticleEmitter::maxColor

protected
 
 
Util::Color4ub maxColor

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:167


variable
MinSG::ParticleEmitter::numEmittedParticles

protected
 
 
uint64_t numEmittedParticles

Number of particles that have been emitted already.

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:170


variable
MinSG::ParticleEmitter::minWidth

protected
 
 
float minWidth

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:172


variable
MinSG::ParticleEmitter::maxWidth

protected
 
 
float maxWidth

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:172


variable
MinSG::ParticleEmitter::minHeight

protected
 
 
float minHeight

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:172


variable
MinSG::ParticleEmitter::maxHeight

protected
 
 
float maxHeight

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:172


variable
MinSG::ParticleEmitter::spawnNode

protected
 
 
Util::WeakPointer < Node > spawnNode

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:174


variable
MinSG::ParticleEmitter::enabled

protected
 
 
bool enabled

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:196


variable
MinSG::ParticleEmitter::engine

protected
 
 
std::mt19937 engine

Random number generator.

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:199


function
MinSG::ParticleEmitter::ParticleEmitter

public
     
     
ParticleEmitter( ParticleSystemNode * node )

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:47


function
MinSG::ParticleEmitter::~ParticleEmitter

public virtual
   
   
~ParticleEmitter( )

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:48


function
MinSG::ParticleEmitter::isEnabled

public const inline
   
   
bool isEnabled( ) const

If this emitter currently is emitting. Some emitter may enable themselves (for example when they are emitting in intervals).

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:54


function
MinSG::ParticleEmitter::setSpawnNode

public inline
     
     
void setSpawnNode( Node * n )

Set a node, newly spawned particles should be positioned at.

If none is set, the position of the particle system node is used.

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:61


function
MinSG::ParticleEmitter::getSpawnNode

public const inline
   
   
Node * getSpawnNode( ) const

Get the node, newly spawned particles should be positioned at.

If none is set, the position of the particle system node is used.

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:68


function
MinSG::ParticleEmitter::getDirection

public const inline
   
   
const Geometry::Vec3f & getDirection( ) const

Get direction in which new particles are directed

See also: getDirectionVarianceAngle

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:75


function
MinSG::ParticleEmitter::setDirection

public inline
     
     
void setDirection( const Geometry::Vec3f & dir )

Set direction in which new particles are directed.

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:78


function
MinSG::ParticleEmitter::getDirectionVarianceAngle

public const inline
   
   
const Geometry::Angle & getDirectionVarianceAngle( ) const

Get angle by which the direction can differ.

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:81


function
MinSG::ParticleEmitter::setDirectionVarianceAngle

public inline
     
     
void setDirectionVarianceAngle( const Geometry::Angle & angle )

Set angle by which the direciton can differ.

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:86


function
MinSG::ParticleEmitter::getParticlesPerSecond

public const inline
   
   
float getParticlesPerSecond( ) const

Get how many particles should be emitted per second.

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:91


function
MinSG::ParticleEmitter::setParticlesPerSecond

public inline
     
     
void setParticlesPerSecond( float pps )

Set how many particles should be emitted per second.

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:94


function
MinSG::ParticleEmitter::getMinSpeed

public const inline
   
   
float getMinSpeed( ) const

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:99


function
MinSG::ParticleEmitter::getMaxSpeed

public const inline
   
   
float getMaxSpeed( ) const

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:100


function
MinSG::ParticleEmitter::setMinSpeed

public inline
     
     
void setMinSpeed( float min )

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:101


function
MinSG::ParticleEmitter::setMaxSpeed

public inline
     
     
void setMaxSpeed( float max )

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:102


function
MinSG::ParticleEmitter::getMinLife

public const inline
   
   
float getMinLife( ) const

Range of lifetime for newly created particles.

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:105


function
MinSG::ParticleEmitter::getMaxLife

public const inline
   
   
float getMaxLife( ) const

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:106


function
MinSG::ParticleEmitter::setMinLife

public inline
     
     
void setMinLife( float min )

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:107


function
MinSG::ParticleEmitter::setMaxLife

public inline
     
     
void setMaxLife( float max )

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:108


function
MinSG::ParticleEmitter::getMinColor

public const inline
   
   
const Util::Color4ub & getMinColor( ) const

Range of color for newly created particles.

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:111


function
MinSG::ParticleEmitter::getMaxColor

public const inline
   
   
const Util::Color4ub & getMaxColor( ) const

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:112


function
MinSG::ParticleEmitter::setMinColor

public inline
     
     
void setMinColor( const Util::Color4ub & min )

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:113


function
MinSG::ParticleEmitter::setMaxColor

public inline
     
     
void setMaxColor( const Util::Color4ub & max )

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:114


function
MinSG::ParticleEmitter::getMinWidth

public const inline
   
   
float getMinWidth( ) const

Range of size for newly create particles.

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:117


function
MinSG::ParticleEmitter::getMaxWidth

public const inline
   
   
float getMaxWidth( ) const

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:118


function
MinSG::ParticleEmitter::getMinHeight

public const inline
   
   
float getMinHeight( ) const

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:119


function
MinSG::ParticleEmitter::getMaxHeight

public const inline
   
   
float getMaxHeight( ) const

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:120


function
MinSG::ParticleEmitter::setMinWidth

public inline
     
     
void setMinWidth( float min )

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:121


function
MinSG::ParticleEmitter::setMaxWidth

public inline
     
     
void setMaxWidth( float max )

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:122


function
MinSG::ParticleEmitter::setMinHeight

public inline
     
     
void setMinHeight( float min )

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:123


function
MinSG::ParticleEmitter::setMaxHeight

public inline
     
     
void setMaxHeight( float max )

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:124


function
MinSG::ParticleEmitter::getTimeOffset

public const inline
   
   
AbstractBehaviour::timestamp_t getTimeOffset( ) const

Return the time offset for the starting time.

Returns

Time offset in seconds.

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:131


function
MinSG::ParticleEmitter::setTimeOffset

public inline
     
     
void setTimeOffset( AbstractBehaviour::timestamp_t offset )

Set the time offset for the starting time.

Parameters

offset
Time offset in seconds.

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:137


function
MinSG::ParticleEmitter::doExecute

public inline virtual
   
   
behaviourResult_t doExecute( )

o Called every frame (if the behaviour is active).

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:139


function
MinSG::ParticleEmitter::getElapsed

protected const inline
   
   
AbstractBehaviour::timestamp_t getElapsed( ) const

Return time span between the first execution and the current execution (including the time offset).

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:151


function
MinSG::ParticleEmitter::getADirection

protected
   
   
Geometry::Vec3f getADirection( )

[convenience] Generate a direction.

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:202


function
MinSG::ParticleEmitter::getAColor

protected const
   
   
Util::Color4ub getAColor( ) const

[convenience] Generate a color.

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:205


function
MinSG::ParticleEmitter::getALife

protected const
   
   
float getALife( ) const

[convenience] Generate a life time.

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:208


function
MinSG::ParticleEmitter::getASpeed

protected const
   
   
float getASpeed( ) const

[convenience] Generate a speed.

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:211


function
MinSG::ParticleEmitter::getASize

protected const
   
   
Geometry::Vec2f getASize( ) const

[convenience] Generate a size.

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:214


function
MinSG::ParticleEmitter::getSpawnCenter

protected const
     
     
void getSpawnCenter( Geometry::Vec3f & v,
  ParticleSystemNode * psystem
) const    

[convenience] If spawnNode is set, position of spawn node relative to psystem, zero elsewise (= position of the particle system). Particle position always are relative to the particle system they are part of.

Defined in MinSG/Ext/ParticleSystem/ParticleEmitters.h:220