amethyst / amethyst/specs-physics
Colliders attached to dead Entities are never removed
- Lingua principale
- Rust
- Stelle
- 96
- Fork
- 29
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
I've been using this lib, it's very nice but of course some functionality is missing.
As I go along, I've been adding the things that it's missing that I need and keeping each feature in a separate branch on my github. I'll make an effort to merge all that you guys want after Amethyst is updated to specs 0.15.0, because all of my add-ons are based off of that.
Anyway, I needed to do some raycasting, so I exposed a method on your Physics struct which calls the `interferences_with_ray` method on the collider world of the nphysics::World that the Physics stores. I'm able to very easily just grab this Physics struct from my ECS systems and do the raycasting that I need to do.
I wanted to manipulate the components of the entity which owns the collider that the ray hit. I was planning on making it so that I could use the `user_data` method of the nphysics ColliderDesc through your guys's PhysicsColliderBuilder. This would allow me to put the Id of the ECS entity associated with the collider in the user data, so that I could fetch it later and use it to manipulate some components.
When I started trying to add a method to the PhysicsColliderBuilder to let me add user data, I learned that you guys are already using the struct to store the Id of the entity just as I would've.
Naturally, to test my solution, I attempt to delete the entity attached to the collider in question. This seems to work: all of the other components are removed from my entity.
The collider, however, is still there. The bodies I'm doing raycasting against are static and in their own collision group, but I suspect that if I had them as normal dynamic bodies, one would still be able to collide with them, despite the fact that the colliders in question are associated with entities which are, in fact, dead.
I'm more than willing to PR a bugfix for this, but this is getting into the sort of arcane nphysics juggling systems magic that would require some pretty good knowledge of your guys's code base. Some pointers would be greatly appreciated. (I'm also not too worried about this because the bodies I'm raycasting against are static; the fact that they aren't actually deleted is somewhat annoying but functionally irrelevant to me, so this issue also serves as documentation of the problem)
Thanks in advance,
Cedric Hutchings.
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Valutazione
Questa issue non è ancora stata valutata.