GpuThesis::ParticleSystem Class Reference

#include <ParticleSystem.h>

Inheritance diagram for GpuThesis::ParticleSystem:

GpuThesis::Runnable GpuThesis::ParticleSystem3d GpuThesis::ParticleSystemSlice List of all members.

Public Member Functions

 ParticleSystem (unsigned int numParticles, const std::string &particleSplat, float splatThreshold, float domainScale, bool useVBO=true)
void renderParticles () const
void readParticlePositions (float *positions) const
void setSpawnPositions (const std::vector< float > &positions)
void setSpawnVelocities (const std::vector< float > &velocities)
void setSpawnTimes (const std::vector< float > &times)
void setGravity (float gravity)
void setVisibilityThreshold (float visibilityThreshold)
void setMinimumLifeTime (float minimumLifeTime)
float getVisibilityThreshold () const
float getMinimumLifeTime () const
void setParticleSize (float size)
float getParticleSize () const
unsigned int getNumParticles () const
OpenGL::TextureContainergetTextureContainer () const
unsigned int getBlendFunc () const
void setBlendFunc (unsigned int value)
bool getDrawBox () const
void setDrawBox (bool drawBox)
void advect (const Math::Vector3d &distance)

Private Member Functions

void doRun (float timestep)
void doReset ()

Detailed Description

The ParticleSystem class.


Constructor & Destructor Documentation

GpuThesis::ParticleSystem::ParticleSystem unsigned int  numParticles,
const std::string &  particleSplat,
float  splatThreshold,
float  domainScale,
bool  useVBO = true
 

Constructs a standard particle system. The particle velocities are determined by the fluid velocity texture, and the particle colors by the fluid color texture.

Parameters:
numParticles the number of particles in the particle system.
splatThreshold the lowest intensity of the splat that should be visible.
domainScale the scale of the particle domain with respect to the simulation domain.
particleSplat the image to be used as texture for each particle.
useVBO if the implementation shall use Vertex Buffer Object.


Member Function Documentation

void GpuThesis::ParticleSystem::advect const Math::Vector3d &  distance  ) 
 

Advect all particles.

Parameters:
distance the distance to advect (in local space).

void GpuThesis::ParticleSystem::doReset  )  [private, virtual]
 

Implemented by subclasses.

Implements GpuThesis::Runnable.

void GpuThesis::ParticleSystem::doRun float  timestep  )  [private, virtual]
 

Implemented by subclasses.

Parameters:
timestep The timestep to run.

Implements GpuThesis::Runnable.

unsigned int GpuThesis::ParticleSystem::getBlendFunc  )  const
 

Returns the type of blend function used when rendering the particles.

Returns:
the type of blend function.

bool GpuThesis::ParticleSystem::getDrawBox  )  const
 

Returns whether a box is drawn around the domain where the particle system operates.

Returns:
whether a box is drawn.

float GpuThesis::ParticleSystem::getMinimumLifeTime  )  const
 

Gets the minimum lifetime of the particles.

Returns:
the minimum particle lifetime.

unsigned int GpuThesis::ParticleSystem::getNumParticles  )  const
 

Returns the number of particles in the particle system.

Returns:
the number of particles.

float GpuThesis::ParticleSystem::getParticleSize  )  const
 

Returns the particle size.

Returns:
the particle size.

OpenGL::TextureContainer * GpuThesis::ParticleSystem::getTextureContainer  )  const
 

Returns the texture container containing the textures used by the particle system.

Returns:
the texture container.

float GpuThesis::ParticleSystem::getVisibilityThreshold  )  const
 

Gets the alpha threshold at which the particles will respawn.

Returns:
the visibility threshold of the particle's alpha color.

void GpuThesis::ParticleSystem::readParticlePositions float *  positions  )  const
 

Reads the particle positions into a float array.

Parameters:
positions float array of size at least 3 * numParticles

void GpuThesis::ParticleSystem::renderParticles  )  const
 

Renders the particles to the screen based on their positions.

void GpuThesis::ParticleSystem::setBlendFunc unsigned int  value  ) 
 

Sets the type of blend function used when rendering the particles.

Parameters:
value the new type of blend function.

void GpuThesis::ParticleSystem::setDrawBox bool  drawBox  ) 
 

Sets whether a box should be drawn around the domain where the particle system operates.

Parameters:
drawBox whether a box should be drawn.

void GpuThesis::ParticleSystem::setGravity float  gravity  ) 
 

Sets the gravity constant to be used in the particle system.

Parameters:
gravity the new gravity constant.

void GpuThesis::ParticleSystem::setMinimumLifeTime float  minimumLifeTime  ) 
 

Sets the minimum lifetime of the particles.

Parameters:
minimumLifeTime the minimum particle lifetime.

void GpuThesis::ParticleSystem::setParticleSize float  size  ) 
 

Sets the particle size.

Parameters:
size the new particle size.

void GpuThesis::ParticleSystem::setSpawnPositions const std::vector< float > &  positions  ) 
 

Sets the positions where the particles spawn. The position vector should be on the form (x, y, z) * numParticles.

Parameters:
positions the spawn positions.

void GpuThesis::ParticleSystem::setSpawnTimes const std::vector< float > &  times  ) 
 

Sets the particle spawn times. These times indicate the time from the particle system is initialized to the particles spawn. The time vector should be on the form (time) * numParticles.

Parameters:
times the spawn times in seconds.

void GpuThesis::ParticleSystem::setSpawnVelocities const std::vector< float > &  velocities  ) 
 

Sets the velocities the particles should have when spawn. The velocity vector should be on the form (x, y, z) * numParticles.

Parameters:
velocities the spawn velocities.

void GpuThesis::ParticleSystem::setVisibilityThreshold float  visibilityThreshold  ) 
 

Sets the alpha threshold at which the particles will respawn.

Parameters:
visibilityThreshold the visibility threshold of the particle's alpha color.


The documentation for this class was generated from the following files:
Generated on Fri Jun 16 08:42:51 2006 for GPU Thesis by  doxygen 1.4.6-NO