public void DiscoverField(Vector3 center, float size) { TaskPool.QueueTask(() => { AquariaTerrainGenerator tgen = new AquariaTerrainGenerator(worldGenerator); Vector3 point = center; float subTreeSize = AquariaTree.GetSubtreeSize(); AquariaTerrainGenerator.SetValueDelegate pillarSetup = (Vector3 inputPoint, sbyte value) => { AquariaTree.SetValueAtPoint(inputPoint, value); }; for (float ix = -size * 0.5f; ix < size * 0.5f; ix += 1f) { point.x = center.x+ix; for (float iz = -size * 0.5f; iz < size * 0.5f; iz += 1f) { point.z = center.z+iz; //AquariaTerrainGenerator tgen = new AquariaTerrainGenerator(128, 64f); worldGenerator.GeneratePillar2(point, pillarSetup); } } }, () => { DebugOutput.Shout("created subfields"); } ); }
public void GenerateSubField(AquariaSubTree subtree) { int setvaluecnt = 0; TaskPool.QueueTask(() => { AquariaTerrainGenerator tgen = new AquariaTerrainGenerator(128, 64f); float subTreeSize = subtree.GetWorldSize(); Vector3 pos = subtree.GetPosition() - Vector3.one * subTreeSize*0.5f; AquariaTerrainGenerator.SetValueDelegate pillarSetup = (Vector3 inputPoint, sbyte value) => { subtree.SetValueAtPoint(inputPoint, value); }; Vector3 generationPoint = pos; for (generationPoint.x = pos.x ; generationPoint.x < pos.x + subTreeSize; generationPoint.x += 1.0f) { for (generationPoint.z = pos.z ; generationPoint.z < pos.z + subTreeSize; generationPoint.z += 1.0f) { tgen.GenerateHeighPillar(generationPoint, pillarSetup); } } }, () => { subtree.GenerateNearestNeighborTable(); }); }
protected override void Init(int wSize) { base.Init(wSize); AquariaTree = new AdaptiveHybridTree((sbyte)wSize, typeof(AquariaSubTree)); worldGenerator = new AquariaTerrainGenerator(128, 32f); }
public void GenerateStartField(float size, onGeneratedStartField ex) { Vector3 startPoint = new Vector3(); TaskPool.QueueTask(() => { Vector3 lowestPoint = startPoint; AquariaTerrainGenerator tgen = new AquariaTerrainGenerator(worldGenerator); for (float f = -50; f < 50; f++) { startPoint.x = f; startPoint.y = tgen.GetGroundHeight(startPoint); if (startPoint.y < lowestPoint.y) { lowestPoint = startPoint; } } for (float f = -50; f < 50; f++) { startPoint.z = f; startPoint.y = tgen.GetGroundHeight(startPoint); if (startPoint.y < lowestPoint.y) { lowestPoint = startPoint; } } startPoint = lowestPoint; DebugOutput.Shout(startPoint.ToString()); }, () => { GLCube cubeG = new GLCube(startPoint, Vector3.one + Vector3.up, Color.cyan,this); ex(startPoint); }); }