aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorAdam Frisby2007-06-26 05:20:46 +0000
committerAdam Frisby2007-06-26 05:20:46 +0000
commit2989c227020ec363fefd83d1d78e243ebcd7bfd7 (patch)
tree6916ae38fe7e4f5a2e7ed4c170f7d2f95cbde8a3
parent* Added help command to terrain filters. (diff)
downloadopensim-SC-2989c227020ec363fefd83d1d78e243ebcd7bfd7.zip
opensim-SC-2989c227020ec363fefd83d1d78e243ebcd7bfd7.tar.gz
opensim-SC-2989c227020ec363fefd83d1d78e243ebcd7bfd7.tar.bz2
opensim-SC-2989c227020ec363fefd83d1d78e243ebcd7bfd7.tar.xz
* Updated demo filter to show more common usage (as well as embedding multiple filters in a single file)
Diffstat (limited to '')
-rw-r--r--bin/TerrainFilters/demofilter.cs26
1 files changed, 26 insertions, 0 deletions
diff --git a/bin/TerrainFilters/demofilter.cs b/bin/TerrainFilters/demofilter.cs
index 79b8d05..1fdfc95 100644
--- a/bin/TerrainFilters/demofilter.cs
+++ b/bin/TerrainFilters/demofilter.cs
@@ -22,3 +22,29 @@ public class DemoFilter : ITerrainFilter
22 return "demofilter - Does nothing\n"; 22 return "demofilter - Does nothing\n";
23 } 23 }
24} 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