[READ-ONLY] Mirror of https://github.com/excaliburjs/Excalibur. 🎮 Your friendly TypeScript 2D game engine for the web 🗡️ excaliburjs.com
excalibur excaliburjs game-development game-engine game-framework gamedev games html5-canvas typescript

fix: [#2344] [#2343] Arcade Solver sorts contacts by distance and ignores diverging contacts (#2345) master

Closes #2344 #2343 This PR changes how the `ArcadeSolver` solves collisions to avoid errant collisions on seams in geometry. The idea behind this fix is to sort the collision contacts by distance. Additionally if a contact has no more overlap during processing they are now discarded so errant collisions are even evaluated. Note there are no more left right collisions in the console compared to the [sandbox](https://8wf42u.csb.app/) ![sorted-collisions](https://user-images.githubusercontent.com/612071/172401390-9e9c3490-3566-47bf-b258-6a7da86a3464.gif) This PR also fixes #2343 by ignoring "divergent contacts" which are when the underlying body's are already moving away from the contact, so no velocity adjustment is needed. This was noticeable when clipping corners, but the object was already moving out of the collision. ![cancel-velocity-fix](https://user-images.githubusercontent.com/612071/172500318-539f3a36-31ae-4efc-b6ab-c4524b297adb.gif) TODO: * [x] Look into #2343 to see if this helps * [x] Also sort by collider proximity * [x] Tests ## Changes: - Change the `Solver` from abstract class to an interface to be more flexible about solvers - Sorts contacts by body distance from each other - Cancels "divergent contacts" when the bodies are moving away from the contact


+488 -101
11 changed files