2-D volumetric particle emitter. More...
#include <Core/Emitter/VolumeParticleEmitter2.hpp>
Classes | |
class | Builder |
Front-end to create VolumeParticleEmitter2 objects step by step. More... | |
Public Member Functions | |
VolumeParticleEmitter2 (ImplicitSurface2Ptr implicitSurface, BoundingBox2D maxRegion, double spacing, const Vector2D &initialVel=Vector2D(), const Vector2D &linearVel=Vector2D(), double angularVel=0.0, 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... | |
const ImplicitSurface2Ptr & | GetSurface () const |
Returns source surface. More... | |
void | SetSurface (const ImplicitSurface2Ptr &newSurface) |
Sets the source surface. More... | |
const BoundingBox2D & | GetMaxRegion () const |
Returns max particle generator region. More... | |
void | SetMaxRegion (const BoundingBox2D &newMaxRegion) |
Sets the max particle generator region. 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... | |
Vector2D | GetLinearVelocity () const |
Returns the linear velocity of the emitter. More... | |
void | SetLinearVelocity (const Vector2D &newLinearVel) |
Sets the linear velocity of the emitter. More... | |
double | GetAngularVelocity () const |
Returns the angular velocity of the emitter. More... | |
void | SetAngularVelocity (double newAngularVel) |
Sets the linear velocity of the emitter. More... | |
Public Member Functions inherited from CubbyFlow::ParticleEmitter2 | |
ParticleEmitter2 ()=default | |
Default constructor. More... | |
ParticleEmitter2 (const ParticleEmitter2 &)=default | |
Default copy constructor. More... | |
ParticleEmitter2 (ParticleEmitter2 &&) noexcept=default | |
Default move constructor. More... | |
virtual | ~ParticleEmitter2 ()=default |
Default virtual destructor. More... | |
ParticleEmitter2 & | operator= (const ParticleEmitter2 &)=default |
Default copy assignment operator. More... | |
ParticleEmitter2 & | operator= (ParticleEmitter2 &&) noexcept=default |
Default move assignment operator. More... | |
void | Update (double currentTimeInSeconds, double timeIntervalInSeconds) |
const ParticleSystemData2Ptr & | GetTarget () const |
Returns the target particle system to emit. More... | |
void | SetTarget (const ParticleSystemData2Ptr &particles) |
Sets the target particle system to emit. More... | |
bool | GetIsEnabled () const |
Returns true if the emitter is enabled. More... | |
void | SetIsEnabled (bool enabled) |
Sets true/false to enable/disable the emitter. 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 | ( | ImplicitSurface2Ptr | implicitSurface, |
BoundingBox2D | maxRegion, | ||
double | spacing, | ||
const Vector2D & | initialVel = Vector2D() , |
||
const Vector2D & | linearVel = Vector2D() , |
||
double | angularVel = 0.0 , |
||
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] implicitSurface The implicit surface. [in] maxRegion The max region. [in] spacing The spacing between particles. [in] initialVel The initial velocity. [in] linearVel The linear velocity of the emitter. [in] angularVel The angular velocity of the emitter. [in] maxNumberOfParticles The max number of particles to be emitted. [in] jitter The jitter amount between 0 and 1. [in] isOneShot True if emitter gets disabled after one shot. [in] allowOverlapping True if particles can be overlapped. [in] seed The random seed.
Member Function Documentation
◆ GetAllowOverlapping()
bool CubbyFlow::VolumeParticleEmitter2::GetAllowOverlapping | ( | ) | const |
Returns true if particles can be overlapped.
◆ GetAngularVelocity()
double CubbyFlow::VolumeParticleEmitter2::GetAngularVelocity | ( | ) | const |
Returns the angular velocity of the emitter.
◆ 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.
◆ GetLinearVelocity()
Vector2D CubbyFlow::VolumeParticleEmitter2::GetLinearVelocity | ( | ) | const |
Returns the linear velocity of the emitter.
◆ GetMaxNumberOfParticles()
size_t CubbyFlow::VolumeParticleEmitter2::GetMaxNumberOfParticles | ( | ) | const |
Returns max number of particles to be emitted.
◆ GetMaxRegion()
const BoundingBox2D& CubbyFlow::VolumeParticleEmitter2::GetMaxRegion | ( | ) | const |
Returns max particle generator region.
◆ GetSpacing()
double CubbyFlow::VolumeParticleEmitter2::GetSpacing | ( | ) | const |
Returns the spacing between particles.
◆ GetSurface()
const ImplicitSurface2Ptr& CubbyFlow::VolumeParticleEmitter2::GetSurface | ( | ) | const |
Returns source surface.
◆ 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] newValue True if particles can be overlapped.
◆ SetAngularVelocity()
void CubbyFlow::VolumeParticleEmitter2::SetAngularVelocity | ( | double | newAngularVel | ) |
Sets the linear velocity of the emitter.
◆ 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] newValue True if particles should be emitted just once.
◆ SetJitter()
void CubbyFlow::VolumeParticleEmitter2::SetJitter | ( | double | newJitter | ) |
Sets jitter amount between 0 and 1.
◆ SetLinearVelocity()
void CubbyFlow::VolumeParticleEmitter2::SetLinearVelocity | ( | const Vector2D & | newLinearVel | ) |
Sets the linear velocity of the emitter.
◆ SetMaxNumberOfParticles()
void CubbyFlow::VolumeParticleEmitter2::SetMaxNumberOfParticles | ( | size_t | newMaxNumberOfParticles | ) |
Sets the max number of particles to be emitted.
◆ SetMaxRegion()
void CubbyFlow::VolumeParticleEmitter2::SetMaxRegion | ( | const BoundingBox2D & | newMaxRegion | ) |
Sets the max particle generator region.
◆ 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] newPointsGen The new points generator.
◆ SetSpacing()
void CubbyFlow::VolumeParticleEmitter2::SetSpacing | ( | double | newSpacing | ) |
Sets the spacing between particles.
◆ SetSurface()
void CubbyFlow::VolumeParticleEmitter2::SetSurface | ( | const ImplicitSurface2Ptr & | newSurface | ) |
Sets the source surface.
The documentation for this class was generated from the following file:
- Core/Emitter/VolumeParticleEmitter2.hpp