From adb56a46f49127911a2df169c86f2cdfde034966 Mon Sep 17 00:00:00 2001
From: Adam Frisby
Date: Wed, 11 Apr 2007 05:19:27 +0000
Subject: Major ass changes to terrain (now uses libTerrain-BSD!) and all-round
improvements to code quality. Terrain saving/loading may work now (running
through setHeights1D and getHeights1D before DB4o) **WARNING: UNTESTED**
---
OpenSim.Terrain.BasicTerrain/RaiseLower.cs | 91 ------------------------------
1 file changed, 91 deletions(-)
delete mode 100644 OpenSim.Terrain.BasicTerrain/RaiseLower.cs
(limited to 'OpenSim.Terrain.BasicTerrain/RaiseLower.cs')
diff --git a/OpenSim.Terrain.BasicTerrain/RaiseLower.cs b/OpenSim.Terrain.BasicTerrain/RaiseLower.cs
deleted file mode 100644
index 384bcc0..0000000
--- a/OpenSim.Terrain.BasicTerrain/RaiseLower.cs
+++ /dev/null
@@ -1,91 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace OpenSim.Terrain.BasicTerrain
-{
- static class RaiseLower
- {
- ///
- /// Raises land around the selection
- ///
- /// The center the X coordinate of where you wish to raise the land
- /// The center the Y coordinate of where you wish to raise the land
- /// The radius of the dimple
- /// How much impact to add to the terrain (0..2 usually)
- public static void raise(float[,] map, double rx, double ry, double size, double amount)
- {
- raiseSphere(map, rx, ry, size, amount);
- }
-
- ///
- /// Raises land in a sphere around the selection
- ///
- /// The center the X coordinate of where you wish to raise the land
- /// The center the Y coordinate of where you wish to raise the land
- /// The radius of the sphere dimple
- /// How much impact to add to the terrain (0..2 usually)
- public static void raiseSphere(float[,] map, double rx, double ry, double size, double amount)
- {
- int x, y;
- int w = map.GetLength(0);
- int h = map.GetLength(1);
-
- for (x = 0; x < w; x++)
- {
- for (y = 0; y < h; y++)
- {
- double z = size;
- z *= z;
- z -= ((x - rx) * (x - rx)) + ((y - ry) * (y - ry));
-
- if (z < 0)
- z = 0;
-
- map[x, y] += (float)(z * amount);
- }
- }
- }
-
- ///
- /// Lowers land in a sphere around the selection
- ///
- /// The center the X coordinate of where you wish to lower the land
- /// The center the Y coordinate of where you wish to lower the land
- /// The radius of the sphere dimple
- /// How much impact to remove from the terrain (0..2 usually)
- public static void lower(float[,] map, double rx, double ry, double size, double amount)
- {
- lowerSphere(map, rx, ry, size, amount);
- }
-
- ///
- /// Lowers land in a sphere around the selection
- ///
- /// The center the X coordinate of where you wish to lower the land
- /// The center the Y coordinate of where you wish to lower the land
- /// The radius of the sphere dimple
- /// How much impact to remove from the terrain (0..2 usually)
- public static void lowerSphere(float[,] map, double rx, double ry, double size, double amount)
- {
- int x, y;
- int w = map.GetLength(0);
- int h = map.GetLength(1);
-
- for (x = 0; x < w; x++)
- {
- for (y = 0; y < h; y++)
- {
- double z = size;
- z *= z;
- z -= ((x - rx) * (x - rx)) + ((y - ry) * (y - ry));
-
- if (z < 0)
- z = 0;
-
- map[x, y] -= (float)(z * amount);
- }
- }
- }
- }
-}
--
cgit v1.1