There's many articles on the internet focusing on how to implement movement, collision detection, or collision resolution. What I'm wondering is how to put them together, specifically in what order to perform them.
Should one iterate through all physics objects and do movement, collision detection and resolution for each (approach A), or perform movement for all objects, then detect all collisions, and finally resolve all collisions (approach B), or some combination thereof? Is there an approach that is universally superior? If not, what are the pros and cons for each approach (including ones I haven't listed)?
Approach A:
for (all objects)
object.move
object.detect_collisions
object.resolve_collisions
Approach B:
for (all objects)
object.move
for (all objects)
object.detect_collisions
for (all objects)
object.resolve_collisions