csParticleSystem Class Reference
[Common Plugin Classes]
This class represents a particle system.
More...
#include <csplugincommon/particlesys/partgen.h>
Inherits scfImplementationExt2<csParticleSystem, csObjectModel, iMeshObject, iParticleState>.
Inherited by scfImplementationExt0< csNewtonianParticleSystem, csParticleSystem >, and scfImplementationExt0< csNewtonianParticleSystem, csParticleSystem >.
Public Member Functions | |
| virtual void | AddColor (const csColor &col) |
| Add particle colors, convenience function. | |
| void | AppendParticle (iMeshObject *mesh, iParticle *part, iSprite2DState *spr2d) |
| Add a new particle, increases num_particles. Do a DecRef yourself. | |
| void | AppendRectSprite (float width, float height, iMaterialWrapper *mat, bool lighted) |
| Add an rectangle shaped sprite2d particle. | |
| void | AppendRegularSprite (int n, float radius, iMaterialWrapper *mat, bool lighted) |
| Add a sprite2d n-gon with material, and given radius. | |
| virtual void | BuildDecal (const csVector3 *pos, float decalRadius, iDecalBuilder *decalBuilder) |
| see imesh/object.h for specification. | |
| csParticleSystem (iObjectRegistry *object_reg, iMeshObjectFactory *factory) | |
| Make a new system. | |
| float | GetAlpha () const |
| Get the probable alpha of the particles. | |
| const csBox3 & | GetBoundingBox () const |
| Get the bounding box for this particle system. | |
| bool | GetChangeAlpha (float &factor) const |
| see if change alpha is enabled, and get the value if so. | |
| bool | GetChangeColor (csColor &col) const |
| see if change color is enabled, and get a copy if so. | |
| bool | GetChangeRotation (float &angle) const |
| see if change rotation is enabled, and get the angle if so. | |
| bool | GetChangeSize (float &factor) const |
| see if change size is enabled, and get the value if so. | |
| size_t | GetNumParticles () const |
| How many particles the system currently has. | |
| iParticle * | GetParticle (size_t idx) const |
| Get a particle. | |
| size_t | GetParticleCount () const |
| Get the number of particles. | |
| bool | GetSelfDestruct () const |
| returns whether the system will self destruct | |
| csTicks | GetTimeToLive () const |
| if the system will self destruct, returns the time to live in msec. | |
| virtual void | PositionChild (iMeshObject *, csTicks) |
| see imesh/object.h for specification. | |
| void | RemoveParticles () |
| Remove all particles. | |
| virtual void | Rotate (float angle) |
| Rotate all particles. | |
| virtual void | ScaleBy (float factor) |
| Scale all particles. | |
| void | SetAlpha (float alpha) |
| Set the alpha of particles. | |
| void | SetChangeAlpha (float factor) |
| Change alpha of all particles, by factor per second. | |
| void | SetChangeColor (const csColor &col) |
| Change color of all particles, by col per second. | |
| void | SetChangeRotation (float angle) |
| Change rotation of all particles, by angle in radians per second. | |
| void | SetChangeSize (float factor) |
| Change size of all particles, by factor per second. | |
| virtual void | SetParticleCount (size_t num) |
| Set the number of particles to use. | |
| void | SetSelfDestruct (csTicks t) |
| Set selfdestruct mode on, and msec to live. | |
| virtual void | SetupColor () |
| Set particle colors, convenience function. | |
| virtual void | SetupMixMode () |
| Set particle mixmodes, convenience function. | |
| void | UnsetChangeAlpha () |
| Stop change of alpha. | |
| void | UnsetChangeColor () |
| Stop change of color. | |
| void | UnsetChangeRotation () |
| Stop change of rotation. | |
| void | UnsetChangeSize () |
| Stop change of size. | |
| void | UnSetSelfDestruct () |
| system will no longer self destruct | |
| virtual void | Update (csTicks elapsed_time) |
| Update the state of the particles as time has passed. | |
| virtual | ~csParticleSystem () |
| Destroy particle system, and all particles. | |
Protected Member Functions | |
| csVector3 | GetRandomDirection (csVector3 const &magnitude, csVector3 const &offset) |
| Return vector with -1..+1 members. Varying length. | |
| csVector3 | GetRandomDirection () |
| Return vector with -1..+1 members. Varying length. | |
| csVector3 | GetRandomPosition (csBox3 const &box) |
| Return vector with random position within box. | |
| void | SetupBuffers (size_t part_sides) |
| Setup the buffers for the particles. | |
| virtual void | SetupObject () |
| Setup this object. | |
Protected Attributes | |
| csBox3 | bbox |
| bounding box in 3d of all particles in this system. | |
| bool | change_alpha |
| Alpha change. | |
| bool | change_color |
| Color change. | |
| bool | change_rotation |
| Rotate particles, angle in radians. | |
| bool | change_size |
| Size change. | |
| csColor | color |
| Color of all particles. | |
| csRef< iMaterialWrapper > | mat |
| Material for all particles. | |
| uint | MixMode |
| MixMode for all particles. | |
| csVector3 * | part_pos |
| particle position | |
| csRefArray< iMeshObject > | partmeshes |
| iParticle ptrs to the particles. | |
| csTicks | prev_time |
| Previous time. | |
| float | radius |
| Object space radius. | |
| bool | self_destruct |
| Self destruct and when. | |
| csRef< iMeshObjectFactory > | spr_factory |
| Pointer to a mesh object factory for 2D sprites. | |
Detailed Description
This class represents a particle system.It is a set of iParticles. Subclasses of this class may be of more interest to users. More specialised particle systems can be found below.
Definition at line 63 of file partgen.h.
Constructor & Destructor Documentation
| csParticleSystem::csParticleSystem | ( | iObjectRegistry * | object_reg, | |
| iMeshObjectFactory * | factory | |||
| ) |
Make a new system.
Also adds the particle system to the list of the current engine.
| virtual csParticleSystem::~csParticleSystem | ( | ) | [virtual] |
Destroy particle system, and all particles.
Member Function Documentation
| virtual void csParticleSystem::AddColor | ( | const csColor & | col | ) | [virtual] |
Add particle colors, convenience function.
| void csParticleSystem::AppendParticle | ( | iMeshObject * | mesh, | |
| iParticle * | part, | |||
| iSprite2DState * | spr2d | |||
| ) | [inline] |
| void csParticleSystem::AppendRectSprite | ( | float | width, | |
| float | height, | |||
| iMaterialWrapper * | mat, | |||
| bool | lighted | |||
| ) |
Add an rectangle shaped sprite2d particle.
Pass along half w and h. adds sprite to engine list.
| void csParticleSystem::AppendRegularSprite | ( | int | n, | |
| float | radius, | |||
| iMaterialWrapper * | mat, | |||
| bool | lighted | |||
| ) |
Add a sprite2d n-gon with material, and given radius.
adds sprite to engine list.
| virtual void csParticleSystem::BuildDecal | ( | const csVector3 * | pos, | |
| float | decalRadius, | |||
| iDecalBuilder * | decalBuilder | |||
| ) | [inline, virtual] |
see imesh/object.h for specification.
The default implementation does nothing.
| float csParticleSystem::GetAlpha | ( | ) | const [inline] |
| const csBox3& csParticleSystem::GetBoundingBox | ( | ) | const [inline] |
| bool csParticleSystem::GetChangeAlpha | ( | float & | factor | ) | const [inline] |
| bool csParticleSystem::GetChangeColor | ( | csColor & | col | ) | const [inline] |
| bool csParticleSystem::GetChangeRotation | ( | float & | angle | ) | const [inline] |
| bool csParticleSystem::GetChangeSize | ( | float & | factor | ) | const [inline] |
| size_t csParticleSystem::GetNumParticles | ( | ) | const [inline] |
| iParticle* csParticleSystem::GetParticle | ( | size_t | idx | ) | const [inline] |
| size_t csParticleSystem::GetParticleCount | ( | ) | const [inline] |
| csVector3 csParticleSystem::GetRandomDirection | ( | csVector3 const & | magnitude, | |
| csVector3 const & | offset | |||
| ) | [protected] |
Return vector with -1..+1 members. Varying length.
| csVector3 csParticleSystem::GetRandomDirection | ( | ) | [protected] |
Return vector with -1..+1 members. Varying length.
Return vector with random position within box.
| bool csParticleSystem::GetSelfDestruct | ( | ) | const [inline] |
| csTicks csParticleSystem::GetTimeToLive | ( | ) | const [inline] |
| virtual void csParticleSystem::PositionChild | ( | iMeshObject * | , | |
| csTicks | ||||
| ) | [inline, virtual] |
see imesh/object.h for specification.
The default implementation does nothing.
| void csParticleSystem::RemoveParticles | ( | ) |
Remove all particles.
| virtual void csParticleSystem::Rotate | ( | float | angle | ) | [virtual] |
Rotate all particles.
| virtual void csParticleSystem::ScaleBy | ( | float | factor | ) | [virtual] |
Scale all particles.
| void csParticleSystem::SetAlpha | ( | float | alpha | ) | [inline] |
| void csParticleSystem::SetChangeAlpha | ( | float | factor | ) | [inline] |
| void csParticleSystem::SetChangeColor | ( | const csColor & | col | ) | [inline] |
| void csParticleSystem::SetChangeRotation | ( | float | angle | ) | [inline] |
| void csParticleSystem::SetChangeSize | ( | float | factor | ) | [inline] |
| virtual void csParticleSystem::SetParticleCount | ( | size_t | num | ) | [inline, virtual] |
| void csParticleSystem::SetSelfDestruct | ( | csTicks | t | ) | [inline] |
| void csParticleSystem::SetupBuffers | ( | size_t | part_sides | ) | [protected] |
Setup the buffers for the particles.
| virtual void csParticleSystem::SetupColor | ( | ) | [virtual] |
Set particle colors, convenience function.
| virtual void csParticleSystem::SetupMixMode | ( | ) | [virtual] |
Set particle mixmodes, convenience function.
| virtual void csParticleSystem::SetupObject | ( | ) | [protected, virtual] |
Setup this object.
| void csParticleSystem::UnsetChangeAlpha | ( | ) | [inline] |
| void csParticleSystem::UnsetChangeColor | ( | ) | [inline] |
| void csParticleSystem::UnsetChangeRotation | ( | ) | [inline] |
| void csParticleSystem::UnsetChangeSize | ( | ) | [inline] |
| void csParticleSystem::UnSetSelfDestruct | ( | ) | [inline] |
| virtual void csParticleSystem::Update | ( | csTicks | elapsed_time | ) | [virtual] |
Update the state of the particles as time has passed.
i.e. move the particles, retexture, recolor ... this member function will set to_delete if self_destruct is enabled and time is up.
Member Data Documentation
csBox3 csParticleSystem::bbox [protected] |
bool csParticleSystem::change_alpha [protected] |
bool csParticleSystem::change_color [protected] |
bool csParticleSystem::change_rotation [protected] |
bool csParticleSystem::change_size [protected] |
csColor csParticleSystem::color [protected] |
csRef<iMaterialWrapper> csParticleSystem::mat [protected] |
uint csParticleSystem::MixMode [protected] |
csVector3* csParticleSystem::part_pos [protected] |
csRefArray<iMeshObject> csParticleSystem::partmeshes [protected] |
csTicks csParticleSystem::prev_time [protected] |
float csParticleSystem::radius [protected] |
bool csParticleSystem::self_destruct [protected] |
csRef<iMeshObjectFactory> csParticleSystem::spr_factory [protected] |
The documentation for this class was generated from the following file:
- csplugincommon/particlesys/partgen.h
Generated for Crystal Space 1.4.0 by doxygen 1.5.8
