The deferred event dispatcher does nothing more than provide a deferred copy of the most recent events. Since Depth1 is the latest available value, that's what you see. In the above example, Depth2 has not yet been computed; that's what the
next frame will compute.
The choice of stage execution order is somewhat arbitrary, but they all come with tradeoffs. For example, in v2, the current default layout is position integration->narrowphase->solver, so at the end of the frame the contacts and body positions are consistent. The downside is that a velocity modified outside the update will be directly integrated without a narrowphase/solve to stop it from pushing through other objects.
Note that the simulation loop is the same either way. If you ran the simulation without frame interruptions, it would just be a long sequence of:
Code: Select all
...->solver->integration->broadphase->narrowphase->solver->integration->broadphase->narrowphase->solver->integration->broadphase->...
So, if you really wanted to, you could hook a callback for arbitrary logic in between any of those stages. Nothing fundamentally special about being outside Space.Update.
By the way, how can I get both hit points' normal from the objects? Contact.Normal is just the one of them.
Enumerating the Contacts collection on a pair handler should show all the existing different contacts. Note that in a convex manifold, all of the normals should be equal outside of a few corner cases involving old persistent contacts. (Mathematically, two touching convex rigid bodies can only have a single contact patch, and that patch is guaranteed to be flat.)