using System; using System.Collections.Generic; using System.Text; using OpenSim.Terrain.BasicTerrain; namespace OpenSim.Terrain { public class TerrainEngine { public float[,] map; public float[,] water; int w, h; public TerrainEngine() { w = 256; h = 256; map = new float[w, h]; water = new float[w, h]; } public float[] getHeights1D() { float[] heights = new float[w*h]; int i; for(i=0;i /// Swaps the references between the height and water buffers to allow you to edit the water heightmap. Remember to swap back when you are done. /// public void swapWaterBuffer() { float[,] temp = map; map = water; water = temp; } /// /// Raises land in a sphere around the specified coordinates /// /// Center of the sphere on the X axis /// Center of the sphere on the Y axis /// The radius of the sphere /// Scale the height of the sphere by this amount (recommended 0..2) public void raise(double rx, double ry, double size, double amount) { lock (map) { RaiseLower.raiseSphere(this.map, rx, ry, size, amount); } } public void lower(double rx, double ry, double size, double amount) { lock (map) { RaiseLower.lowerSphere(this.map, rx, ry, size, amount); } } public void hills() { lock (map) { Hills.hillsSpheres(this.map, 1337, 200, 20, 40, true, true, false); Normalise.normalise(this.map,60); } } } }