-
Notifications
You must be signed in to change notification settings - Fork 6
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
Sync{Bodies|Colliders}ToPhysics systems fail to remove things from the physics world #21
Comments
Hey! Just pinging to say thanks for opening the issue. I'm gonna see if I could investigate this sometime soon. Main reason why the description warns people to not use the repository is because it currently has git hash dependencies still (and probably more bugs like this). I think it's not too far off a 0.1.0 release, however. At which point I'll probably remove that warning. |
I'm glad to hear back! If it's any help, I tried two approaches to fix this in my toy app.
The second approach seems to work, but it feels dirty and somewhat unextensible. |
I put some more time in and figured out how to make my first approach work. I made a |
The custom storage part is interesting to me. This problem of synchronization between libraries that force all data into World-like instances and an ECS application is truly frustrating and error prone. It feels like every line of code has a bit of interconnected state in it that's bound to blow up somehow that's completely impossible to test for. |
I see the big "do not use" message in the readme, but I was pointed here after asking for advice in the Amethyst Discord.
I've got a toy app that I'm trying to integrate with NCollide, where most entities will have a
CollisionObjectHandle
. I want to make sure that when those entities are deleted, the corresponding collision object is deleted from theCollisionWorld
. That seems to be one of the things you aim to do with this project, but for NPhysics objects.Unfortunately, it looks like the currently-implemented approach doesn't actually work.
When the entities are despawned, the
sync_bodies_to_physics
andsync_colliders_to_physics
systems look up their respective handles from storage in order to remove them from the physics world... but by that point the handles are seemingly already deleted.I modified the
amethyst.rs
example, adding a pair of systems to spawn and despawn a handful of balls: dylemma@d8160c3The result:
The text was updated successfully, but these errors were encountered: