diff options
author | Diva Canto | 2012-03-16 13:14:26 -0700 |
---|---|---|
committer | Diva Canto | 2012-03-16 13:14:26 -0700 |
commit | 9a643a1bb9256e9e27611c404b77641fdd34e33a (patch) | |
tree | a268c4b87a4f8d44862b61d0c9b8969732d1922a /OpenSim/Region/Framework/Scenes/TerrainChannel.cs | |
parent | More on map search: send extra messages to the user regarding the region bein... (diff) | |
download | opensim-SC_OLD-9a643a1bb9256e9e27611c404b77641fdd34e33a.zip opensim-SC_OLD-9a643a1bb9256e9e27611c404b77641fdd34e33a.tar.gz opensim-SC_OLD-9a643a1bb9256e9e27611c404b77641fdd34e33a.tar.bz2 opensim-SC_OLD-9a643a1bb9256e9e27611c404b77641fdd34e33a.tar.xz |
Terrain: added [Terrain] section with an option to load an initial flat terrain. Default is still pinhead island. I much rather have a flat land in the beginning.
Conflicts:
bin/OpenSim.ini.example
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/TerrainChannel.cs | 60 |
1 files changed, 44 insertions, 16 deletions
diff --git a/OpenSim/Region/Framework/Scenes/TerrainChannel.cs b/OpenSim/Region/Framework/Scenes/TerrainChannel.cs index ca6210d..c0ca48e 100644 --- a/OpenSim/Region/Framework/Scenes/TerrainChannel.cs +++ b/OpenSim/Region/Framework/Scenes/TerrainChannel.cs | |||
@@ -46,23 +46,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
46 | public TerrainChannel() | 46 | public TerrainChannel() |
47 | { | 47 | { |
48 | map = new double[Constants.RegionSize, Constants.RegionSize]; | 48 | map = new double[Constants.RegionSize, Constants.RegionSize]; |
49 | taint = new bool[Constants.RegionSize / 16,Constants.RegionSize / 16]; | 49 | taint = new bool[Constants.RegionSize / 16, Constants.RegionSize / 16]; |
50 | 50 | ||
51 | int x; | 51 | PinHeadIsland(); |
52 | for (x = 0; x < Constants.RegionSize; x++) | 52 | } |
53 | { | 53 | |
54 | int y; | 54 | public TerrainChannel(String type) |
55 | for (y = 0; y < Constants.RegionSize; y++) | 55 | { |
56 | { | 56 | map = new double[Constants.RegionSize, Constants.RegionSize]; |
57 | map[x, y] = TerrainUtil.PerlinNoise2D(x, y, 2, 0.125) * 10; | 57 | taint = new bool[Constants.RegionSize / 16, Constants.RegionSize / 16]; |
58 | double spherFacA = TerrainUtil.SphericalFactor(x, y, Constants.RegionSize / 2.0, Constants.RegionSize / 2.0, 50) * 0.01; | 58 | |
59 | double spherFacB = TerrainUtil.SphericalFactor(x, y, Constants.RegionSize / 2.0, Constants.RegionSize / 2.0, 100) * 0.001; | 59 | if (type.Equals("flat")) |
60 | if (map[x, y] < spherFacA) | 60 | FlatLand(); |
61 | map[x, y] = spherFacA; | 61 | else |
62 | if (map[x, y] < spherFacB) | 62 | PinHeadIsland(); |
63 | map[x, y] = spherFacB; | ||
64 | } | ||
65 | } | ||
66 | } | 63 | } |
67 | 64 | ||
68 | public TerrainChannel(double[,] import) | 65 | public TerrainChannel(double[,] import) |
@@ -238,5 +235,36 @@ namespace OpenSim.Region.Framework.Scenes | |||
238 | } | 235 | } |
239 | } | 236 | } |
240 | } | 237 | } |
238 | |||
239 | private void PinHeadIsland() | ||
240 | { | ||
241 | int x; | ||
242 | for (x = 0; x < Constants.RegionSize; x++) | ||
243 | { | ||
244 | int y; | ||
245 | for (y = 0; y < Constants.RegionSize; y++) | ||
246 | { | ||
247 | map[x, y] = TerrainUtil.PerlinNoise2D(x, y, 2, 0.125) * 10; | ||
248 | double spherFacA = TerrainUtil.SphericalFactor(x, y, Constants.RegionSize / 2.0, Constants.RegionSize / 2.0, 50) * 0.01; | ||
249 | double spherFacB = TerrainUtil.SphericalFactor(x, y, Constants.RegionSize / 2.0, Constants.RegionSize / 2.0, 100) * 0.001; | ||
250 | if (map[x, y] < spherFacA) | ||
251 | map[x, y] = spherFacA; | ||
252 | if (map[x, y] < spherFacB) | ||
253 | map[x, y] = spherFacB; | ||
254 | } | ||
255 | } | ||
256 | } | ||
257 | |||
258 | private void FlatLand() | ||
259 | { | ||
260 | int x; | ||
261 | for (x = 0; x < Constants.RegionSize; x++) | ||
262 | { | ||
263 | int y; | ||
264 | for (y = 0; y < Constants.RegionSize; y++) | ||
265 | map[x, y] = 21; | ||
266 | } | ||
267 | } | ||
268 | |||
241 | } | 269 | } |
242 | } | 270 | } |