Open isaac-mason opened 10 months ago
Change for deferring addition/removal of objects while stepping is in next
: https://github.com/pmndrs/p2-es/commit/eabee3fefd9f3c88869260b68e8d9bcd1f15c756
For the moment the change for deferring addition/removal of objects while stepping has been reverted: https://github.com/pmndrs/p2-es/commit/46f179eb8e03c6fc71dc4ca6eb4eba1fe2762810
I'm not confident it was the best approach. The ideal solution is to make changes to support adding bodies during a step. e.g. cannon-es does not have this limitation, we should check how it handles this.
If an object (body, constraint, spring) is added or removed from the world while the world is stepping, an error is thrown.
Developers need to work around this by scheduling changes to run after the step.
Can we improve this? e.g.