Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | Related Pages

ParticleGenerator Class Reference

#include <particle.h>

Inheritance diagram for ParticleGenerator:

Inheritance graph
[legend]
Collaboration diagram for ParticleGenerator:

Collaboration graph
[legend]
List of all members.

Detailed Description

Base class for particle generators Generate particles for a particle system.

Author:
Mattias Jansson (mattias@realityrift.com)


Public Member Functions

 ParticleGenerator (float fVelocity, float fVelocityAccuracy, float fDensity, ParticleAllocatorCallback *pkAllocatorCallback=0)
virtual ~ParticleGenerator ()
virtual unsigned int Generate (float fDeltaTime, unsigned int uiMaxParticles, Particle **ppkParticles, const Vector3d &kPos)=0

Protected Member Functions

virtual void Allocate (unsigned int uiNumParticles, Particle **ppkParticles)

Protected Attributes

float m_fFraction
float m_fVelocity
float m_fVelocityAccuracy
float m_fDensity
ParticleAllocatorCallbackm_pkAllocatorCallback


Constructor & Destructor Documentation

ParticleGenerator float  fVelocity,
float  fVelocityAccuracy,
float  fDensity,
ParticleAllocatorCallback pkAllocatorCallback = 0
[inline]
 

Parameters:
fVelocity Initial velocity of generated particles
fVelocityAccuracy Accuracy of initial velocity. 1.0f mean all particles will have _exactly_ fVelocity, 0.0f means a range of 0.0f < vel < 2.0f*fVelocity
fDensity Density (particles per second)
pkAllocatorCallback Callback to call when new particle is generated

virtual ~ParticleGenerator  )  [inline, virtual]
 


Member Function Documentation

virtual void Allocate unsigned int  uiNumParticles,
Particle **  ppkParticles
[protected, virtual]
 

Allocate new particles

Parameters:
uiNumParticles Number of particles to allocate
ppkParticles Pointer to array of pointers receiving new particles

virtual unsigned int Generate float  fDeltaTime,
unsigned int  uiMaxParticles,
Particle **  ppkParticles,
const Vector3d kPos
[pure virtual]
 

Implement for specific generator

Parameters:
fDeltaTime Deltatime (time*density = particles_to_generate)
uiMaxParticles Maximum number of particles to generate or 0 if infinite
ppkParticles Pointer to array of pointers receiving new particles
kPos Position of generator
Returns:
Number of particles generated

Implemented in SphereParticleGenerator.


Member Data Documentation

float m_fFraction [protected]
 

Fraction part of last generation (if a Generate call produces 0.9 particles, we want to store this to next call)

float m_fVelocity [protected]
 

Initial velocity of new particles

float m_fVelocityAccuracy [protected]
 

Accuracy of initial velocity

float m_fDensity [protected]
 

Density (particles per second we will generate)

ParticleAllocatorCallback* m_pkAllocatorCallback [protected]
 

Allocation callback. Will be called for each new particle this generator allocates


The documentation for this class was generated from the following file:
Generated on Wed Jan 21 14:21:12 2004 for NeoEngine by doxygen 1.3.5