Since now, I’ve been accessing box2d bodies (to change or to get their values) with this for loop copied from the web:
for (var b = world.GetBodyList(); b != null; b = b.GetNext())
works fine but… Is there any other faster way to do so? Can’t I just store a reference to the bodies in an array so then have always access to it?
Thanks!
I don’t know which version of Box2DJs you’re using but you can do something like this: