I've added impulse solver, the next step I think you can impletment the aabb bounding box, and optimize time complexity using spatial grid / hash grid / quadtree / BVH etc (I'm not an expert at time complexity optimize, idk which one is the best, prob BVH cause box2d using it), the objects are jittering because it's not multi-manifolds, if you want to fix the jittering, you can use advanced-SAT (infident face & clipping method to get multi-contact points: https://scratch.mit.edu/projects/1291935217/), and apply warm starting and slop: https://scratch.mit.edu/projects/1292488912/), BVH for optimized AABB: https://scratch.mit.edu/projects/1297015994/. good luck :)