ParticleAPI 3.0.0 Performant particle system API in C++ for interactive graphics

Public Member Functions | List of all members
ParticleContext_t Class Reference

The Particle System API Context - Your app should have one of these per host thread that will do particle systems concurrently. More...

`#include <pAPIContext.h>`

Inheritance diagram for ParticleContext_t:

## Public Member Functions
| ParticleContext_t ()
Public Member Functions inherited from PContextParticleGroup_t
void | CopyGroup (const int p_src_group_num, const size_t index, const size_t copy_count)
| Copy particles from the specified group into the current group. More...
void | CurrentGroup (const int p_group_num)
| Change which group is current. More...
void | DeleteParticleGroups (const int p_group_num, const int p_group_count=1)
| Delete one or more consecutive particle groups. More...
int | GenParticleGroups (const int p_group_count=1, const size_t max_particles=0)
| Create particle groups, each with a maximum of max_particles. More...
size_t | GetGroupCount ()
| Returns the number of particles existing in the current group. More...
size_t | GetMaxParticles ()
| Return the maximum number of particles allowed in the current group. More...
size_t | GetParticles (const size_t index, const size_t count, float *position, const bool getAlpha, float *color=NULL, float *vel=NULL, float *size=NULL, float *age=NULL)
| Copy particles from the current group to application memory. More...
size_t | GetParticlePointer (const float *&ptr, size_t &stride, size_t &pos3Ofs, size_t &posB3Ofs, size_t &size3Ofs, size_t &vel3Ofs, size_t &velB3Ofs, size_t &color3Ofs, size_t &alpha1Ofs, size_t &age1Ofs, size_t &up3Ofs, size_t &rvel3Ofs, size_t &upB3Ofs, size_t &mass1Ofs, size_t &data1Ofs)
| Return a pointer to particle data stored in API memory. More...
void | SetMaxParticles (const size_t max_count)
| Change the maximum number of particles in the current group. More...
void | BirthCallback (P_PARTICLE_CALLBACK callback, pdata_t group_data=0)
| Specify a particle creation callback. More...
void | DeathCallback (P_PARTICLE_CALLBACK callback, pdata_t group_data=0)
| Specify a particle death callback. More...
void | SetWorkingSetSize (const int set_size_bytes)
| Set the number of particles that fit in the CPU's cache. More...
Public Member Functions inherited from PContextActionList_t
void | Seed (const unsigned int seed)
| Set the random number seed. More...
void | TimeStep (const float new_dt)
| Specify the time step length. More...
float | GetTimeStep () const
| Return the current time step, as set with TimeStep() More...
void | CallActionList (const int action_list_num)
| Execute the specified action list on the current particle group. More...
void | DeleteActionLists (const int action_list_num, const int action_list_count=1)
| Delete one or more consecutive action lists. More...
void | EndActionList ()
| End the creation of a new action list. More...
int | GenActionLists (const int action_list_count=1)
| Generate a block of empty action lists. More...
void | NewActionList (const int action_list_num)
| Begin the creation of the specified action list. More...
Public Member Functions inherited from PContextActions_t
void | Avoid (Particle_t &m, const float magnitude, const float epsilon, const float look_ahead, const pDomain &dom)
| Steer particles away from a domain of space. More...
void | Bounce (Particle_t &m, const float friction, const float resilience, const float fric_min_vel, const pDomain &dom)
| Bounce particles off an object defined by a domain. More...
void | CopyVertexB (Particle_t &m, const bool copy_pos=true, const bool copy_vel=false)
| Set the secondary position and velocity from current. More...
void | Damping (Particle_t &m, const pVec &damping, const float min_vel=0.0f, const float max_vel=P_MAXFLOAT)
| Simulate air by dampening particle velocities. More...
void | RotDamping (Particle_t &m, const pVec &damping, const float min_vel=0.0f, const float max_vel=P_MAXFLOAT)
| Simulate air by dampening rotational velocities. More...
void | Explosion (Particle_t &m, const pVec &center, const float radius, const float magnitude, const float sigma, const float epsilon=P_EPS)
| Exert force on each particle away from explosion center. More...
void | Gravity (Particle_t &m, const pVec &dir)
| Accelerate particles in the given direction. More...
void | Jet (Particle_t &m, const pDomain &dom, const pDomain &acc)
| For particles in the domain of influence, accelerate them with a domain. More...
void | Move (Particle_t &m, const bool move_velocity=true, const bool move_rotational_velocity=true)
| Apply the particles' velocities to their positions, and age the particles. More...
void | OrbitLine (Particle_t &m, const pVec &p, const pVec &axis, const float magnitude=1.0f, const float epsilon=P_EPS, const float max_radius=P_MAXFLOAT)
| Accelerate particles toward the closest point on the given line. More...
void | OrbitPoint (Particle_t &m, const pVec &center, const float magnitude=1.0f, const float epsilon=P_EPS, const float max_radius=P_MAXFLOAT)
| Accelerate particles toward the given center point. More...
void | RandomAccel (Particle_t &m, const pDomain &dom)
| Accelerate particles in random directions. More...
void | RandomDisplace (Particle_t &m, const pDomain &dom)
| Immediately displace position by a random amount. More...
void | RandomVelocity (Particle_t &m, const pDomain &dom)
| Replace particle velocity with a random velocity. More...
void | RandomRotVelocity (Particle_t &m, const pDomain &dom)
| Immediately assign a random rotational velocity. More...
void | Restore (Particle_t &m, const float time, const bool vel=true, const bool rvel=true)
| Over time, restore particles to their target positionB and upB. More...
void | SpeedClamp (Particle_t &m, const float min_speed, const float max_speed)
| Clamp particle velocities to the given range. More...
void | TargetColor (Particle_t &m, const pVec &color, const float alpha, const float scale)
| Change color of all particles toward the specified color. More...
void | TargetSize (Particle_t &m, const pVec &size, const pVec &scale)
| Change sizes of all particles toward the specified size. More...
void | TargetVelocity (Particle_t &m, const pVec &vel, const float scale)
| Change velocity of all particles toward the specified velocity. More...
void | TargetRotVelocity (Particle_t &m, const pVec &rvel, const float scale)
| Change rotational velocity of all particles toward the specified rotational velocity. More...
void | Vortex (Particle_t &m, const pVec &tip, const pVec &axis, const float tightnessExponent, const float max_radius, const float inSpeed, const float upSpeed, const float aroundSpeed)
| Accelerate particles in a vortex-like way. More...
void | Follow (Particle_t &m, const float magnitude=1.0f, const float epsilon=P_EPS, const float max_radius=P_MAXFLOAT)
| Accelerate toward the next particle in the list. More...
void | Gravitate (Particle_t &m, const float magnitude=1.0f, const float epsilon=P_EPS, const float max_radius=P_MAXFLOAT)
| Accelerate each particle toward each other particle. More...
void | MatchVelocity (Particle_t &m, const float magnitude=1.0f, const float epsilon=P_EPS, const float max_radius=P_MAXFLOAT)
| Modify each particle's velocity to be similar to that of its neighbors. More...
void | MatchRotVelocity (Particle_t &m, const float magnitude=1.0f, const float epsilon=P_EPS, const float max_radius=P_MAXFLOAT)
| Modify each particle's rotational velocity to be similar to that of its neighbors. More...
void | Callback (Particle_t &m, P_PARTICLE_CALLBACK_ACTION callbackFunc, const pdata_t call_data=0)
| Call an arbitrary user-provided function on each particle in the group. More...
void | KillOld (Particle_t &m, const float age_limit, const bool kill_less_than=false)
| Get rid of older particles. More...
void | Sink (Particle_t &m, const bool kill_inside, const pDomain &kill_pos_dom)
| Kill particles that have positions on wrong side of the specified domain. More...
void | SinkVelocity (Particle_t &m, const bool kill_inside, const pDomain &kill_vel_dom)
| Kill particles that have velocities on wrong side of the specified domain. More...
void | Avoid (const float magnitude, const float epsilon, const float look_ahead, const pDomain &dom)
| Steer particles away from a domain of space. More...
void | Bounce (const float friction, const float resilience, const float fric_min_vel, const pDomain &dom)
| Bounce particles off an object defined by a domain. More...
void | CopyVertexB (const bool copy_pos=true, const bool copy_vel=false)
| Set the secondary position and velocity from current. More...
void | Damping (const pVec &damping, const float min_vel=0.0f, const float max_vel=P_MAXFLOAT)
| Simulate air by dampening particle velocities. More...
void | RotDamping (const pVec &damping, const float min_vel=0.0f, const float max_vel=P_MAXFLOAT)
| Simulate air by dampening rotational velocities. More...
void | Explosion (const pVec &center, const float radius, const float magnitude, const float sigma, const float epsilon=P_EPS)
| Exert force on each particle away from explosion center. More...
void | Gravity (const pVec &dir)
| Accelerate particles in the given direction. More...
void | Jet (const pDomain &dom, const pDomain &acc)
| For particles in the domain of influence, accelerate them with a domain. More...
void | Move (const bool move_velocity=true, const bool move_rotational_velocity=true)
| Apply the particles' velocities to their positions, and age the particles. More...
void | OrbitLine (const pVec &p, const pVec &axis, const float magnitude=1.0f, const float epsilon=P_EPS, const float max_radius=P_MAXFLOAT)
| Accelerate particles toward the closest point on the given line. More...
void | OrbitPoint (const pVec &center, const float magnitude=1.0f, const float epsilon=P_EPS, const float max_radius=P_MAXFLOAT)
| Accelerate particles toward the given center point. More...
void | RandomAccel (const pDomain &dom)
| Accelerate particles in random directions. More...
void | RandomDisplace (const pDomain &dom)
| Immediately displace position by a random amount. More...
void | RandomVelocity (const pDomain &dom)
| Replace particle velocity with a random velocity. More...
void | RandomRotVelocity (const pDomain &dom)
| Immediately assign a random rotational velocity. More...
void | Restore (const float time, const bool vel=true, const bool rvel=true)
| Over time, restore particles to their target positionB and upB. More...
void | SpeedClamp (const float min_speed, const float max_speed)
| Clamp particle velocities to the given range. More...
void | TargetColor (const pVec &color, const float alpha, const float scale)
| Change color of all particles toward the specified color. More...
void | TargetSize (const pVec &size, const pVec &scale)
| Change sizes of all particles toward the specified size. More...
void | TargetVelocity (const pVec &vel, const float scale)
| Change velocity of all particles toward the specified velocity. More...
void | TargetRotVelocity (const pVec &rvel, const float scale)
| Change rotational velocity of all particles toward the specified rotational velocity. More...
void | Vortex (const pVec &tip, const pVec &axis, const float tightnessExponent, const float max_radius, const float inSpeed, const float upSpeed, const float aroundSpeed)
| Accelerate particles in a vortex-like way. More...
void | Follow (const float magnitude=1.0f, const float epsilon=P_EPS, const float max_radius=P_MAXFLOAT)
| Accelerate toward the next particle in the list. More...
void | Gravitate (const float magnitude=1.0f, const float epsilon=P_EPS, const float max_radius=P_MAXFLOAT)
| Accelerate each particle toward each other particle. More...
void | MatchVelocity (const float magnitude=1.0f, const float epsilon=P_EPS, const float max_radius=P_MAXFLOAT)
| Modify each particle's velocity to be similar to that of its neighbors. More...
void | MatchRotVelocity (const float magnitude=1.0f, const float epsilon=P_EPS, const float max_radius=P_MAXFLOAT)
| Modify each particle's rotational velocity to be similar to that of its neighbors. More...
void | Callback (P_PARTICLE_CALLBACK_ACTION callbackFunc, const pdata_t call_data=0)
| Call an arbitrary user-provided function on each particle in the group. More...
void | KillOld (const float age_limit, const bool kill_less_than=false)
| Get rid of older particles. More...
void | Sink (const bool kill_inside, const pDomain &kill_pos_dom)
| Kill particles that have positions on wrong side of the specified domain. More...
void | SinkVelocity (const bool kill_inside, const pDomain &kill_vel_dom)
| Kill particles that have velocities on wrong side of the specified domain. More...
void | CommitKills ()
| Delete particles tagged to be killed by inline P.I.KillOld(), P.I.Sink(), and P.I.SinkVelocity() More...
void | Sort (const pVec &eye, const pVec &look_dir, const bool front_to_back=false, const bool clamp_negative=false)
| Sort the particles by their projection onto the look vector. More...
void | Source (const float particle_rate, const pDomain &dom, const pSourceState &SrcSt)
| Add particles with positions in the specified domain. More...
void | Vertex (const pVec &v, const pSourceState &SrcSt, const pdata_t data=0)
| Add a single particle at the specified location. More...
template<class UnaryFunction >
void | ParticleLoop (UnaryFunction f)
| Loop over particles executing all actions expressed in function f More...
template<class ExPol , class UnaryFunction >
void | ParticleLoop (ExPol &&policy, UnaryFunction f)
| Loop over particles executing all actions expressed in function f using the given execution policy for CPU parallelization More...

## Additional Inherited Members
Protected Member Functions inherited from PContextParticleGroup_t
void | InternalSetup (std::shared_ptr< PInternalState_t > Sr)
Protected Member Functions inherited from PContextActionList_t
void | InternalSetup (std::shared_ptr< PInternalState_t > Sr)
Protected Member Functions inherited from PContextActions_t
void | InternalSetup (std::shared_ptr< PInternalState_t > Sr)
Protected Attributes inherited from PContextParticleGroup_t
std::shared_ptr< PInternalState_t > | PS
Protected Attributes inherited from PContextActionList_t
std::shared_ptr< PInternalState_t > | PS
Protected Attributes inherited from PContextActions_t
PInternalShadow_t | PSh
std::shared_ptr< PInternalState_t > | PS

## Detailed Description

The Particle System API Context - Your app should have one of these per host thread that will do particle systems concurrently.

This is a complete instance of the Particle API. All API state is stored in the context.

See the documentation of the base classes for the description of all the API entry points.

## Constructor & Destructor Documentation

## ◆ ParticleContext_t()

ParticleContext_t | ( |  | ) |

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

- pAPIContext.h