I think there are many situations where it would be beneficial to have access to a contact impulse before completing all solver iterations.
In particular, implementing breakage is hindered by this situation: the breakage must occur before the velocity solver iterations, but the calculation of contact impulse is dependent on the result of those solver iterations.
The only thing we can do at present is to let the simulation step complete to get the impulse value, and retroactively apply changes in velocity, position, and geometry due to breakage.
This means that in order to get correct behavior it may be necessary to run two entire simulation steps. If the first one yields impulses that trigger events, the events are applied, the world is rewinded and stepped again, this time producing the desired results. This is bad because it requires the storing and resetting of the state of all bodies.
To address this I am proposing a lightweight solver sub-step which is designed to provide an estimate of impulse data for the purposes of determining breakage and similar effects. Bodies which have been previously flagged will then receive "pre-solve" impulses. The benefit of having this is that the entire rest of the simulation step (broadphase, collisions) is not wasted. Basically what I'm looking for is some method to obtain the impulses without incurring the full cost of a step.
In particular, implementing breakage is hindered by this situation: the breakage must occur before the velocity solver iterations, but the calculation of contact impulse is dependent on the result of those solver iterations.
The only thing we can do at present is to let the simulation step complete to get the impulse value, and retroactively apply changes in velocity, position, and geometry due to breakage.
This means that in order to get correct behavior it may be necessary to run two entire simulation steps. If the first one yields impulses that trigger events, the events are applied, the world is rewinded and stepped again, this time producing the desired results. This is bad because it requires the storing and resetting of the state of all bodies.
To address this I am proposing a lightweight solver sub-step which is designed to provide an estimate of impulse data for the purposes of determining breakage and similar effects. Bodies which have been previously flagged will then receive "pre-solve" impulses. The benefit of having this is that the entire rest of the simulation step (broadphase, collisions) is not wasted. Basically what I'm looking for is some method to obtain the impulses without incurring the full cost of a step.