ParticleAPI 3.0.0
Performant particle system API in C++ for interactive graphics
Public Member Functions | Public Attributes | List of all members
pDomain Class Referenceabstract

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

Public Member Functions

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

Public Attributes

pDomainType_E Which
 

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

Member Function Documentation

◆ copy()

virtual std::shared_ptr< pDomain > copy ( ) const
pure virtual

◆ Generate()

virtual pVec Generate ( ) const
pure virtual

Returns a random point in the domain.

Implemented in PDUnion, PDPoint, PDLine, PDTriangle, PDRectangle, PDDisc, PDPlane, PDBox, PDCylinder, PDCone, PDSphere, and PDBlob.

◆ Size()

virtual float Size ( ) const
pure virtual

Returns the size of the domain (length, area, or volume).

Implemented in PDUnion, PDPoint, PDLine, PDTriangle, PDRectangle, PDDisc, PDPlane, PDBox, PDCylinder, PDCone, PDSphere, and PDBlob.

◆ Within()

virtual bool Within ( const pVec ) const
pure virtual

Returns true if the given point is within the domain.

Implemented in PDUnion, PDPoint, PDLine, PDTriangle, PDRectangle, PDDisc, PDPlane, PDBox, PDCylinder, PDCone, PDSphere, and PDBlob.

Member Data Documentation

◆ Which


The documentation for this class was generated from the following file: