Free flight. Far from planets the probe and the rocks move in straight lines at constant velocity (Newton's first law). The simulation ignores the rocks' own gravity (a 20 m rock pulls with about 10-6 m/s² at 50 m) and radiation pressure.
Closest approach. With relative position r and relative velocity v the separation is |r + vt|. It is smallest at t* = -(r·v)/|v|² with miss distance d = |r + v t*|. If t* < 0 the rock is receding. The clearance shown is d minus the sum of the probe and rock radii.
Cheapest dodge. A velocity change Δv at time t* before closest approach shifts the miss vector by Δv t*, so the minimum push (perpendicular to the relative velocity) is Δv = (dsafe - d)/t*: the cost falls as 1/t*, so the earlier the warning, the cheaper. The planner tries 24 directions around the approach axis plus the 6 axes and takes the smallest impulse that clears every rock within the horizon.
Finite burns. Thrust F gives a = F/m, so a burn of length τ moves the probe by aτ(t - τ/2) and the minimum warning is about √(2 m d / F).
Rocket equation. Exhaust speed ve = Isp g0, mass flow F/ve, and Δv = ve ln(m0/mf). Each time step applies the exact logarithmic increment, so there is no integration error. Chemical engines (Isp about 285 s) give high thrust, ion drives (3000 s) give 10x more delta-v per kg but tiny thrust.
Impacts. Contact is a one-dimensional collision along the line of centres with restitution e; the lost kinetic energy is (1 - e²) ½ μ vn² with reduced mass μ. Rocks are far heavier than the probe.
Simplifications. Spheres for collisions (the meshes are lumpy but the contact radius is a sphere); the probe's attitude is fixed and thrust in any direction is available (a reaction-control system on every face); thrusters throttle continuously; no thruster misalignment or plume impingement; rocks do not collide with each other.