-
Notifications
You must be signed in to change notification settings - Fork 144
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
EntityListener and Box2D bodies #188
Comments
Best thing to do is probably just to avoid removing the single component altogether. These semantics were discussed in #186. |
@antag99 my case is to remove body from particle entity that have stopped and I don't need to move it ever again. If there is no other way I will create special component and system that would handle body removal before component removal. Listeners seemed more convenient. |
@lukz You could kill the particle and create a separate "decal" entity, or freeze the body. |
@lukz You could just create a |
Ashely wiki suggests to use EntityListeners to remove Box2D bodies. I also think it's the best way to handle that task.
So I've created listener:
And added listener to engine:
My PhysicsComponent contains Box2D body so I have to get this component in listener to destroy the body but I can't do this because Listener is notified after component removal in case of removing single component from Entity.
Is there any way to resolve that issue?
The text was updated successfully, but these errors were encountered: