Improve min distance computation

And eliminate the compound call used to reorder the yz components of a vec3 - there is a method/accessor in Vector3 (.xzy) that does the swap without the need for additional function calls and switches.