public bool Intersects(Cuboid a) { if (!IntersectsDimension(a.Pos.x, a.Pos.x + a.Size.x, Pos.x, Pos.x + Size.x)) { return(false); } if (!IntersectsDimension(a.Pos.y, a.Pos.y + a.Size.y, Pos.y, Pos.y + Size.y)) { return(false); } if (!IntersectsDimension(a.Pos.z, a.Pos.z + a.Size.z, Pos.z, Pos.z + Size.z)) { return(false); } return(true); }
private static Task BuildRect(World world, Cuboid c, BiomeConfiguration configuration = null, LoadedVoxelMaterial mat = null) { return(Task.Run(() => { for (var x = c.Pos.x; x < c.Pos.x + c.Size.x; x++) { for (var z = c.Pos.z; z < c.Pos.z + c.Size.z; z++) { var i = 0; for (var y = c.Pos.y + c.Size.y - 1; y >= c.Pos.y; y--) { if (configuration != null) { mat = configuration.GetLayer(i); } world.SetVoxel(mat, new Vector3Int(x, y, z)); i++; } } } })); }