Exemple #1
0
 public int FlatDistanceSquared(Vector3i v)
 {
     return FlatDistanceSquared(this, v);
 }
Exemple #2
0
 public Vector3i Add(Vector3i pos)
 {
     return new Vector3i(this.x + pos.x, this.y + pos.y, this.z + pos.z);
 }
Exemple #3
0
 public float Distance(Vector3i v)
 {
     return Distance (this, v);
 }
Exemple #4
0
 public static int IndexOfDirection(Vector3i direction)
 {
     return System.Array.IndexOf (allDirections, direction);
 }
Exemple #5
0
 public static Vector3i GetNeighbourDirection(Vector3i a, Vector3i b)
 {
     return b - a;
 }
Exemple #6
0
 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;
 }
Exemple #7
0
 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);
 }
Exemple #8
0
 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);
 }