Public Member Functions |
| cParticle (cParticle *original) |
void | applyGravityForce (float *gravity_m_per_s) |
| Apply gravity to the particle's force, eg with float g[] = {0,-9.8f,0}.
|
void | applyFrictionForce (float dt) |
| Apply fake friction based on velocity and mass.
|
void | applyAirdragForce (float density_kg_per_m3=1.204f) |
| Apply billboard airdrag based on front surface area and cw-value.
|
void | stepEuler (float dt, float damping=0.01f) |
void | stepVerlet (float dt_inv, float dt2, float damping=0.01f) |
Static Public Member Functions |
static void | stepEuler (float *pos, float *old, float *vel, float *fce, float mass_inv, float dt, float damping=0.01f) |
static void | stepVerlet (float *pos, float *old, float *vel, float *fce, float mass_inv, float dt_inv, float dt2, float damping=0.01f) |
static float | collideParticleWithSphere (float *particle3fv, float *center3fv, float radius, float *projection3fv) |
static float | collideParticleWithCylinder (float *particle3fv, float *base3fv, float radius, float height, float *projection3fv) |
static float | collideParticleWithAABB (float *particle3fv, float *min3fv, float *max3fv, float *projection3fv) |
Public Attributes |
std::vector< float > | ori |
| Particle orientation quaternion - may use as euler.
|
std::vector< float > | pos |
| Particle position vector.
|
std::vector< float > | old |
| Particle old position vector.
|
std::vector< float > | vel |
| Particle velocity vector.
|
std::vector< float > | fce |
| Particle force accumulation vector.
|
float | mass |
| Particle mass.
|
float | mass_inv |
| The inverse of the particle mass is often neccessary.
|
float | friction |
| Set when having contact according to contact-depth and material.
|
float | cwm2 |
| CW coefficient times area in m2 for calculating air-drag.
|
float | fuel |
| Remaining fuel in seconds.
|
float | timer |
| Time since start.
|
float | spawn |
| Countdown til spawning next Smoke-Particle.
|
OID | target |
| Object-ID of Particle target - attraction object or evasion.
|
float | radius |
| Abstract dimension of Particle by sphere radius.
|
unsigned int | sound |
| A sound-source-id just in case this particle emits sound.
|
unsigned int | texture |
| A texture-id when a particle has an individual texture.
|
int | type |
| User-type specifier or flags, program defines behavior and shape.
|
void * | data |
| Specific user-data - eg billboard text, color curves, object, etc.
|
std::list< cParticle * > | trail |
| Recursive sub Particles - or trail of particles.
|
A Particle can be anything from bullets over flares to smoke. It has a position and a velocity. Besides it has a lifetime countdown (fuel), a time in existence timer and a spawn countdown which is for spawning particle offspring. A particle can have a trail consisting of other particles like smoke or other recursive systems (in this context I hereby coin the term Particle-Tree ;). Note: There are ways to produces trees (plants) using particle systems but that's another story.