Hi, I'm new to Box2d and have sort of a general question about a thing I'm not particularly clear on. I apologize if it has been asked before, I tried searching but wasn't exactly sure how to phrase the query well.
When you add a body to the world or add a fixture to a body, the functions that do so return a Body and a Fixture, respectively. It seems that it's not necessary to actually store these return values for the body/fixture to continue to exist in the world (I have a separate function addCircle() that doesn't store them). I have a world that, for now, only rains down circles, so not having to store them is nice.
My question, is, then: generally, under what circumstances would you want to save these return values? Is it for body/fixtures that respond to user input? Should you, as a rule of thumb, design the world to operate as much on its own as possible? I have my own intuitions, but rather than learn through trial and error, I'm curious what your rules of thumbs are.
When you add a body to the world or add a fixture to a body, the functions that do so return a Body and a Fixture, respectively. It seems that it's not necessary to actually store these return values for the body/fixture to continue to exist in the world (I have a separate function addCircle() that doesn't store them). I have a world that, for now, only rains down circles, so not having to store them is nice.
My question, is, then: generally, under what circumstances would you want to save these return values? Is it for body/fixtures that respond to user input? Should you, as a rule of thumb, design the world to operate as much on its own as possible? I have my own intuitions, but rather than learn through trial and error, I'm curious what your rules of thumbs are.