Jet
v1.3.3
|
2-D point particle emitter. More...
#include <jet/point_particle_emitter2.h>
Classes | |
class | Builder |
Front-end to create PointParticleEmitter2 objects step by step. More... | |
Public Member Functions | |
PointParticleEmitter2 (const Vector2D &origin, const Vector2D &direction, double speed, double spreadAngleInDegrees, size_t maxNumOfNewParticlesPerSec=1, size_t maxNumOfParticles=std::numeric_limits< size_t >::max(), uint32_t seed=0) | |
size_t | maxNumberOfNewParticlesPerSecond () const |
Returns max number of new particles per second. More... | |
void | setMaxNumberOfNewParticlesPerSecond (size_t rate) |
Sets max number of new particles per second. More... | |
size_t | maxNumberOfParticles () const |
Returns max number of particles to be emitted. More... | |
void | setMaxNumberOfParticles (size_t maxNumberOfParticles) |
Sets max number of particles to be emitted. 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 PointParticleEmitter2. 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 point particle emitter.
This class emits particles from a single point in given direction, speed, and spreading angle.
jet::PointParticleEmitter2::PointParticleEmitter2 | ( | const Vector2D & | origin, |
const Vector2D & | direction, | ||
double | speed, | ||
double | spreadAngleInDegrees, | ||
size_t | maxNumOfNewParticlesPerSec = 1 , |
||
size_t | maxNumOfParticles = std::numeric_limits< size_t >::max() , |
||
uint32_t | seed = 0 |
||
) |
Constructs an emitter that spawns particles from given origin, direction, speed, spread angle, max number of new particles per second, max total number of particles to be emitted, and random seed.
[in] | origin | The origin. |
[in] | direction | The direction. |
[in] | speed | The speed. |
[in] | spreadAngleInDegrees | The spread angle in degrees. |
[in] | maxNumOfNewParticlesPerSec | The max number of new particles per second. |
[in] | maxNumOfParticles | The max number of particles to be emitted. |
[in] | seed | The random seed. |
|
static |
Returns builder fox PointParticleEmitter2.
size_t jet::PointParticleEmitter2::maxNumberOfNewParticlesPerSecond | ( | ) | const |
Returns max number of new particles per second.
size_t jet::PointParticleEmitter2::maxNumberOfParticles | ( | ) | const |
Returns max number of particles to be emitted.
void jet::PointParticleEmitter2::setMaxNumberOfNewParticlesPerSecond | ( | size_t | rate | ) |
Sets max number of new particles per second.
void jet::PointParticleEmitter2::setMaxNumberOfParticles | ( | size_t | maxNumberOfParticles | ) |
Sets max number of particles to be emitted.