3ds Max C++ API Reference
ParticleSys Class Reference

#include <particle.h>

+ 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...
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary. More...
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary. More...
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More...
 

Detailed 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.

Member Function Documentation

◆ Render()

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.

◆ HitTest()

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.

◆ BoundBox()

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.

◆ FreeAll()

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.

◆ SetCount()

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.

◆ Count()

int Count ( )
inline
Remarks
Implemented by the System.

Returns the number of points in the particle system.
141 {return points.Count();}
Tab< Point3 > points
Definition: particle.h:71
int Count() const
Retrieves the number of items in the Tab.
Definition: tab.h:219

◆ operator[]()

Point3& operator[] ( int  i)
inline
Remarks
Implemented by the System.

Returns the 'i-th' point of the particle system.
144 {return points[i];}

◆ Alive()

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

◆ SetCustomDraw()

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

◆ points

Tab<Point3> points

◆ vels

Tab<Point3> vels

◆ ages

Tab<TimeValue> ages

◆ radius

Tab<float> radius

◆ tension

Tab<float> tension

◆ size

float size