예제 #1
0
        static Chunk()
        {
            neighbors = new Vec3i[26];
            var index = 0;

            for (int x = -1; x <= 1; x++)
            {
                for (int y = -1; y <= 1; y++)
                {
                    for (int z = -1; z <= 1; z++)
                    {
                        if (x != 0 || y != 0 || z != 0)
                        {
                            neighbors[index++] = new Vec3i(x, y, z);
                        }
                    }
                }
            }
        }
예제 #2
0
 bool Equals(Vec3i obj)
 {
     return(x == obj.x && y == obj.y && z == obj.z);
 }
예제 #3
0
 public FacingD(int x, int y, int z, CompasEnum index)
 {
     vector     = new Vec3i(x, y, z);
     this.index = index;
 }
예제 #4
0
 public void Add(Vec3i offset)
 {
     x = x + offset.x;
     y = y + offset.y;
     z = z + offset.z;
 }
예제 #5
0
 public void Set(Vec3i v)
 {
     x = v.x;
     y = v.y;
     z = v.z;
 }
예제 #6
0
 public void Set(BlockPos pos, Vec3i offset)
 {
     this.x = pos.x + offset.x;
     this.y = pos.y + offset.y;
     this.z = pos.z + offset.z;
 }
예제 #7
0
 public void AddChunk(Vec3i pos)
 {
     this.x += pos.x << 4;
     this.y += pos.y << 4;
     this.z += pos.z << 4;
 }
예제 #8
0
 float GetNoise(BlockPos pos, float scale, Vec3i offset)
 {
     return((float)GetNoise(pos.x * scale + offset.x, pos.y * scale + offset.y, pos.z * scale + offset.z));
 }