pDomain Class Reference

A representation of a region of space. More...

#include <pDomain.h>

Inheritance diagram for pDomain:

PDBlob PDBox PDCone PDCylinder PDDisc PDLine PDPlane PDPoint PDRectangle PDSphere PDTriangle PDUnion

List of all members.


Public Member Functions

virtual bool  Within (const pVec &) const =0
  Returns true if the given point is within the domain.
virtual pVec  Generate () const =0
  Returns a random point in the domain.
virtual float  Size () const =0
  Returns the size of the domain (length, area, or volume).
virtual pDomain copy () const =0

Detailed Description

A representation of a region of space.

A Domain is a representation of a region of space. For example, the Source action uses a domain to describe the volume in which a particle will be created. A random point within the domain is chosen as the initial position of the particle. The Avoid, Sink and Bounce actions, for example, use domains to describe a volume in space for particles to steer around, die when they enter, or bounce off, respectively.

Domains can be used to describe velocities. Picture the velocity vector as having its tail at the origin and its tip being in the domain. Domains can be used to describe colors in any three-valued color space. They can be used to describe three-valued sizes, such as Length, Width, Height.

Several types of domains can be specified, such as points, lines, planes, discs, spheres, gaussian blobs, etc. Each subclass of the pDomain class represents a different kind of domain.

All domains support two basic operations. The first is Generate, which returns a random point in the domain.

The second basic operation is Within, which tells whether a given point is within the domain.

The application programmer never calls the Generate or Within functions. The application will use the pDomain class and its derivatives solely as a way to communicate the domain to the API. The API's action commands will then perform operations on the domain, such as generating particles within it.


Generated on Tue Dec 30 11:28:40 2008 for ParticleAPI by  doxygen 1.5.8