onPostUpdate method
Override to react after the update phase each frame.
Called after all registered listenOnPostUpdate listeners.
Implementation
@override
void onPostUpdate(double dt) {
// Clear reusable structures
_bodies.clear();
_checkedPairs.clear();
spatialGrid.clear();
// Phase 1: Build spatial grid with movable entities
_buildSpatialGrid();
// Phase 2: Check collisions only for nearby pairs
_resolveCollisions();
}