After a shape has been added to a body template, and a body has been made from the body template, how can I then delete the shape from the body? I have the pointer to the actual instance of the shape when it is part of the body.
How to delete a shape after it has been made into a body?
General DiscussionThere is no API support for this. Are you trying to make something that breaks?
For now you could just recreate the body with one less shape.
Let me know what you are trying to do and I'll add a task to the TODO list.
For now you could just recreate the body with one less shape.
Let me know what you are trying to do and I'll add a task to the TODO list.
Or you could just lock the bodies together using 3DOF of constraints (i.e a pin constraint and an orn constraint), then delete the constraints whenever you want things to break.
Yeah, if you use a revolute joint with lower limit == upper limit, this will work. I actually detect this case and lock the rotation completely.
Original thread: https://box2d.org/forum/viewtopic.php?t=62