edgeWeight

fun edgeWeight(from: Voxel, to: Voxel): Double(source)

Weight of the edge from from to to. Equals voxelCostOf(to) * stepLength, where stepLength is:

  • 1.0 for orthogonal moves (one axis differs)

  • √2 for face-diagonal moves (two axes differ)

  • √3 for body-diagonal moves (all three axes differ)

The caller is responsible for ensuring to is a neighbor of from under the movement rule; this function does not validate that.