private static void Process(int x, int z, bool keepExisting) { TerrainTopologyMap topologyMap = TerrainMeta.TopologyMap; float normZ = topologyMap.Coordinate(z); float normX = topologyMap.Coordinate(x); int topology = topologyMap.GetTopology(x, z); if ((topology & 8389632) != 0) { return; } float slope = TerrainMeta.HeightMap.GetSlope(normX, normZ); float splat = TerrainMeta.SplatMap.GetSplat(normX, normZ, 8); if ((double)slope > 40.0 || (double)splat > 0.400000005960464) { topologyMap.AddTopology(x, z, 2); } else { if (keepExisting || (double)slope >= 20.0 || ((double)splat >= 0.200000002980232 || (topology & 55296) == 0)) { return; } topologyMap.RemoveTopology(x, z, 2); } }
public override void Process(uint seed) { TerrainTopologyMap topologyMap = TerrainMeta.TopologyMap; int num = topologyMap.res; Parallel.For(0, num, (int z) => { for (int i = 0; i < num; i++) { if (topologyMap.GetTopology(i, z, 4194306)) { topologyMap.AddTopology(i, z, 512); } else if (!this.KeepExisting) { topologyMap.RemoveTopology(i, z, 512); } } }); }
public static void Process(int x, int z) { TerrainTopologyMap topologyMap = TerrainMeta.TopologyMap; float normZ = topologyMap.Coordinate(z); float normX = topologyMap.Coordinate(x); if ((topologyMap.GetTopology(x, z) & 0x800400) == 0) { float slope = TerrainMeta.HeightMap.GetSlope(normX, normZ); float splat = TerrainMeta.SplatMap.GetSplat(normX, normZ, 8); if (slope > 40f || splat > 0.4f) { topologyMap.AddTopology(x, z, 2); } else { topologyMap.RemoveTopology(x, z, 2); } } }
public override void Process(uint seed) { TerrainTopologyMap topomap = TerrainMeta.TopologyMap; int topores = topomap.res; Parallel.For(0, topores, delegate(int z) { for (int i = 0; i < topores; i++) { if (topomap.GetTopology(i, z, 4194306)) { topomap.AddTopology(i, z, 512); } else if (!KeepExisting) { topomap.RemoveTopology(i, z, 512); } } }); }
public override void Process(uint seed) { TerrainTopologyMap topomap = TerrainMeta.TopologyMap; int topores = topomap.res; Parallel.For(0, topores, (Action <int>)(z => { for (int x = 0; x < topores; ++x) { if (topomap.GetTopology(x, z, 4194306)) { topomap.AddTopology(x, z, 512); } else if (!this.KeepExisting) { topomap.RemoveTopology(x, z, 512); } } })); }
private static void Process(int x, int z, bool keepExisting) { TerrainTopologyMap topologyMap = TerrainMeta.TopologyMap; float normZ = topologyMap.Coordinate(z); float normX = topologyMap.Coordinate(x); int topology = topologyMap.GetTopology(x, z); if (!World.Procedural || (topology & 0x800400) == 0) { float slope = TerrainMeta.HeightMap.GetSlope(normX, normZ); float splat = TerrainMeta.SplatMap.GetSplat(normX, normZ, 8); if (slope > 40f || splat > 0.4f) { topologyMap.AddTopology(x, z, 2); } else if (!keepExisting) { topologyMap.RemoveTopology(x, z, 2); } } }
public static void Process(int x, int z) { TerrainTopologyMap topologyMap = TerrainMeta.TopologyMap; float single = topologyMap.Coordinate(z); float single1 = topologyMap.Coordinate(x); if ((topologyMap.GetTopology(x, z) & 8389632) == 0) { float slope = TerrainMeta.HeightMap.GetSlope(single1, single); float splat = TerrainMeta.SplatMap.GetSplat(single1, single, 8); if (slope > 40f || splat > 0.4f) { topologyMap.AddTopology(x, z, 2); return; } if (slope < 20f && splat < 0.2f) { topologyMap.RemoveTopology(x, z, 2); } } }
private static void Process(int x, int z, bool keepExisting) { TerrainTopologyMap topologyMap = TerrainMeta.TopologyMap; float single = topologyMap.Coordinate(z); float single1 = topologyMap.Coordinate(x); int topology = topologyMap.GetTopology(x, z); if ((topology & 8389632) == 0) { float slope = TerrainMeta.HeightMap.GetSlope(single1, single); float splat = TerrainMeta.SplatMap.GetSplat(single1, single, 8); if (slope > 40f || splat > 0.4f) { topologyMap.AddTopology(x, z, 2); return; } if (!keepExisting && slope < 20f && splat < 0.2f && (topology & 55296) != 0) { topologyMap.RemoveTopology(x, z, 2); } } }