ParticleAPI 3.0.0
Performant particle system API in C++ for interactive graphics
Classes | Typedefs | Enumerations | Functions | Variables
PAPI Namespace Reference

PAPIClasses.h. More...

Classes

struct  Particle_t
 
class  ParticleContext_t
 The Particle System API Context - Your app should have one of these per host thread that will do particle systems concurrently. More...
 
class  PContextActionList_t
 Action List Calls. More...
 
class  PContextActions_t
 This class contains the Action API. More...
 
class  PContextParticleGroup_t
 This class contains the API calls that operate on particle groups. More...
 
struct  PDBlob
 Gaussian blob. More...
 
struct  PDBox
 Axis-aligned bounding box (AABB) More...
 
struct  PDCone
 Cone. More...
 
struct  PDCylinder
 Cylinder. More...
 
struct  PDDisc
 Arbitrarily-oriented disc. More...
 
struct  PDLine
 A line segment. More...
 
class  pDomain
 A representation of a region of space. More...
 
struct  PDPlane
 Arbitrarily-oriented plane. More...
 
struct  PDPoint
 A single point. More...
 
struct  PDRectangle
 Rhombus-shaped planar region. More...
 
struct  PDSphere
 Sphere. More...
 
struct  PDTriangle
 A Triangle. More...
 
struct  PDUnion
 A CSG union of multiple domains. More...
 
struct  PErrActionList
 An action list call had an error. More...
 
struct  PErrInNewActionList
 An operation was illegally attempted while in the midst of compiling an action list. More...
 
struct  PErrInternalError
 Internal API error (a PASSERT failed) More...
 
struct  PErrInvalidValue
 An invalid value was passed to an API call. More...
 
struct  PErrNotImplemented
 API encountered an unimplemented code path like Bounce for a new. More...
 
struct  PError_t
 Base type of all exceptions thrown by the Particle System API. More...
 
struct  PErrParticleGroup
 A particle group call had an error. More...
 
class  pSourceState
 These functions set the current state needed by Source() and Vertex() actions. More...
 
class  pVec
 A single-precision floating point three-vector. More...
 

Typedefs

typedef unsigned int pdata_t
 
typedef void(* P_PARTICLE_CALLBACK) (struct Particle_t &particle, const pdata_t data)
 This is the type of the particle birth and death callback functions that you can register. More...
 
typedef void(* P_PARTICLE_CALLBACK_ACTION) (struct Particle_t &particle, const pdata_t data, const float dt)
 This is the type of the callback functions that you can register for the Callback() action. More...
 

Enumerations

enum  pDomainType_E {
  PDUnion_e , PDPoint_e , PDLine_e , PDTriangle_e ,
  PDRectangle_e , PDDisc_e , PDPlane_e , PDBox_e ,
  PDCylinder_e , PDCone_e , PDSphere_e , PDBlob_e
}
 Enums for the different types of domains that can be stored in a pDomain. More...
 

Functions

float fsqr (float f)
 
float pRandf ()
 
void pSRandf (int x)
 
bool pSameSign (const float &a, const float &b)
 
float pNRandf (float sigma=1.0f)
 Return a random number with a normal distribution. More...
 
pVec pRandVec ()
 
pVec pNRandVec (float sigma)
 

Variables

const int P_VERSION = 300
 This is the version number of this release of the API. More...
 
const float P_MAXFLOAT = 1.0e16f
 A very large float value used as a default arg passed into functions. More...
 
const float P_EPS = 1e-3f
 A very small float value added to some physical calculations to dampen them and improve stability. More...
 
const float P_SQRT2PI = 2.506628274631000502415765284811045253006f
 
const float P_ONEOVERSQRT2PI = (1.f / P_SQRT2PI)
 
const float P_ONEOVER_RAND_MAX = (1.0f / ((float)RAND_MAX))
 

Detailed Description

PAPIClasses.h.

PSourceState.h.

Particle.h.

PInlineActionsAPI.h.

PError.h.

PDomain.h.

PDeclarations.h.

Copyright 1997-2007, 2022 by David K. McAllister

Include this file in all applications that use the Particle System API.

Copyright 1997-2007, 2022 by David K. McAllister

This file defines the pDomain struct and all of the classes that derive from it.

Copyright 1997-2007, 2022 by David K. McAllister

This file defines the error classes that are thrown.

Copyright 1997-2007, 2022 by David K. McAllister

Only application code should include this. This file contains the host interface definitions to the inline particle actions. It is a header file so that the action implementations are inlined. The intended usage is as follows:

P.ParticleLoop(std::execution::par_unseq, [&](Particle_t& m) { P.I.Gravity(Efx.GravityVec); P.I.Bounce(0.f, 0.5f, 0.f, PDDisc(pVec(0, 0, 1.f), pVec(0, 0, 1.f), 5)); P.I.Move(true, false); });

Copyright 1997-2007, 2022 by David K. McAllister

This file contains the definition of a particle. It should only be included by API implementation files, not by applications. The only exception is callback functions.

Copyright 1997-2007, 2022 by David K. McAllister

Defines these classes: pSourceState

Typedef Documentation

◆ P_PARTICLE_CALLBACK

typedef void(* P_PARTICLE_CALLBACK) (struct Particle_t &particle, const pdata_t data)

This is the type of the particle birth and death callback functions that you can register.

◆ P_PARTICLE_CALLBACK_ACTION

typedef void(* P_PARTICLE_CALLBACK_ACTION) (struct Particle_t &particle, const pdata_t data, const float dt)

This is the type of the callback functions that you can register for the Callback() action.

◆ pdata_t

typedef unsigned int pdata_t

Enumeration Type Documentation

◆ pDomainType_E

Enums for the different types of domains that can be stored in a pDomain.

Enumerator
PDUnion_e 
PDPoint_e 
PDLine_e 
PDTriangle_e 
PDRectangle_e 
PDDisc_e 
PDPlane_e 
PDBox_e 
PDCylinder_e 
PDCone_e 
PDSphere_e 
PDBlob_e 

Function Documentation

◆ fsqr()

float PAPI::fsqr ( float  f)
inline

◆ pNRandf()

float PAPI::pNRandf ( float  sigma = 1.0f)
inline

Return a random number with a normal distribution.

◆ pNRandVec()

pVec PAPI::pNRandVec ( float  sigma)
inline

◆ pRandf()

float PAPI::pRandf ( )
inline

◆ pRandVec()

pVec PAPI::pRandVec ( )
inline

◆ pSameSign()

bool PAPI::pSameSign ( const float &  a,
const float &  b 
)
inline

◆ pSRandf()

void PAPI::pSRandf ( int  x)
inline

Variable Documentation

◆ P_EPS

const float P_EPS = 1e-3f

A very small float value added to some physical calculations to dampen them and improve stability.

◆ P_MAXFLOAT

const float P_MAXFLOAT = 1.0e16f

A very large float value used as a default arg passed into functions.

◆ P_ONEOVER_RAND_MAX

const float P_ONEOVER_RAND_MAX = (1.0f / ((float)RAND_MAX))

◆ P_ONEOVERSQRT2PI

const float P_ONEOVERSQRT2PI = (1.f / P_SQRT2PI)

◆ P_SQRT2PI

const float P_SQRT2PI = 2.506628274631000502415765284811045253006f

◆ P_VERSION

const int P_VERSION = 300

This is the version number of this release of the API.