aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/bin/TerrainFilters
diff options
context:
space:
mode:
authorAdam Frisby2007-07-11 08:10:25 +0000
committerAdam Frisby2007-07-11 08:10:25 +0000
commite2ff441e31328e60c8bb1d4bb32fa4ac64f91978 (patch)
tree8405b6cef57b66a58f31a24c859846085d0b81f7 /bin/TerrainFilters
parent* Wiping trunk in prep for Sugilite (diff)
parent* Applying dalien's patches from bug#177 and #179 (diff)
downloadopensim-SC-e2ff441e31328e60c8bb1d4bb32fa4ac64f91978.zip
opensim-SC-e2ff441e31328e60c8bb1d4bb32fa4ac64f91978.tar.gz
opensim-SC-e2ff441e31328e60c8bb1d4bb32fa4ac64f91978.tar.bz2
opensim-SC-e2ff441e31328e60c8bb1d4bb32fa4ac64f91978.tar.xz
* Bringing Sugilite in to trunk
Diffstat (limited to 'bin/TerrainFilters')
-rw-r--r--bin/TerrainFilters/demofilter.cs50
1 files changed, 50 insertions, 0 deletions
diff --git a/bin/TerrainFilters/demofilter.cs b/bin/TerrainFilters/demofilter.cs
new file mode 100644
index 0000000..1fdfc95
--- /dev/null
+++ b/bin/TerrainFilters/demofilter.cs
@@ -0,0 +1,50 @@
1using System;
2using libTerrain;
3using OpenSim.Terrain;
4
5/// <summary>
6/// A Demonstration Filter
7/// </summary>
8public class DemoFilter : ITerrainFilter
9{
10 public void Filter(Channel heightmap, string[] args)
11 {
12 Console.WriteLine("Hello world");
13 }
14
15 public string Register()
16 {
17 return "demofilter";
18 }
19
20 public string Help()
21 {
22 return "demofilter - Does nothing\n";
23 }
24}
25
26public class SineFilter : ITerrainFilter
27{
28 public void Filter(Channel heightmap, string[] args)
29 {
30 double max = heightmap.findMax();
31
32 for (int x = 0; x < heightmap.w; x++)
33 {
34 for (int y = 0; y < heightmap.h; y++)
35 {
36 heightmap.set(x,y,((Math.Sin(heightmap.get(x,y) * Convert.ToDouble(args[1])) + 1) / 2) * max);
37 }
38 }
39 }
40
41 public string Register()
42 {
43 return "sinefilter";
44 }
45
46 public string Help()
47 {
48 return "sinefilter <theta> - Converts the heightmap to the functional output of a sine wave";
49 }
50} \ No newline at end of file