-
Notifications
You must be signed in to change notification settings - Fork 268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Particle system - Part4 #615
Conversation
Signed-off-by: Carlos Agüero <caguero@openrobotics.org>
Signed-off-by: Carlos Agüero <caguero@openrobotics.org>
Signed-off-by: Carlos Agüero <caguero@openrobotics.org>
Signed-off-by: Carlos Agüero <caguero@openrobotics.org>
// Create an entity. | ||
auto entity = _ecm.CreateEntity(); | ||
if (entity == kNullEntity) | ||
{ | ||
ignerr << "Failed to create a particle emitter entity command" << std::endl; | ||
return; | ||
} | ||
|
||
_ecm.CreateComponent( | ||
entity, | ||
components::ParticleEmitterCmd({this->dataPtr->userCmd})); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I mentioned in my other comment, I think it would be better to make the particle emitter command a component of the original emitter entity defined in Configure
instead of creating a separate entity just for the command. I'm not sure what difficulties this change would introduce, though. I'm assuming that there may be difficulty deleting the component once the update has been applied and re-defining the component if new commands are given.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done. a07c2ba
I ran into an issue with removing the ParticleEmitterCmd component from the entity, which still needs to be resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ran into an issue with removing the ParticleEmitterCmd component from the entity, which still needs to be resolved
Interesting, so the component is never removed? Maybe the new msgCmd component wasn't added to the entity yet, and we are trying to remove the component too soon? For example, would it make more sense to remove components after updating the emitters with the msgCmd in RenderUtil::Update()
?:
https://github.com/ignitionrobotics/ign-gazebo/blob/a07c2ba39162191bacfe2fb74f1e1236124c0dac/src/rendering/RenderUtil.cc#L573-L577
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's an issue with updating components on the gui side. Adding a OneTimeChange in the particle system when setting component data seem to made sure the new values are propagated to the gui. Updating the emitter properties should work now after f8a971d
Signed-off-by: Ian Chen <ichen@osrfoundation.org>
Signed-off-by: Ian Chen <ichen@osrfoundation.org>
Signed-off-by: Ashton Larkin <ashton@openrobotics.org>
Signed-off-by: Ian Chen <ichen@osrfoundation.org>
Signed-off-by: Ian Chen <ichen@osrfoundation.org>
Signed-off-by: Ian Chen <ichen@osrfoundation.org>
Everything seems good. @iche033 Quick question before merging: is the one time change fix for updating components a temporary solution, or is it a permanent fix? |
Signed-off-by: Ian Chen <ichen@osrfoundation.org>
I'm not exactly sure if it's the right fix so I added a note in 4142eea |
This pull request adds the ability to change the properties of an existing particle emitter at runtime.
See
examples/worlds/particle_emitter.sdf
for testing.