Jet
v1.3.3
|
2-D volumetric particle emitter. More...
#include <jet/volume_particle_emitter2.h>
Classes | |
class | Builder |
Front-end to create VolumeParticleEmitter2 objects step by step. More... | |
Public Member Functions | |
VolumeParticleEmitter2 (const ImplicitSurface2Ptr &implicitSurface, const BoundingBox2D &maxRegion, double spacing, const Vector2D &initialVel=Vector2D(), const Vector2D &linearVel=Vector2D(), double angularVel=0.0, size_t maxNumberOfParticles=kMaxSize, 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 & | surface () const |
Returns source surface. More... | |
void | setSurface (const ImplicitSurface2Ptr &newSurface) |
Sets the source surface. More... | |
const BoundingBox2D & | maxRegion () const |
Returns max particle gen region. More... | |
void | setMaxRegion (const BoundingBox2D &newBox) |
Sets the max particle gen region. More... | |
double | jitter () const |
Returns jitter amount. More... | |
void | setJitter (double newJitter) |
Sets jitter amount between 0 and 1. More... | |
bool | isOneShot () 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 | allowOverlapping () const |
Returns trhe if particles can be overlapped. More... | |
void | setAllowOverlapping (bool newValue) |
Sets the flag to true if particles can overlap each other. More... | |
size_t | maxNumberOfParticles () 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 | spacing () const |
Returns the spacing between particles. More... | |
void | setSpacing (double newSpacing) |
Sets the spacing between particles. More... | |
Vector2D | initialVelocity () const |
Sets the initial velocity of the particles. More... | |
void | setInitialVelocity (const Vector2D &newInitialVel) |
Returns the initial velocity of the particles. More... | |
Vector2D | linearVelocity () const |
Returns the linear velocity of the emitter. More... | |
void | setLinearVelocity (const Vector2D &newLinearVel) |
Sets the linear velocity of the emitter. More... | |
double | angularVelocity () const |
Returns the angular velocity of the emitter. More... | |
void | setAngularVelocity (double newAngularVel) |
Sets the linear velocity of the emitter. More... | |
![]() | |
ParticleEmitter2 () | |
Default constructor. More... | |
virtual | ~ParticleEmitter2 () |
Destructor. More... | |
void | update (double currentTimeInSeconds, double timeIntervalInSeconds) |
const ParticleSystemData2Ptr & | target () const |
Returns the target particle system to emit. More... | |
void | setTarget (const ParticleSystemData2Ptr &particles) |
Sets the target particle system to emit. More... | |
bool | isEnabled () 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 | builder () |
Returns builder fox VolumeParticleEmitter2. More... | |
Additional Inherited Members | |
![]() | |
typedef std::function< void(ParticleEmitter2 *, double, double)> | OnBeginUpdateCallback |
Callback function type for update calls. More... | |
![]() | |
virtual void | onSetTarget (const ParticleSystemData2Ptr &particles) |
Called when ParticleEmitter3::setTarget is executed. More... | |
2-D volumetric particle emitter.
This class emits particles from volumetric geometry.
jet::VolumeParticleEmitter2::VolumeParticleEmitter2 | ( | const ImplicitSurface2Ptr & | implicitSurface, |
const BoundingBox2D & | maxRegion, | ||
double | spacing, | ||
const Vector2D & | initialVel = Vector2D() , |
||
const Vector2D & | linearVel = Vector2D() , |
||
double | angularVel = 0.0 , |
||
size_t | maxNumberOfParticles = kMaxSize , |
||
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.
[in] | implicitSurface | The implicit surface. |
[in] | maxRegion | The max region. |
[in] | spacing | The spacing between particles. |
[in] | initialVel | The initial velocity of new particles. |
[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. |
bool jet::VolumeParticleEmitter2::allowOverlapping | ( | ) | const |
Returns trhe if particles can be overlapped.
double jet::VolumeParticleEmitter2::angularVelocity | ( | ) | const |
Returns the angular velocity of the emitter.
|
static |
Returns builder fox VolumeParticleEmitter2.
Vector2D jet::VolumeParticleEmitter2::initialVelocity | ( | ) | const |
Sets the initial velocity of the particles.
bool jet::VolumeParticleEmitter2::isOneShot | ( | ) | const |
Returns true if particles should be emitted just once.
double jet::VolumeParticleEmitter2::jitter | ( | ) | const |
Returns jitter amount.
Vector2D jet::VolumeParticleEmitter2::linearVelocity | ( | ) | const |
Returns the linear velocity of the emitter.
size_t jet::VolumeParticleEmitter2::maxNumberOfParticles | ( | ) | const |
Returns max number of particles to be emitted.
const BoundingBox2D& jet::VolumeParticleEmitter2::maxRegion | ( | ) | const |
Returns max particle gen region.
void jet::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.
[in] | newValue | True if particles can be overlapped. |
void jet::VolumeParticleEmitter2::setAngularVelocity | ( | double | newAngularVel | ) |
Sets the linear velocity of the emitter.
void jet::VolumeParticleEmitter2::setInitialVelocity | ( | const Vector2D & | newInitialVel | ) |
Returns the initial velocity of the particles.
void jet::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.
[in] | newValue | True if particles should be emitted just once. |
void jet::VolumeParticleEmitter2::setJitter | ( | double | newJitter | ) |
Sets jitter amount between 0 and 1.
void jet::VolumeParticleEmitter2::setLinearVelocity | ( | const Vector2D & | newLinearVel | ) |
Sets the linear velocity of the emitter.
void jet::VolumeParticleEmitter2::setMaxNumberOfParticles | ( | size_t | newMaxNumberOfParticles | ) |
Sets the max number of particles to be emitted.
void jet::VolumeParticleEmitter2::setMaxRegion | ( | const BoundingBox2D & | newBox | ) |
Sets the max particle gen region.
void jet::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.
[in] | newPointsGen | The new points generator. |
void jet::VolumeParticleEmitter2::setSpacing | ( | double | newSpacing | ) |
Sets the spacing between particles.
void jet::VolumeParticleEmitter2::setSurface | ( | const ImplicitSurface2Ptr & | newSurface | ) |
Sets the source surface.
double jet::VolumeParticleEmitter2::spacing | ( | ) | const |
Returns the spacing between particles.
const ImplicitSurface2Ptr& jet::VolumeParticleEmitter2::surface | ( | ) | const |
Returns source surface.