Public Member Functions | Public Attributes

ParticleSys Class Reference

Search for all occurrences

Detailed Description

See also:
Class GraphicsWindow, Marker Types, Class HitRegion.

Description:
This class describes a particle system. Methods are available to display, hit test, and compute the bounding box of the particle system. Other methods allocate and free the particles and allow custom particle drawing procedures to be used.
Data Members:
Tab<Point3> points;

The location of each particle.

Tab<Point3> vels;

The velocity of each particle (optional).

Tab<TimeValue> ages;

The age of each particle (optional).

float size;

The world space radius of a particle.

#include <particle.h>

Inheritance diagram for ParticleSys:
Inheritance graph
[legend]

List of all members.

Public Member Functions

DllExport void  Render (GraphicsWindow *gw, MarkerType type=POINT_MRKR)
DllExport BOOL  HitTest (GraphicsWindow *gw, HitRegion *hr, int abortOnHit=FALSE, MarkerType type=POINT_MRKR)
DllExport Box3  BoundBox (Matrix3 *tm=NULL)
DllExport void  FreeAll ()
DllExport void  SetCount (int c, DWORD flags)
int  Count ()
Point3 operator[] (int i)
BOOL  Alive (int i)
void  SetCustomDraw (CustomParticleDisplay *d)

Public Attributes

Tab< Point3 points
Tab< Point3 vels
Tab< TimeValue >  ages
Tab< float >  radius
Tab< float >  tension
float  size

Member Function Documentation

DllExport void Render ( GraphicsWindow gw,
MarkerType  type = POINT_MRKR 
)
Remarks:
Implemented by the System.

Draws the particle system into the GraphicsWindow.
Parameters:
GraphicsWindow *gw

The graphics window into which to particle system is to be drawn.

MarkerType type=POINT_MRKR

One of the following values:

See Marker Types.
DllExport BOOL HitTest ( GraphicsWindow gw,
HitRegion hr,
int  abortOnHit = FALSE,
MarkerType  type = POINT_MRKR 
)
Remarks:
Implemented by the System.

This method hit tests the particle system and returns TRUE if the particle system was hit.
Parameters:
GraphicsWindow *gw

The graphics window to hit test in.

HitRegion *hr

Pointer to an instance of HitRegion describing the hit test region.

int abortOnHit=FALSE

If TRUE the hit testing should be aborted upon the first successful hit; otherwise hit testing should continue through all particles.

MarkerType type=POINT_MRKR

The type of particle marker being used. One of the following values:

See Marker Types.
Returns:
TRUE if a particle is hit; otherwise FALSE.
DllExport Box3 BoundBox ( Matrix3 tm = NULL )
Remarks:
Implemented by the System.

Returns the 3D bounding box of the particles.
Parameters:
Matrix3 *tm=NULL

If not NULL, this is the optional space to compute the bounding box in.
DllExport void FreeAll ( )
Remarks:
Implemented by the System.

Sets all the counts to 0. This will be the points, and if used, the velocities and ages.
DllExport void SetCount ( int  c,
DWORD  flags 
)
Remarks:
Implemented by the System.

Sets the size of the particle system. This is to at least set the number of points in the particle system. The flags indicate if optional parameters velocities and ages should be allocated as well.
Parameters:
int c

The size for each allocated table.

DWORD flags

One or more of the following values:

PARTICLE_VELS - Velocities should be allocated.

PARTICLE_AGES - Particles ages should be allocated.
int Count ( ) [inline]
Remarks:
Implemented by the System.

Returns the number of points in the particle system.
{return points.Count();}
Point3& operator[] ( int  i ) [inline]
Remarks:
Implemented by the System.

Returns the 'i-th' point of the particle system.
{return points[i];}
BOOL Alive ( int  i ) [inline]
Remarks:
Implemented by the System.

Determines if particle i is alive (has not expired).
Parameters:
int i

The index of the particle to check.
Returns:
TRUE if the 'i-th' particle is alive; otherwise FALSE.
{return ages[i]>=0;}
void SetCustomDraw ( CustomParticleDisplay d ) [inline]
Remarks:
Implemented by the System.

Establishes a custom draw callback object. This allows the particles to be displayed in any manner desired (not just using the standard point markers). See Class CustomParticleDisplay.
Parameters:
CustomParticleDisplay *d

The custom draw callback object.
Operators:
{draw=d;}

Member Data Documentation

Tab<TimeValue> ages
Tab<float> radius
Tab<float> tension
float size

ParticleSys ParticleSys ParticleSys ParticleSys ParticleSys ParticleSys ParticleSys ParticleSys ParticleSys ParticleSys
ParticleSys ParticleSys ParticleSys ParticleSys ParticleSys ParticleSys ParticleSys ParticleSys ParticleSys ParticleSys