Box2D Forum Archive
Search Settings
Home › Box2D › General Discussion

Best practice?

General Discussion
N n1ghtly
Apr 9, 2012 02:46
My game entity has a b2Body as member. In the destructor of my entity, how do I destroy the body?
I think you need the b2World instance for that, is it wise to keep a pointer to the instance in my class?
I irresistible force
Apr 9, 2012 07:55
You can do
body->GetWorld->DestroyBody(body);
N n1ghtly
Apr 10, 2012 02:22
Thank you!

Original thread: https://box2d.org/forum/viewtopic.php?t=8356

This is an unofficial, read-only archive preserved for the community. Original site: https://box2d.org

Want your posts removed? See removal requests or email [email protected]. · Preserved with Forum Ark · Privacy · About