public async Task GenerateTile(Vector2Int tileCoords) { _generatingCoords.Add(tileCoords); var collector = new Collector(Collector.Preset.ENGINE); var view = new ZoneView(); const double margin = 0.05; float width = tileWidth; view.bbox.xmin = (tileCoords.x + margin) * width; view.bbox.ymin = (tileCoords.y + margin) * width; view.bbox.zmin = minAltitude; view.bbox.xmax = view.bbox.xmin + width * (1 - margin * 2); view.bbox.ymax = view.bbox.ymin + width * (1 - margin * 2); view.bbox.zmax = maxAltitude; view.resolution = resolution / tileWidth; await collector.CollectZone(_world, view); AddTerrains(collector); _generatingCoords.Remove(tileCoords); }
public async Task CollectZone(World world, ZoneView view) { await Task.Run(() => collectZone(_handle, world._handle, view)); await Collect(world); }
private static extern void collectZone(IntPtr collector, IntPtr world, ZoneView view);