Пример #1
0
        public float Distance(WorldSize size, ChunkIndex target)
        {
            int x = MathExt.DisDirMod(X, target.X, size.X);
            int y = MathExt.DisDirMod(Y, target.Y, size.Y);
            int z = MathExt.DisDirMod(Z, target.Z, size.Z);

            return((float)Math.Sqrt((x * x) + (y * y) + (z * z)));
        }
Пример #2
0
 public ChunkIndex(Vector3 worldCoordinates, WorldSize size)
     : base((int)Math.Floor(worldCoordinates.X / 16), (int)Math.Floor(worldCoordinates.Y / 16), (int)Math.Floor(worldCoordinates.Z / 16), size)
 {
 }
Пример #3
0
 public ChunkIndex(int x, int y, int z, WorldSize worldSize) : base(x, y, z, worldSize)
 {
 }