public int FlatDistanceSquared(Vector3i v) { return FlatDistanceSquared(this, v); }
public Vector3i Add(Vector3i pos) { return new Vector3i(this.x + pos.x, this.y + pos.y, this.z + pos.z); }
public float Distance(Vector3i v) { return Distance (this, v); }
public static int IndexOfDirection(Vector3i direction) { return System.Array.IndexOf (allDirections, direction); }
public static Vector3i GetNeighbourDirection(Vector3i a, Vector3i b) { return b - a; }
public static int FlatDistanceSquared(Vector3i a, Vector3i b) { int dx = b.x-a.x; int dz = b.z-a.z; return dx*dx + dz*dz; }
public static float Distance(Vector3i a, Vector3i b) { int dx = b.x - a.x; int dy = b.y - a.y; int dz = b.z - a.z; return Mathf.Sqrt (dx * dx + dy * dy + dz * dz); }
public static bool AreNeighbours(Vector3i a, Vector3i b) { return (a.x == b.x || a.x == b.x + 1 || a.x == b.x - 1) && (a.y == b.y || a.y == b.y + 1 || a.y == b.y - 1) && (a.z == b.z || a.z == b.z + 1 || a.z == b.z - 1); }