directionAt

Unit vector pointing from point toward the center of the passable neighbor of point's voxel with the smallest field value (i.e., the most-downhill step in the 3D gradient).

Returns Point3D.ORIGIN when the agent should not move:

  • already at a source (goal reached),

  • voxel is unreachable from any source,

  • voxel is blocked or out of bounds,

  • no passable neighbor strictly improves the field value,

  • the chosen neighbor's center coincides with point (degenerate; should not occur for well-formed inputs).

The zero-vector return lets a force-summation expression like field.directionAt(pos) * speed short-circuit cleanly when the agent has nowhere to go.