Go to the documentation of this file.
7 #ifndef INCLUDE_JET_VOLUME_PARTICLE_EMITTER2_H_
8 #define INCLUDE_JET_VOLUME_PARTICLE_EMITTER2_H_
54 double angularVel = 0.0,
158 double _angularVel = 0.0;
161 size_t _maxNumberOfParticles =
kMaxSize;
162 size_t _numberOfEmittedParticles = 0;
164 double _jitter = 0.0;
165 bool _isOneShot =
true;
166 bool _allowOverlapping =
false;
175 double currentTimeInSeconds,
176 double timeIntervalInSeconds)
override;
241 bool _isBoundSet =
false;
243 double _spacing = 0.1;
246 double _angularVel = 0.0;
247 size_t _maxNumberOfParticles =
kMaxSize;
248 double _jitter = 0.0;
249 bool _isOneShot =
true;
250 bool _allowOverlapping =
false;
256 #endif // INCLUDE_JET_VOLUME_PARTICLE_EMITTER2_H_
Builder & withSurface(const Surface2Ptr &surface)
Returns builder with surface defining volume shape.
Builder & withAllowOverlapping(bool allowOverlapping)
Returns builder with overlapping flag.
1-D array class.
Definition: array1.h:31
Abstract base class for 2-D particle emitter.
Definition: particle_emitter2.h:18
void setJitter(double newJitter)
Sets jitter amount between 0 and 1.
double jitter() const
Returns jitter amount.
Builder & withSpacing(double spacing)
Returns builder with spacing.
Vector2< double > Vector2D
Double-type 2D vector.
Definition: vector2.h:340
Builder & withMaxRegion(const BoundingBox2D &bounds)
Returns builder with max region.
void setLinearVelocity(const Vector2D &newLinearVel)
Sets the linear velocity of the emitter.
void setMaxNumberOfParticles(size_t newMaxNumberOfParticles)
Sets the max number of particles to be emitted.
2-D volumetric particle emitter.
Definition: volume_particle_emitter2.h:27
const ImplicitSurface2Ptr & surface() const
Returns source surface.
std::shared_ptr< VolumeParticleEmitter2 > VolumeParticleEmitter2Ptr
Shared pointer for the VolumeParticleEmitter2 type.
Definition: volume_particle_emitter2.h:189
constexpr size_t kMaxSize
Max size_t.
Definition: constants.h:79
Builder & withRandomSeed(uint32_t seed)
Returns builder with random seed.
const BoundingBox2D & maxRegion() const
Returns max particle gen region.
bool isOneShot() const
Returns true if particles should be emitted just once.
Builder & withIsOneShot(bool isOneShot)
Returns builder with one-shot flag.
VolumeParticleEmitter2 build() const
Builds VolumeParticleEmitter2.
Builder & withInitialVelocity(const Vector2D &initialVel)
Returns builder with initial velocity.
Definition: advection_solver2.h:18
std::shared_ptr< ImplicitSurface2 > ImplicitSurface2Ptr
Shared pointer type for the ImplicitSurface2.
Definition: implicit_surface2.h:43
Vector2D initialVelocity() const
Sets the initial velocity of the particles.
std::shared_ptr< Surface2 > Surface2Ptr
Shared pointer for the Surface2 type.
Definition: surface2.h:109
Builder & withMaxNumberOfParticles(size_t maxNumberOfParticles)
Returns builder with max number of particles.
void setPointGenerator(const PointGenerator2Ptr &newPointsGen)
Sets the point generator.
2-D vector class.
Definition: vector2.h:24
void setAngularVelocity(double newAngularVel)
Sets the linear velocity of the emitter.
Vector2D linearVelocity() const
Returns the linear velocity of the emitter.
void setAllowOverlapping(bool newValue)
Sets the flag to true if particles can overlap each other.
void setSpacing(double newSpacing)
Sets the spacing between particles.
double angularVelocity() const
Returns the angular velocity of the emitter.
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)
double spacing() const
Returns the spacing between particles.
Builder & withImplicitSurface(const ImplicitSurface2Ptr &implicitSurface)
Returns builder with implicit surface defining volume shape.
2-D axis-aligned bounding box class.
Definition: bounding_box2.h:41
void setMaxRegion(const BoundingBox2D &newBox)
Sets the max particle gen region.
Builder & withLinearVelocity(const Vector2D &linearVel)
Returns builder with linear velocity.
bool allowOverlapping() const
Returns trhe if particles can be overlapped.
Front-end to create VolumeParticleEmitter2 objects step by step.
Definition: volume_particle_emitter2.h:195
std::shared_ptr< PointGenerator2 > PointGenerator2Ptr
Shared pointer for the PointGenerator2 type.
Definition: point_generator2.h:56
std::shared_ptr< ParticleSystemData2 > ParticleSystemData2Ptr
Shared pointer type of ParticleSystemData2.
Definition: particle_system_data2.h:250
Builder & withJitter(double jitter)
Returns builder with jitter amount.
VolumeParticleEmitter2Ptr makeShared() const
Builds shared pointer of VolumeParticleEmitter2 instance.
static Builder builder()
Returns builder fox VolumeParticleEmitter2.
void setIsOneShot(bool newValue)
Sets the flag to true if particles are emitted just once.
void setInitialVelocity(const Vector2D &newInitialVel)
Returns the initial velocity of the particles.
Builder & withAngularVelocity(double angularVel)
Returns builder with angular velocity.
void setSurface(const ImplicitSurface2Ptr &newSurface)
Sets the source surface.
size_t maxNumberOfParticles() const
Returns max number of particles to be emitted.