Description
Hello,
I am trying to implement modifications to objects already in a Scene
. The simplest example is the ability to delete a PolygonInstance
after it has been added to a scene.
The Scene::remove_object
requires a pointer to the entire T: Rendered
rather than a RenderID
, even though it simply references the object by id for removal from the Scene::objects
member. Is it necessary to keep a pointer to the T: Rendered
object in order to implement this behavior?
This is a bit onerous as it requires propagating lifetimes to maintain the collection of pointers, e.g. my_objects: HashMap<String, &'a PolygonInstance>
. I understand I may be missing something about how these are used to synchronize data with the GPU, though.
truck/truck-platform/src/scene.rs
Lines 546 to 552 in c4f93af
Would it be reasonable to add a Scene::remove_object_by_id
member? I would be happy to open a PR if the change makes sense.