A description of a particle emitter, which can be attached to a link. More...
#include <ParticleEmitter.hh>
Public Member Functions | |
ParticleEmitter () | |
Default constructor. More... | |
ParticleEmitter (const ParticleEmitter &_emitter) | |
Copy constructor. More... | |
ParticleEmitter (ParticleEmitter &&_emitter) noexcept | |
Move constructor. More... | |
~ParticleEmitter () | |
Destructor. More... | |
ignition::math::Color | ColorEnd () const |
Get the end color for all particles emitted. More... | |
std::string | ColorRangeImage () const |
Get the path to the color image used as an affector. More... | |
ignition::math::Color | ColorStart () const |
Gets the starting color for all particles emitted. More... | |
double | Duration () const |
Get the number of seconds the emitter is active. More... | |
sdf::ElementPtr | Element () const |
Get a pointer to the SDF element that was used during load. More... | |
bool | Emitting () const |
Get whether the particle emitter should run (emit particles). More... | |
const std::string & | FilePath () const |
The path to the file where this element was loaded from. More... | |
double | Lifetime () const |
Get the number of seconds each particle will 'live' for before being destroyed. More... | |
Errors | Load (ElementPtr _sdf) |
Load the particle emitter based on an element pointer. More... | |
sdf::Material * | Material () const |
Get a pointer to the emitter's material properties. More... | |
double | MaxVelocity () const |
Get the maximum velocity for each particle. More... | |
double | MinVelocity () const |
Get the minimum velocity for each particle. More... | |
std::string | Name () const |
Get the name of the particle emitter. More... | |
ParticleEmitter & | operator= (const ParticleEmitter &_emitter) |
Copy assignment operator. More... | |
ParticleEmitter & | operator= (ParticleEmitter &&_emitter) |
Move assignment operator. More... | |
ignition::math::Vector3d | ParticleSize () const |
Get the size of a particle in meters. More... | |
const std::string & | PoseRelativeTo () const |
Get the name of the coordinate frame relative to which this emitter's pose is expressed. More... | |
double | Rate () const |
Get the number of particles per second that should be emitted. More... | |
const ignition::math::Pose3d & | RawPose () const |
Get the pose of the particle emitter. More... | |
double | ScaleRate () const |
Get the amount by which to scale the particles in both x and y direction per second. More... | |
sdf::SemanticPose | SemanticPose () const |
Get SemanticPose object of this object to aid in resolving poses. More... | |
void | SetColorEnd (const ignition::math::Color &_colorEnd) |
Set the end color for all particles emitted. More... | |
void | SetColorRangeImage (const std::string &_image) |
Set the path to the color image used as an affector. More... | |
void | SetColorStart (const ignition::math::Color &_colorStart) |
Set the starting color for all particles emitted. More... | |
void | SetDuration (double _duration) |
Set the number of seconds the emitter is active. More... | |
void | SetEmitting (bool _emitting) |
Set whether the particle emitter is running, emitting particles. More... | |
void | SetFilePath (const std::string &_filePath) |
Set the path to the file where this element was loaded from. More... | |
void | SetLifetime (double _duration) |
Set the number of seconds each particle will 'live' for. More... | |
void | SetMaterial (const sdf::Material &_material) |
Set the emitter's material. More... | |
void | SetMaxVelocity (double _vel) |
Set the maximum velocity for each particle. More... | |
void | SetMinVelocity (double _vel) |
Set the minimum velocity for each particle. More... | |
void | SetName (const std::string &_name) |
Set the name of the particle emitter. More... | |
void | SetParticleSize (const ignition::math::Vector3d &_size) |
Set the size of a particle in meters. More... | |
void | SetPoseRelativeTo (const std::string &_frame) |
Set the name of the coordinate frame relative to which this emitter's pose is expressed. More... | |
void | SetRate (double _rate) |
Set the number of particles per second that should be emitted. More... | |
void | SetRawPose (const ignition::math::Pose3d &_pose) |
Set the pose of the particle emitter object. More... | |
void | SetScaleRate (double _scaleRate) |
Set the amount by which to scale the particles in both x and y direction per second. More... | |
void | SetSize (const ignition::math::Vector3d &_size) |
Set the size of the emitter where the particles are sampled. More... | |
void | SetTopic (const std::string &_topic) |
Set the topic used to update the particle emitter properties. More... | |
void | SetType (const ParticleEmitterType _type) |
Set the type of the particle emitter. More... | |
bool | SetType (const std::string &_typeStr) |
Set the type of the particle emitter. More... | |
ignition::math::Vector3d | Size () const |
Get the size of the emitter where the particles are sampled. More... | |
std::string | Topic () const |
Get the topic used to update the particle emitter properties. More... | |
ParticleEmitterType | Type () const |
Get the type of the particle emitter. More... | |
std::string | TypeStr () const |
Get the particle emitter type as a string. More... | |
A description of a particle emitter, which can be attached to a link.
A particle emitter can be used to describe fog, smoke, and dust.
sdf::v10::ParticleEmitter::ParticleEmitter | ( | ) |
Default constructor.
sdf::v10::ParticleEmitter::ParticleEmitter | ( | const ParticleEmitter & | _emitter | ) |
Copy constructor.
[in] | _emitter | Particle emitter to copy. |
|
noexcept |
Move constructor.
[in] | _model | Emitter to move. |
sdf::v10::ParticleEmitter::~ParticleEmitter | ( | ) |
Destructor.
ignition::math::Color sdf::v10::ParticleEmitter::ColorEnd | ( | ) | const |
Get the end color for all particles emitted.
The actual color will be interpolated between this color and the one set under ColorStart(). Color::White is the default color for the particles unless a specific function is used.
std::string sdf::v10::ParticleEmitter::ColorRangeImage | ( | ) | const |
Get the path to the color image used as an affector.
This affector modifies the color of particles in flight. The colors are taken from a specified image file. The range of color values begins from the left side of the image and moves to the right over the lifetime of the particle, therefore only the horizontal dimension of the image is used. The ColorRangeImage has higher priority than ColorEnd and ColorStart. If all three are set, ColorRangeImage should be used.
ignition::math::Color sdf::v10::ParticleEmitter::ColorStart | ( | ) | const |
Gets the starting color for all particles emitted.
The actual color will be interpolated between this color and the one set using ColorEnd(). Color::White is the default color for the particles unless a specific function is used.
double sdf::v10::ParticleEmitter::Duration | ( | ) | const |
Get the number of seconds the emitter is active.
A value less than or equal to zero indicates infinite duration.
sdf::ElementPtr sdf::v10::ParticleEmitter::Element | ( | ) | const |
bool sdf::v10::ParticleEmitter::Emitting | ( | ) | const |
Get whether the particle emitter should run (emit particles).
const std::string& sdf::v10::ParticleEmitter::FilePath | ( | ) | const |
The path to the file where this element was loaded from.
double sdf::v10::ParticleEmitter::Lifetime | ( | ) | const |
Get the number of seconds each particle will 'live' for before being destroyed.
Errors sdf::v10::ParticleEmitter::Load | ( | ElementPtr | _sdf | ) |
sdf::Material* sdf::v10::ParticleEmitter::Material | ( | ) | const |
Get a pointer to the emitter's material properties.
This can be a nullptr if material properties have not been set.
double sdf::v10::ParticleEmitter::MaxVelocity | ( | ) | const |
Get the maximum velocity for each particle.
double sdf::v10::ParticleEmitter::MinVelocity | ( | ) | const |
Get the minimum velocity for each particle.
std::string sdf::v10::ParticleEmitter::Name | ( | ) | const |
Get the name of the particle emitter.
The name of the particle emitter should be unique within the scope of a Link.
ParticleEmitter& sdf::v10::ParticleEmitter::operator= | ( | const ParticleEmitter & | _emitter | ) |
Copy assignment operator.
[in] | _emitter | Particle emitter to copy. |
ParticleEmitter& sdf::v10::ParticleEmitter::operator= | ( | ParticleEmitter && | _emitter | ) |
Move assignment operator.
[in] | _emitter | Particle emitter to move. |
ignition::math::Vector3d sdf::v10::ParticleEmitter::ParticleSize | ( | ) | const |
Get the size of a particle in meters.
const std::string& sdf::v10::ParticleEmitter::PoseRelativeTo | ( | ) | const |
Get the name of the coordinate frame relative to which this emitter's pose is expressed.
An empty value indicates that the frame is relative to the parent link.
double sdf::v10::ParticleEmitter::Rate | ( | ) | const |
Get the number of particles per second that should be emitted.
const ignition::math::Pose3d& sdf::v10::ParticleEmitter::RawPose | ( | ) | const |
Get the pose of the particle emitter.
This is the pose of the emitter as specified in SDF (<particle_emitter><pose> ... </pose></particle_emitter>).
double sdf::v10::ParticleEmitter::ScaleRate | ( | ) | const |
Get the amount by which to scale the particles in both x and y direction per second.
sdf::SemanticPose sdf::v10::ParticleEmitter::SemanticPose | ( | ) | const |
Get SemanticPose object of this object to aid in resolving poses.
void sdf::v10::ParticleEmitter::SetColorEnd | ( | const ignition::math::Color & | _colorEnd | ) |
Set the end color for all particles emitted.
[in] | _colorEnd | The end color for all particles emitted. |
void sdf::v10::ParticleEmitter::SetColorRangeImage | ( | const std::string & | _image | ) |
Set the path to the color image used as an affector.
[in] | _image | The path to the color image. |
void sdf::v10::ParticleEmitter::SetColorStart | ( | const ignition::math::Color & | _colorStart | ) |
Set the starting color for all particles emitted.
[in] | _colorStart | The starting color for all particles emitted. |
void sdf::v10::ParticleEmitter::SetDuration | ( | double | _duration | ) |
Set the number of seconds the emitter is active.
[in] | _duration | The number of seconds the emitter is active. A value less than or equal to zero means infinite duration. |
void sdf::v10::ParticleEmitter::SetEmitting | ( | bool | _emitting | ) |
Set whether the particle emitter is running, emitting particles.
[in] | _emitting | True if the emitter should produce particles. |
void sdf::v10::ParticleEmitter::SetFilePath | ( | const std::string & | _filePath | ) |
Set the path to the file where this element was loaded from.
\paramp[in] _filePath Full path to the file on disk.
void sdf::v10::ParticleEmitter::SetLifetime | ( | double | _duration | ) |
Set the number of seconds each particle will 'live' for.
[in] | _duration | The number of seconds a particle will 'life' for. If _duration is <= 0, then the value std::numeric_limits<double>::min() will be used. |
void sdf::v10::ParticleEmitter::SetMaterial | ( | const sdf::Material & | _material | ) |
Set the emitter's material.
[in] | _material | The material of the particle emitter. |
void sdf::v10::ParticleEmitter::SetMaxVelocity | ( | double | _vel | ) |
Set the maximum velocity for each particle.
[in] | _vel | The maximum velocity for each particle in m/s. A value of zero will be used if _vel is negative. |
void sdf::v10::ParticleEmitter::SetMinVelocity | ( | double | _vel | ) |
Set the minimum velocity for each particle.
[in] | _vel | The minimum velocity for each particle in m/s. A value of zero will be used if _vel is negative. |
void sdf::v10::ParticleEmitter::SetName | ( | const std::string & | _name | ) |
Set the name of the particle emitter.
The name of the particle emitter should be unique within the scope of a Link.
[in] | _name | Name of the particle emitter. |
void sdf::v10::ParticleEmitter::SetParticleSize | ( | const ignition::math::Vector3d & | _size | ) |
Set the size of a particle in meters.
[in] | _size | Size of a particle in meters. Each component of _size must be greater than or equal to zero. Any negative value will be replaced with zero. |
void sdf::v10::ParticleEmitter::SetPoseRelativeTo | ( | const std::string & | _frame | ) |
Set the name of the coordinate frame relative to which this emitter's pose is expressed.
An empty value indicates that the frame is relative to the parent link.
[in] | _frame | The name of the pose relative-to frame. |
void sdf::v10::ParticleEmitter::SetRate | ( | double | _rate | ) |
Set the number of particles per second that should be emitted.
[in] | _rate | The number of particle to emit per second. A value of zero will be used if _rate is negative. |
void sdf::v10::ParticleEmitter::SetRawPose | ( | const ignition::math::Pose3d & | _pose | ) |
Set the pose of the particle emitter object.
[in] | _pose | The pose of the particle emitter. |
void sdf::v10::ParticleEmitter::SetScaleRate | ( | double | _scaleRate | ) |
Set the amount by which to scale the particles in both x and y direction per second.
[in] | _scaleRate | The caling amount in the x and y directions. A value of zero will be used if _scaleRate is negative. |
void sdf::v10::ParticleEmitter::SetSize | ( | const ignition::math::Vector3d & | _size | ) |
Set the size of the emitter where the particles are sampled.
[in] | _size | Size of the emitter in meters. Each component of _size must be greater than or equal to zero. Any negative value will be replaced with zero. |
void sdf::v10::ParticleEmitter::SetTopic | ( | const std::string & | _topic | ) |
Set the topic used to update the particle emitter properties.
[in] | _topic | The topic used to update the particle emitter. |
void sdf::v10::ParticleEmitter::SetType | ( | const ParticleEmitterType | _type | ) |
Set the type of the particle emitter.
[in] | _type | Type of the particle emitter. |
bool sdf::v10::ParticleEmitter::SetType | ( | const std::string & | _typeStr | ) |
Set the type of the particle emitter.
The type of the particle emitter should be unique within the scope of a Link.
[in] | _typeStr | Type of the particle emitter. |
ignition::math::Vector3d sdf::v10::ParticleEmitter::Size | ( | ) | const |
Get the size of the emitter where the particles are sampled.
std::string sdf::v10::ParticleEmitter::Topic | ( | ) | const |
Get the topic used to update the particle emitter properties.
ParticleEmitterType sdf::v10::ParticleEmitter::Type | ( | ) | const |
Get the type of the particle emitter.
The type of the particle emitter should be unique within the scope of a Link.
std::string sdf::v10::ParticleEmitter::TypeStr | ( | ) | const |
Get the particle emitter type as a string.