Purpose-build physics engine