Everything you built runs at once - integration, collision, restitution, correction, iteration - as a ball drops onto the ground and comes to rest. This is the working engine.
Run the full simulation until a dropped ball settles at rest on the ground, without passing through it.
This is the promise the whole project was built to keep: a real 2D rigid-body
physics engine. The ball is released three units up and everything you built runs on
every one of the six hundred frames. Semi-implicit Euler integrates it downward under
gravity; the broadphase and narrowphase find the moment it meets the ground; the impulse
solver, iterated for stability, kills its downward velocity; and positional correction
lifts it out of the small overlap so it rests just above the surface - its center settling
near 0.45, sunk by about the collision slop - instead of sinking away or jittering.
Every layer is doing its job at once. From a Vec2 that could only add, you have built
integration, rigid bodies, three shapes, full collision detection with exact contact
manifolds, and impulse resolution with restitution, friction, and rotation - the honest
core of the design that Box2D and every 2D game engine uses. It stops short of warm
starting, joints, and continuous collision, and that is the road ahead. Print the ball’s
height each frame to watch it fall and settle: that trace is your engine, running.
w := &World{Gravity: Vec2{0, -10}, VelocityIterations: 8}// add the static ground circle and the dynamic ball, then:for i := 0; i < 600; i++ {w.Step(1.0 / 60.0)// print ball.Position.Y every 30 steps to watch it fall and settle}