A description of a particle emitter, which can be attached to a link. More...
#include <ParticleEmitter.hh>
Public Member Functions | |
ParticleEmitter () | |
Default constructor. More... | |
gz::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... | |
gz::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... | |
const 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... | |
gz::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 gz::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... | |
float | ScatterRatio () const |
Get the particle scatter ratio. More... | |
sdf::SemanticPose | SemanticPose () const |
Get SemanticPose object of this object to aid in resolving poses. More... | |
void | SetColorEnd (const gz::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 gz::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 gz::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 gz::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 | SetScatterRatio (float _ratio) |
Set the particle scatter ratio. More... | |
void | SetSize (const gz::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... | |
gz::math::Vector3d | Size () const |
Get the size of the emitter where the particles are sampled. More... | |
sdf::ElementPtr | ToElement () const |
Create and return an SDF element filled with data from this particle emitter. More... | |
sdf::ElementPtr | ToElement (sdf::Errors &_errors) const |
Create and return an SDF element filled with data from this particle emitter. 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::SDF_VERSION_NAMESPACE::ParticleEmitter::ParticleEmitter | ( | ) |
Default constructor.
gz::math::Color sdf::SDF_VERSION_NAMESPACE::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::SDF_VERSION_NAMESPACE::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.
gz::math::Color sdf::SDF_VERSION_NAMESPACE::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::SDF_VERSION_NAMESPACE::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::SDF_VERSION_NAMESPACE::ParticleEmitter::Element | ( | ) | const |
bool sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::Emitting | ( | ) | const |
Get whether the particle emitter should run (emit particles).
const std::string& sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::FilePath | ( | ) | const |
The path to the file where this element was loaded from.
double sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::Lifetime | ( | ) | const |
Get the number of seconds each particle will 'live' for before being destroyed.
Errors sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::Load | ( | ElementPtr | _sdf | ) |
const sdf::Material* sdf::SDF_VERSION_NAMESPACE::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::SDF_VERSION_NAMESPACE::ParticleEmitter::MaxVelocity | ( | ) | const |
Get the maximum velocity for each particle.
double sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::MinVelocity | ( | ) | const |
Get the minimum velocity for each particle.
std::string sdf::SDF_VERSION_NAMESPACE::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.
gz::math::Vector3d sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::ParticleSize | ( | ) | const |
Get the size of a particle in meters.
const std::string& sdf::SDF_VERSION_NAMESPACE::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::SDF_VERSION_NAMESPACE::ParticleEmitter::Rate | ( | ) | const |
Get the number of particles per second that should be emitted.
const gz::math::Pose3d& sdf::SDF_VERSION_NAMESPACE::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::SDF_VERSION_NAMESPACE::ParticleEmitter::ScaleRate | ( | ) | const |
Get the amount by which to scale the particles in both x and y direction per second.
float sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::ScatterRatio | ( | ) | const |
Get the particle scatter ratio.
This is used to determine the ratio of particles that will be detected by sensors.
sdf::SemanticPose sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::SemanticPose | ( | ) | const |
Get SemanticPose object of this object to aid in resolving poses.
void sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::SetColorEnd | ( | const gz::math::Color & | _colorEnd | ) |
Set the end color for all particles emitted.
[in] | _colorEnd | The end color for all particles emitted. |
void sdf::SDF_VERSION_NAMESPACE::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::SDF_VERSION_NAMESPACE::ParticleEmitter::SetColorStart | ( | const gz::math::Color & | _colorStart | ) |
Set the starting color for all particles emitted.
[in] | _colorStart | The starting color for all particles emitted. |
void sdf::SDF_VERSION_NAMESPACE::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::SDF_VERSION_NAMESPACE::ParticleEmitter::SetEmitting | ( | bool | _emitting | ) |
Set whether the particle emitter is running, emitting particles.
[in] | _emitting | True if the emitter should produce particles. |
void sdf::SDF_VERSION_NAMESPACE::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::SDF_VERSION_NAMESPACE::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::SDF_VERSION_NAMESPACE::ParticleEmitter::SetMaterial | ( | const sdf::Material & | _material | ) |
Set the emitter's material.
[in] | _material | The material of the particle emitter. |
void sdf::SDF_VERSION_NAMESPACE::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::SDF_VERSION_NAMESPACE::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::SDF_VERSION_NAMESPACE::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::SDF_VERSION_NAMESPACE::ParticleEmitter::SetParticleSize | ( | const gz::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::SDF_VERSION_NAMESPACE::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::SDF_VERSION_NAMESPACE::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::SDF_VERSION_NAMESPACE::ParticleEmitter::SetRawPose | ( | const gz::math::Pose3d & | _pose | ) |
Set the pose of the particle emitter object.
[in] | _pose | The pose of the particle emitter. |
void sdf::SDF_VERSION_NAMESPACE::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::SDF_VERSION_NAMESPACE::ParticleEmitter::SetScatterRatio | ( | float | _ratio | ) |
Set the particle scatter ratio.
This is used to determine the ratio of particles that will be detected by sensors.
[in] | _ratio | Scatter ratio. |
void sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::SetSize | ( | const gz::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::SDF_VERSION_NAMESPACE::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::SDF_VERSION_NAMESPACE::ParticleEmitter::SetType | ( | const ParticleEmitterType | _type | ) |
Set the type of the particle emitter.
[in] | _type | Type of the particle emitter. |
bool sdf::SDF_VERSION_NAMESPACE::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. |
gz::math::Vector3d sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::Size | ( | ) | const |
Get the size of the emitter where the particles are sampled.
sdf::ElementPtr sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::ToElement | ( | ) | const |
sdf::ElementPtr sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::ToElement | ( | sdf::Errors & | _errors | ) | const |
std::string sdf::SDF_VERSION_NAMESPACE::ParticleEmitter::Topic | ( | ) | const |
Get the topic used to update the particle emitter properties.
ParticleEmitterType sdf::SDF_VERSION_NAMESPACE::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::SDF_VERSION_NAMESPACE::ParticleEmitter::TypeStr | ( | ) | const |
Get the particle emitter type as a string.