Fix reset for rendering sensors
🦟 Bug fix
Summary
In the case where objects are spawned after simulation has started and a Reset occurs, the Sensors system was failing to remove the spawned objects. Subsequent attempts to respawn the same objects also fail because they are likely to be assigned the same Entity IDs.
The thing to note here is that the EachNew and EachRemoved function of the ECM have to be called from the Reset handler, since the newly created/removed entities are cleared by the next PreUpdate.
TODO:
- [ ] Suppress the "already exists" warning if a Reset has occured.
Checklist
- [ ] Signed all commits for DCO
- [ ] Added tests
- [ ] Updated documentation (as needed)
- [ ] Updated migration guide (as needed)
- [ ] Consider updating Python bindings (if the library has them)
- [ ]
codecheckpassed (See contributing) - [ ] All tests passed (See test coverage)
- [ ] While waiting for a review on your PR, please help review another open pull request to support the maintainers
- [ ] Was GenAI used to generate this PR? If so, make sure to add "Generated-by" to your commits. (See this policy for more info.)
Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by and Generated-by messages.
🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸
Any chance we can get a regression test for this?