raycasting distance integrator