aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/bin/TerrainFilters/demofilter.cs
diff options
context:
space:
mode:
authorSean Dague2007-07-16 15:40:11 +0000
committerSean Dague2007-07-16 15:40:11 +0000
commit2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6 (patch)
treee3f80ad51736cf17e856547b1bcf956010927434 /bin/TerrainFilters/demofilter.cs
parent*Trunk compiles now (diff)
downloadopensim-SC_OLD-2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6.zip
opensim-SC_OLD-2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6.tar.gz
opensim-SC_OLD-2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6.tar.bz2
opensim-SC_OLD-2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6.tar.xz
changed to native line ending encoding
Diffstat (limited to 'bin/TerrainFilters/demofilter.cs')
-rw-r--r--bin/TerrainFilters/demofilter.cs98
1 files changed, 49 insertions, 49 deletions
diff --git a/bin/TerrainFilters/demofilter.cs b/bin/TerrainFilters/demofilter.cs
index 1fdfc95..4b48571 100644
--- a/bin/TerrainFilters/demofilter.cs
+++ b/bin/TerrainFilters/demofilter.cs
@@ -1,50 +1,50 @@
1using System; 1using System;
2using libTerrain; 2using libTerrain;
3using OpenSim.Terrain; 3using OpenSim.Terrain;
4 4
5/// <summary> 5/// <summary>
6/// A Demonstration Filter 6/// A Demonstration Filter
7/// </summary> 7/// </summary>
8public class DemoFilter : ITerrainFilter 8public class DemoFilter : ITerrainFilter
9{ 9{
10 public void Filter(Channel heightmap, string[] args) 10 public void Filter(Channel heightmap, string[] args)
11 { 11 {
12 Console.WriteLine("Hello world"); 12 Console.WriteLine("Hello world");
13 } 13 }
14 14
15 public string Register() 15 public string Register()
16 { 16 {
17 return "demofilter"; 17 return "demofilter";
18 } 18 }
19 19
20 public string Help() 20 public string Help()
21 { 21 {
22 return "demofilter - Does nothing\n"; 22 return "demofilter - Does nothing\n";
23 } 23 }
24} 24}
25 25
26public class SineFilter : ITerrainFilter 26public class SineFilter : ITerrainFilter
27{ 27{
28 public void Filter(Channel heightmap, string[] args) 28 public void Filter(Channel heightmap, string[] args)
29 { 29 {
30 double max = heightmap.findMax(); 30 double max = heightmap.findMax();
31 31
32 for (int x = 0; x < heightmap.w; x++) 32 for (int x = 0; x < heightmap.w; x++)
33 { 33 {
34 for (int y = 0; y < heightmap.h; y++) 34 for (int y = 0; y < heightmap.h; y++)
35 { 35 {
36 heightmap.set(x,y,((Math.Sin(heightmap.get(x,y) * Convert.ToDouble(args[1])) + 1) / 2) * max); 36 heightmap.set(x,y,((Math.Sin(heightmap.get(x,y) * Convert.ToDouble(args[1])) + 1) / 2) * max);
37 } 37 }
38 } 38 }
39 } 39 }
40 40
41 public string Register() 41 public string Register()
42 { 42 {
43 return "sinefilter"; 43 return "sinefilter";
44 } 44 }
45 45
46 public string Help() 46 public string Help()
47 { 47 {
48 return "sinefilter <theta> - Converts the heightmap to the functional output of a sine wave"; 48 return "sinefilter <theta> - Converts the heightmap to the functional output of a sine wave";
49 } 49 }
50} \ No newline at end of file 50} \ No newline at end of file