ParticleSys Class Reference

ParticleSys Class Reference

#include <particle.h>

Class Description

See also
Class GraphicsWindow, Marker of zoom in direction used in customized zoom mode., 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.
+ Inheritance diagram for ParticleSys:

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 ()
 
Point3operator[] (int i)
 
BOOL Alive (int i)
 
void SetCustomDraw (CustomParticleDisplay *d)
 

Public Attributes

Tab< Point3points
 
Tab< Point3vels
 
Tab< TimeValueages
 
Tab< float > radius
 
Tab< float > tension
 
float size
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 

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 the MarkerType enum.
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 the MarkerType enum.
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.
141 {return points.Count();}
int Count() const
Retrieves the number of items in the Tab.
Definition: tab.h:219
Tab< Point3 > points
Definition: particle.h:71
Point3& operator[] ( int  i)
inline
Remarks
Implemented by the System.

Returns the 'i-th' point of the particle system.
144 {return points[i];}
Tab< Point3 > points
Definition: particle.h:71
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.
153 {return ages[i]>=0;}
Tab< TimeValue > ages
Definition: particle.h:73
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:
165 {draw=d;}

Member Data Documentation

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