csNewParticleSystem Class Reference
[Common Plugin Classes]
This is an abstract implementation of a particle system mesh object.
More...
#include <csplugincommon/particlesys/particle.h>
Inheritance diagram for csNewParticleSystem:

Public Member Functions | |
csNewParticleSystem (iEngine *, iMeshObjectFactory *, int ParticleFlags) | |
constructor | |
virtual | ~csNewParticleSystem () |
destructor | |
void | SetCount (int num) |
grow or shrink the storage area to the specified amount of particles | |
void | Compact () |
free as much storage area as possible | |
void | UpdateBounds () |
update the bounding box based on particle positions | |
virtual void | Update (csTicks passedTime) |
update the system. | |
virtual iMeshObjectFactory * | GetFactory () const |
Returns 0 since there is no factory for a particle system. | |
virtual csRenderMesh ** | GetRenderMeshes (int &n, iRenderView *rview, iMovable *movable, uint32 frustum_mask) |
See imesh/object.h for specification. | |
void | UpdateLighting (const csArray< iLight * > &, iMovable *) |
update lighting info | |
virtual void | NextFrame (csTicks current_time, const csVector3 &pos) |
calls Update() with the amount of time passed since the previous call | |
virtual bool | SetColor (const csColor &color) |
Set the base color. | |
virtual void | AddColor (const csColor &color) |
Add to the current color. | |
virtual const csColor & | GetColor () const |
Return the base color. | |
virtual bool | SetMaterialWrapper (iMaterialWrapper *material) |
Set the material to use. | |
virtual iMaterialWrapper * | GetMaterialWrapper () const |
Return the current material. | |
virtual bool | GetLighting () const |
Return whether this particle system applies lighting. | |
virtual void | SetLighting (bool enable) |
Set whether this particle system applies lighting. | |
virtual void | GetObjectBoundingBox (csBox3 &bbox) |
See igeom/objmodel.h for specification. | |
virtual void | SetObjectBoundingBox (const csBox3 &bbox) |
See igeom/objmodel.h for specification. | |
void | SetSelfDestruct (csTicks t) |
Set selfdestruct mode on, and msec to live. | |
void | UnSetSelfDestruct () |
system will no longer self destruct | |
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. | |
void | SetChangeColor (const csColor &col) |
Change color of all particles, by col per second. | |
void | UnsetChangeColor () |
Stop change of color. | |
bool | GetChangeColor (csColor &col) const |
see if change color is enabled, and get a copy if so. | |
void | SetChangeSize (float factor) |
Change size of all particles, by factor per second. | |
void | UnsetChangeSize () |
Stop change of size. | |
bool | GetChangeSize (float &factor) const |
see if change size is enabled, and get the value if so. | |
void | SetAlpha (float alpha) |
Set the alpha of particles. | |
float | GetAlpha () const |
Get the probable alpha of the particles. | |
void | SetChangeAlpha (float factor) |
Change alpha of all particles, by factor per second. | |
void | UnsetChangeAlpha () |
Stop change of alpha. | |
bool | GetChangeAlpha (float &factor) const |
see if change alpha is enabled, and get the value if so. | |
void | SetChangeRotation (float angle) |
Change rotation of all particles, by angle in radians per second. | |
void | UnsetChangeRotation () |
Stop change of rotation. | |
bool | GetChangeRotation (float &angle) const |
see if change rotation is enabled, and get the angle if so. | |
Protected Member Functions | |
virtual void | Allocate (int newsize, int copysize) |
This function re-allocates the data arrays to 'newsize' and copies 'copysize' items from the old arrays. | |
void | SetupParticles (const csReversibleTransform &, csVector3 *vertices) |
Setup particles in the given tables right before they are drawn. | |
Protected Attributes | |
iMeshObjectFactory * | Factory |
the mesh factory (should be an empty frame) | |
int | StorageCount |
currently allocated amount of storage for particles | |
int | ParticleFlags |
flags | |
int | ParticleCount |
number of particles in the system | |
csVector3 * | PositionArray |
position values | |
csVector2 | Scale |
uniform scaling | |
float | Angle |
uniform rotation | |
csColor | Color |
uniform base color | |
uint | MixMode |
mixing mode | |
csRef< iMaterialWrapper > | Material |
uniform material | |
csVector3 | Axis |
uniform axis alignment | |
csTicks | PrevTime |
previous time in the NextFrame() method | |
bool | self_destruct |
Self destruct and when. | |
bool | change_color |
Color change. | |
bool | change_size |
Size change. | |
bool | change_alpha |
Alpha change. | |
bool | change_rotation |
Rotate particles, angle in radians. |
Detailed Description
This is an abstract implementation of a particle system mesh object.It stores particle information (like position, rotation, scale, etc.) and knows how to draw the particles. It is abstract because it does not know how the particles move. This is done in the Update() method which must be implemented by subclasses. All features like scale and rotation can be disabled, enabled with global values and enabled with per-particle values.
Definition at line 65 of file particle.h.
Constructor & Destructor Documentation
|
constructor
|
|
destructor
|
Member Function Documentation
|
Add to the current color.
|
|
This function re-allocates the data arrays to 'newsize' and copies 'copysize' items from the old arrays. Subclasses can override this method to get notified (when they use their own arrays). |
|
free as much storage area as possible
|
|
Get the probable alpha of the particles.
Definition at line 261 of file particle.h. |
|
see if change alpha is enabled, and get the value if so.
Definition at line 268 of file particle.h. |
|
see if change color is enabled, and get a copy if so.
Definition at line 245 of file particle.h. |
|
see if change rotation is enabled, and get the angle if so.
Definition at line 282 of file particle.h. |
|
see if change size is enabled, and get the value if so.
Definition at line 254 of file particle.h. |
|
Return the base color.
|
|
Returns 0 since there is no factory for a particle system.
Implements csMeshObject. |
|
Return whether this particle system applies lighting.
|
|
Return the current material.
Reimplemented from csMeshObject. |
|
See igeom/objmodel.h for specification. The default implementation returns an infinite bounding box. Reimplemented from csMeshObject. Definition at line 218 of file particle.h. |
|
See imesh/object.h for specification. The default implementation does nothing and always returns 0. @@ Note: in future it would be better that the default implementation does nothing as this function has to be implemented by mesh objects. Reimplemented from csMeshObject. |
|
returns whether the system will self destruct
Definition at line 235 of file particle.h. |
|
if the system will self destruct, returns the time to live in msec.
Definition at line 237 of file particle.h. References csTicks. |
|
calls Update() with the amount of time passed since the previous call
Reimplemented from csMeshObject. |
|
Set the alpha of particles.
Definition at line 258 of file particle.h. References CS_FX_SETALPHA. |
|
Change alpha of all particles, by factor per second.
Definition at line 263 of file particle.h. |
|
Change color of all particles, by col per second.
Definition at line 240 of file particle.h. |
|
Change rotation of all particles, by angle in radians per second.
Definition at line 272 of file particle.h. |
|
Change size of all particles, by factor per second.
Definition at line 249 of file particle.h. |
|
Set the base color.
Reimplemented from csMeshObject. |
|
grow or shrink the storage area to the specified amount of particles
|
|
Set whether this particle system applies lighting.
|
|
Set the material to use.
Reimplemented from csMeshObject. |
|
See igeom/objmodel.h for specification. Overrides the default bounding box. Reimplemented from csMeshObject. Definition at line 223 of file particle.h. |
|
Set selfdestruct mode on, and msec to live.
Definition at line 230 of file particle.h. |
|
Setup particles in the given tables right before they are drawn.
|
|
Stop change of alpha.
Definition at line 266 of file particle.h. |
|
Stop change of color.
Definition at line 243 of file particle.h. |
|
Stop change of rotation.
Definition at line 280 of file particle.h. |
|
Stop change of size.
Definition at line 252 of file particle.h. |
|
system will no longer self destruct
Definition at line 233 of file particle.h. |
|
update the system.
|
|
update the bounding box based on particle positions
|
|
update lighting info
|
Member Data Documentation
|
uniform rotation
Definition at line 108 of file particle.h. |
|
uniform axis alignment
Definition at line 120 of file particle.h. |
|
Alpha change.
Definition at line 146 of file particle.h. |
|
Color change.
Definition at line 142 of file particle.h. |
|
Rotate particles, angle in radians.
Definition at line 148 of file particle.h. |
|
Size change.
Definition at line 144 of file particle.h. |
|
uniform base color
Definition at line 111 of file particle.h. |
|
the mesh factory (should be an empty frame)
Definition at line 69 of file particle.h. |
|
uniform material
Definition at line 117 of file particle.h. |
|
mixing mode
Definition at line 114 of file particle.h. |
|
number of particles in the system
Definition at line 99 of file particle.h. |
|
flags
Definition at line 96 of file particle.h. |
|
position values
Definition at line 102 of file particle.h. |
|
previous time in the NextFrame() method
Definition at line 123 of file particle.h. |
|
uniform scaling
Definition at line 105 of file particle.h. |
|
Self destruct and when.
Definition at line 138 of file particle.h. |
|
currently allocated amount of storage for particles
Definition at line 93 of file particle.h. |
The documentation for this class was generated from the following file:
- csplugincommon/particlesys/particle.h
Generated for Crystal Space by doxygen 1.3.9.1