A ParticleLayer to advect particles in world space by using a velocity field defined on one or more terrains. More...
#include <TerrainParticleLayer.h>
Classes | |
struct | TerrainInfo |
Contains a SceneNode and its corresponding TerrainNode. More... | |
struct | TerrainParticle |
Layer specific particle data for managing particles on terrains. More... | |
Public Member Functions | |
TerrainParticleLayer (map< ptr< TileProducer >, TerrainInfo * > infos) | |
Creates a new TerrainParticleLayer. | |
virtual | ~TerrainParticleLayer () |
Deletes this LifeCycleParticleLayer. | |
TerrainParticle * | getTerrainParticle (ParticleStorage::Particle *p) |
Returns the screen space specific data of the given particle. | |
virtual void | getReferencedProducers (vector< ptr< TileProducer > > &producers) const |
Returns the tile producers used by this ParticleLayer. | |
virtual void | moveParticles (double dt) |
Moves the existing particles. | |
Protected Member Functions | |
TerrainParticleLayer () | |
Creates an uninitialized TerrainParticleLayer. | |
void | init (map< ptr< TileProducer >, TerrainInfo * > infos) |
Initializes this TerrainParticleLayer. | |
virtual void | initialize () |
Initializes this ParticleLayer. | |
virtual void | initParticle (ParticleStorage::Particle *p) |
Initializes the data that is specific to this layer in the given particle. | |
ptr< FlowTile > | findFlowTile (ptr< TileProducer > producer, TileCache::Tile *t, vec3d &pos) |
Finds the FlowTile from a given TileProducer at given local coordinates. | |
ptr< FlowTile > | getFlowTile (TerrainParticle *t) |
Returns the FlowTile required to compute the velocity of a given TerrainParticle. | |
ptr< TileProducer > | getFlowProducer (ParticleStorage::Particle *p) |
Returns the TileProducer associated to the terrain on which a given Particle is. | |
Protected Attributes | |
map< ptr< TileProducer > , TerrainInfo * > | infos |
Each flow producer mapped to its SceneNode. | |
Private Attributes | |
LifeCycleParticleLayer * | lifeCycleLayer |
The layer managing the life cycle of particles. | |
ScreenParticleLayer * | screenLayer |
The layer managing the particles in screen space. | |
WorldParticleLayer * | worldLayer |
The layer managing the particles in world space. |
A ParticleLayer to advect particles in world space by using a velocity field defined on one or more terrains.
This layer requires particles world positions and velocities to be managed by a WorldParticleLayer.
proland::TerrainParticleLayer::TerrainParticleLayer | ( | map< ptr< TileProducer >, TerrainInfo * > | infos | ) |
Creates a new TerrainParticleLayer.
infos | each flow producer mapped to its SceneNode. |
virtual proland::TerrainParticleLayer::~TerrainParticleLayer | ( | ) | [virtual] |
Deletes this LifeCycleParticleLayer.
proland::TerrainParticleLayer::TerrainParticleLayer | ( | ) | [protected] |
Creates an uninitialized TerrainParticleLayer.
ptr<FlowTile> proland::TerrainParticleLayer::findFlowTile | ( | ptr< TileProducer > | producer, | |
TileCache::Tile * | t, | |||
vec3d & | pos | |||
) | [protected] |
Finds the FlowTile from a given TileProducer at given local coordinates.
producer | the TileProducer used to create the FlowTiles. | |
t | the last browsed FlowTile. | |
pos | local terrain coordinates for which we need the FlowTile. |
ptr<TileProducer> proland::TerrainParticleLayer::getFlowProducer | ( | ParticleStorage::Particle * | p | ) | [protected] |
Returns the TileProducer associated to the terrain on which a given Particle is.
ptr<FlowTile> proland::TerrainParticleLayer::getFlowTile | ( | TerrainParticle * | t | ) | [protected] |
Returns the FlowTile required to compute the velocity of a given TerrainParticle.
virtual void proland::TerrainParticleLayer::getReferencedProducers | ( | vector< ptr< TileProducer > > & | producers | ) | const [virtual] |
Returns the tile producers used by this ParticleLayer.
[out] | producers | the tile producers used by this ParticleLayer. |
Reimplemented from proland::ParticleLayer.
TerrainParticle* proland::TerrainParticleLayer::getTerrainParticle | ( | ParticleStorage::Particle * | p | ) | [inline] |
Returns the screen space specific data of the given particle.
p | a particle. |
void proland::TerrainParticleLayer::init | ( | map< ptr< TileProducer >, TerrainInfo * > | infos | ) | [protected] |
Initializes this TerrainParticleLayer.
See TerrainParticleLayer.
virtual void proland::TerrainParticleLayer::initialize | ( | ) | [protected, virtual] |
Initializes this ParticleLayer.
If this layer needs reference to other layers it can initialize them in this method (using the template method ParticleProducer::getLayer()). The default implementation of this method does nothing.
Reimplemented from proland::ParticleLayer.
virtual void proland::TerrainParticleLayer::initParticle | ( | ParticleStorage::Particle * | p | ) | [protected, virtual] |
Initializes the data that is specific to this layer in the given particle.
The default implementation of this method does nothing.
Reimplemented from proland::ParticleLayer.
virtual void proland::TerrainParticleLayer::moveParticles | ( | double | dt | ) | [virtual] |
Moves the existing particles.
The default implementation of this method does nothing.
dt | the elapsed time since the last call to this method, in microseconds. |
Reimplemented from proland::ParticleLayer.
map<ptr<TileProducer>, TerrainInfo*> proland::TerrainParticleLayer::infos [protected] |
Each flow producer mapped to its SceneNode.
The layer managing the life cycle of particles.
The layer managing the particles in screen space.
The layer managing the particles in world space.