CubbyFlow::VolumeParticleEmitter2 Class Referencefinal

2-D volumetric particle emitter. More...

#include <Core/Emitter/VolumeParticleEmitter2.h>

Inheritance diagram for CubbyFlow::VolumeParticleEmitter2:
CubbyFlow::ParticleEmitter2

Classes

class  Builder
 Front-end to create VolumeParticleEmitter2 objects step by step. More...
 

Public Member Functions

 VolumeParticleEmitter2 (const ImplicitSurface2Ptr &implicitSurface, const BoundingBox2D &bounds, double spacing, const Vector2D &initialVel=Vector2D(), size_t maxNumberOfParticles=std::numeric_limits< size_t >::max(), double jitter=0.0, bool isOneShot=true, bool allowOverlapping=false, uint32_t seed=0)
 
void SetPointGenerator (const PointGenerator2Ptr &newPointsGen)
 Sets the point generator. More...
 
double GetJitter () const
 Returns jitter amount. More...
 
void SetJitter (double newJitter)
 Sets jitter amount between 0 and 1. More...
 
bool GetIsOneShot () const
 Returns true if particles should be emitted just once. More...
 
void SetIsOneShot (bool newValue)
 Sets the flag to true if particles are emitted just once. More...
 
bool GetAllowOverlapping () const
 Returns true if particles can be overlapped. More...
 
void SetAllowOverlapping (bool newValue)
 Sets the flag to true if particles can overlap each other. More...
 
size_t GetMaxNumberOfParticles () const
 Returns max number of particles to be emitted. More...
 
void SetMaxNumberOfParticles (size_t newMaxNumberOfParticles)
 Sets the max number of particles to be emitted. More...
 
double GetSpacing () const
 Returns the spacing between particles. More...
 
void SetSpacing (double newSpacing)
 Sets the spacing between particles. More...
 
Vector2D GetInitialVelocity () const
 Sets the initial velocity of the particles. More...
 
void SetInitialVelocity (const Vector2D &newInitialVel)
 Returns the initial velocity of the particles. More...
 
- Public Member Functions inherited from CubbyFlow::ParticleEmitter2
 ParticleEmitter2 ()
 Default constructor. More...
 
virtual ~ParticleEmitter2 ()
 Destructor. More...
 
void Update (double currentTimeInSeconds, double timeIntervalInSeconds)
 
const ParticleSystemData2PtrGetTarget () const
 Returns the target particle system to emit. More...
 
void SetTarget (const ParticleSystemData2Ptr &particles)
 Sets the target particle system to emit. More...
 
void SetOnBeginUpdateCallback (const OnBeginUpdateCallback &callback)
 Sets the callback function to be called when ParticleEmitter2::Update function is invoked. More...
 

Static Public Member Functions

static Builder GetBuilder ()
 Returns builder fox VolumeParticleEmitter2. More...
 

Additional Inherited Members

- Public Types inherited from CubbyFlow::ParticleEmitter2
using OnBeginUpdateCallback = std::function< void(ParticleEmitter2 *, double, double)>
 Callback function type for update calls. More...
 
- Protected Member Functions inherited from CubbyFlow::ParticleEmitter2
virtual void OnSetTarget (const ParticleSystemData2Ptr &particles)
 Called when ParticleEmitter2::SetTarget is executed. More...
 

Detailed Description

2-D volumetric particle emitter.

This class emits particles from volumetric geometry.

Constructor & Destructor Documentation

◆ VolumeParticleEmitter2()

CubbyFlow::VolumeParticleEmitter2::VolumeParticleEmitter2 ( const ImplicitSurface2Ptr implicitSurface,
const BoundingBox2D bounds,
double  spacing,
const Vector2D initialVel = Vector2D(),
size_t  maxNumberOfParticles = std::numeric_limits< size_t >::max(),
double  jitter = 0.0,
bool  isOneShot = true,
bool  allowOverlapping = false,
uint32_t  seed = 0 
)

Constructs an emitter that spawns particles from given implicit surface which defines the volumetric geometry. Provided bounding box limits the particle generation region.

Parameters
[in]implicitSurfaceThe implicit surface.
[in]boundsThe max region.
[in]spacingThe spacing between particles.
[in]initialVelThe initial velocity.
[in]maxNumberOfParticlesThe max number of particles to be emitted.
[in]jitterThe jitter amount between 0 and 1.
[in]isOneShotSet true if particles are emitted just once.
[in]allowOverlappingTrue if particles can be overlapped.
[in]seedThe random seed.

Member Function Documentation

◆ GetAllowOverlapping()

bool CubbyFlow::VolumeParticleEmitter2::GetAllowOverlapping ( ) const

Returns true if particles can be overlapped.

◆ GetBuilder()

static Builder CubbyFlow::VolumeParticleEmitter2::GetBuilder ( )
static

Returns builder fox VolumeParticleEmitter2.

◆ GetInitialVelocity()

Vector2D CubbyFlow::VolumeParticleEmitter2::GetInitialVelocity ( ) const

Sets the initial velocity of the particles.

◆ GetIsOneShot()

bool CubbyFlow::VolumeParticleEmitter2::GetIsOneShot ( ) const

Returns true if particles should be emitted just once.

◆ GetJitter()

double CubbyFlow::VolumeParticleEmitter2::GetJitter ( ) const

Returns jitter amount.

◆ GetMaxNumberOfParticles()

size_t CubbyFlow::VolumeParticleEmitter2::GetMaxNumberOfParticles ( ) const

Returns max number of particles to be emitted.

◆ GetSpacing()

double CubbyFlow::VolumeParticleEmitter2::GetSpacing ( ) const

Returns the spacing between particles.

◆ SetAllowOverlapping()

void CubbyFlow::VolumeParticleEmitter2::SetAllowOverlapping ( bool  newValue)

Sets the flag to true if particles can overlap each other.

If true is set, the emitter will generate particles even if the new particles can find existing nearby particles within the particle spacing.

Parameters
[in]newValueTrue if particles can be overlapped.

◆ SetInitialVelocity()

void CubbyFlow::VolumeParticleEmitter2::SetInitialVelocity ( const Vector2D newInitialVel)

Returns the initial velocity of the particles.

◆ SetIsOneShot()

void CubbyFlow::VolumeParticleEmitter2::SetIsOneShot ( bool  newValue)

Sets the flag to true if particles are emitted just once.

If true is set, the emitter will generate particles only once even after multiple emit calls. If false, it will keep generating particles from the volumetric geometry. Default value is true.

Parameters
[in]newValueTrue if particles should be emitted just once.

◆ SetJitter()

void CubbyFlow::VolumeParticleEmitter2::SetJitter ( double  newJitter)

Sets jitter amount between 0 and 1.

◆ SetMaxNumberOfParticles()

void CubbyFlow::VolumeParticleEmitter2::SetMaxNumberOfParticles ( size_t  newMaxNumberOfParticles)

Sets the max number of particles to be emitted.

◆ SetPointGenerator()

void CubbyFlow::VolumeParticleEmitter2::SetPointGenerator ( const PointGenerator2Ptr newPointsGen)

Sets the point generator.

This function sets the point generator that defines the pattern of the point distribution within the volume.

Parameters
[in]newPointsGenThe new points generator.

◆ SetSpacing()

void CubbyFlow::VolumeParticleEmitter2::SetSpacing ( double  newSpacing)

Sets the spacing between particles.


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