16 #ifndef SURGSIM_PARTICLES_EMITTER_H 17 #define SURGSIM_PARTICLES_EMITTER_H 58 SURGSIM_STATIC_REGISTRATION(
Emitter);
66 explicit Emitter(
const std::string& name);
73 void update(
double dt)
override;
75 int getTargetManagerType()
const override;
79 void setTarget(
const std::shared_ptr<SurgSim::Framework::Component> target);
83 const std::shared_ptr<SurgSim::Framework::Component> getTarget();
87 void setShape(std::shared_ptr<SurgSim::Math::Shape> shape);
91 std::shared_ptr<SurgSim::Math::Shape> getShape()
const;
95 void setMode(
int mode);
103 void setRate(
double rate);
107 double getRate()
const;
112 void setLifetimeRange(
const std::pair<double, double>& range);
116 std::pair<double, double> getLifetimeRange()
const;
121 void setVelocityRange(
const std::pair<SurgSim::Math::Vector3d, SurgSim::Math::Vector3d>& range);
124 const std::pair<SurgSim::Math::Vector3d, SurgSim::Math::Vector3d>& getVelocityRange()
const;
139 bool doInitialize()
override;
140 bool doWakeUp()
override;
167 std::shared_ptr<SurgSim::Math::Shape>
m_shape;
170 std::shared_ptr<SurgSim::Particles::Representation>
m_target;
176 std::shared_ptr<SurgSim::Framework::Logger>
m_logger;
182 #endif // SURGSIM_PARTICLES_EMITTER_H EmitMode
Emitting modes of the Emitter.
Definition: Emitter.h:48
RandomPointGenerator will generate points based on the shape passed.
Definition: RandomPointGenerator.h:35
Definition: CompoundShapeToGraphics.cpp:29
std::shared_ptr< SurgSim::Math::Shape > m_shape
Shape of emitter.
Definition: Emitter.h:167
The number of EmitModes.
Definition: Emitter.h:55
int m_mode
The emit mode of this emitter.
Definition: Emitter.h:146
std::shared_ptr< SurgSim::Framework::Logger > m_logger
Logger used by the Emitter.
Definition: Emitter.h:176
DataStructures::Vertices< ParticleData > Particles
Definition: Particles.h:53
SurgSim::Math::RigidTransform3d m_localPose
Local Pose of the Representation with respect to the SceneElement.
Definition: Emitter.h:173
std::pair< double, double > m_lifetimeRange
The range of lifetimes of emitted particles.
Definition: Emitter.h:152
#define SURGSIM_CLASSNAME(ClassName)
Declare the class name of a class with the appropriate function header, do not use quotes...
Definition: Macros.h:21
double m_particlesNotAdded
Number of particles not added during last update.
Definition: Emitter.h:158
Eigen::Transform< double, 3, Eigen::Isometry > RigidTransform3d
A 3D rigid (isometric) transform, represented as doubles.
Definition: RigidTransform.h:46
Emitter emits particles into a ParticleSystem.
Definition: Emitter.h:61
std::mt19937 m_generator
Definition: Emitter.h:162
Definitions of small fixed-size vector types.
double m_rate
The emit rate of this emitter.
Definition: Emitter.h:149
Behaviors perform actions.
Definition: Behavior.h:40
std::pair< SurgSim::Math::Vector3d, SurgSim::Math::Vector3d > m_velocityRange
The range of velocities of the emitted particles.
Definition: Emitter.h:155
Emit particles only from the surface.
Definition: Emitter.h:53
Emit particles from within the shapes volume.
Definition: Emitter.h:51
RandomPointGenerator m_pointGenerator
PointGenerator for generating random points within or on the emitter shape.
Definition: Emitter.h:143
std::uniform_real_distribution< double > m_zeroOneDistribution
Definition: Emitter.h:163
std::shared_ptr< SurgSim::Particles::Representation > m_target
Representation to emit to.
Definition: Emitter.h:170