aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Editing
diff options
context:
space:
mode:
authorAdam Frisby2007-07-23 05:29:52 +0000
committerAdam Frisby2007-07-23 05:29:52 +0000
commitb8da9c3a64b84ab14642bad8c79d3b2ed62e62fb (patch)
treede4466ffdf017e140ec3aca9bb52cbe14e5e5b12 /OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Editing
parentCouple of small changes (diff)
downloadopensim-SC-b8da9c3a64b84ab14642bad8c79d3b2ed62e62fb.zip
opensim-SC-b8da9c3a64b84ab14642bad8c79d3b2ed62e62fb.tar.gz
opensim-SC-b8da9c3a64b84ab14642bad8c79d3b2ed62e62fb.tar.bz2
opensim-SC-b8da9c3a64b84ab14642bad8c79d3b2ed62e62fb.tar.xz
* Major style changes in libTerrain.Channel - now uses .NET-style naming syntax.
* Issue#218 - Updated mySQL region table.
Diffstat (limited to 'OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Editing')
-rw-r--r--OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Editing/Flatten.cs28
-rw-r--r--OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Editing/Raise.cs14
2 files changed, 21 insertions, 21 deletions
diff --git a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Editing/Flatten.cs b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Editing/Flatten.cs
index eaca695..57ba729 100644
--- a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Editing/Flatten.cs
+++ b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Editing/Flatten.cs
@@ -42,14 +42,14 @@ namespace libTerrain
42 /// <param name="ry">The Y coordinate of the terrain mask</param> 42 /// <param name="ry">The Y coordinate of the terrain mask</param>
43 /// <param name="size">The size of the terrain mask</param> 43 /// <param name="size">The size of the terrain mask</param>
44 /// <param name="amount">The scale of the terrain mask</param> 44 /// <param name="amount">The scale of the terrain mask</param>
45 public void flatten(double rx, double ry, double size, double amount) 45 public void Flatten(double rx, double ry, double size, double amount)
46 { 46 {
47 // Generate the mask 47 // Generate the mask
48 Channel temp = new Channel(w, h); 48 Channel temp = new Channel(w, h);
49 temp.fill(0); 49 temp.Fill(0);
50 temp.raise(rx, ry, size, amount); 50 temp.Raise(rx, ry, size, amount);
51 temp.normalise(); 51 temp.Normalise();
52 double total_mod = temp.sum(); 52 double total_mod = temp.Sum();
53 53
54 // Establish the average height under the area 54 // Establish the average height under the area
55 Channel newmap = new Channel(w, h); 55 Channel newmap = new Channel(w, h);
@@ -57,26 +57,26 @@ namespace libTerrain
57 57
58 newmap *= temp; 58 newmap *= temp;
59 59
60 double total_terrain = newmap.sum(); 60 double total_terrain = newmap.Sum();
61 double avg_height = total_terrain / total_mod; 61 double avg_height = total_terrain / total_mod;
62 62
63 // Create a flat terrain using the average height 63 // Create a flat terrain using the average height
64 Channel flat = new Channel(w, h); 64 Channel flat = new Channel(w, h);
65 flat.fill(avg_height); 65 flat.Fill(avg_height);
66 66
67 // Blend the current terrain with the average height terrain 67 // Blend the current terrain with the average height terrain
68 // using the "raised" empty terrain as a mask 68 // using the "raised" empty terrain as a mask
69 blend(flat, temp); 69 Blend(flat, temp);
70 70
71 } 71 }
72 72
73 public void flatten(Channel mask, double amount) 73 public void Flatten(Channel mask, double amount)
74 { 74 {
75 // Generate the mask 75 // Generate the mask
76 Channel temp = mask * amount; 76 Channel temp = mask * amount;
77 temp.clip(0, 1); // Cut off out-of-bounds values 77 temp.Clip(0, 1); // Cut off out-of-bounds values
78 78
79 double total_mod = temp.sum(); 79 double total_mod = temp.Sum();
80 80
81 // Establish the average height under the area 81 // Establish the average height under the area
82 Channel map = new Channel(w, h); 82 Channel map = new Channel(w, h);
@@ -84,16 +84,16 @@ namespace libTerrain
84 84
85 map *= temp; 85 map *= temp;
86 86
87 double total_terrain = map.sum(); 87 double total_terrain = map.Sum();
88 double avg_height = total_terrain / total_mod; 88 double avg_height = total_terrain / total_mod;
89 89
90 // Create a flat terrain using the average height 90 // Create a flat terrain using the average height
91 Channel flat = new Channel(w, h); 91 Channel flat = new Channel(w, h);
92 flat.fill(avg_height); 92 flat.Fill(avg_height);
93 93
94 // Blend the current terrain with the average height terrain 94 // Blend the current terrain with the average height terrain
95 // using the "raised" empty terrain as a mask 95 // using the "raised" empty terrain as a mask
96 blend(flat, temp); 96 Blend(flat, temp);
97 } 97 }
98 } 98 }
99} \ No newline at end of file 99} \ No newline at end of file
diff --git a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Editing/Raise.cs b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Editing/Raise.cs
index d47f8fb..7bccef3 100644
--- a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Editing/Raise.cs
+++ b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Editing/Raise.cs
@@ -42,9 +42,9 @@ namespace libTerrain
42 /// <param name="ry">The center the Y coordinate of where you wish to raise the land</param> 42 /// <param name="ry">The center the Y coordinate of where you wish to raise the land</param>
43 /// <param name="size">The radius of the dimple</param> 43 /// <param name="size">The radius of the dimple</param>
44 /// <param name="amount">How much impact to add to the terrain (0..2 usually)</param> 44 /// <param name="amount">How much impact to add to the terrain (0..2 usually)</param>
45 public void raise(double rx, double ry, double size, double amount) 45 public void Raise(double rx, double ry, double size, double amount)
46 { 46 {
47 raiseSphere(rx, ry, size, amount); 47 RaiseSphere(rx, ry, size, amount);
48 } 48 }
49 49
50 /// <summary> 50 /// <summary>
@@ -54,7 +54,7 @@ namespace libTerrain
54 /// <param name="ry">The center the Y coordinate of where you wish to raise the land</param> 54 /// <param name="ry">The center the Y coordinate of where you wish to raise the land</param>
55 /// <param name="size">The radius of the sphere dimple</param> 55 /// <param name="size">The radius of the sphere dimple</param>
56 /// <param name="amount">How much impact to add to the terrain (0..2 usually)</param> 56 /// <param name="amount">How much impact to add to the terrain (0..2 usually)</param>
57 public void raiseSphere(double rx, double ry, double size, double amount) 57 public void RaiseSphere(double rx, double ry, double size, double amount)
58 { 58 {
59 int x, y; 59 int x, y;
60 for (x = 0; x < w; x++) 60 for (x = 0; x < w; x++)
@@ -80,7 +80,7 @@ namespace libTerrain
80 /// <param name="ry">The center the Y coordinate of where you wish to raise the land</param> 80 /// <param name="ry">The center the Y coordinate of where you wish to raise the land</param>
81 /// <param name="size">The radius of the cone</param> 81 /// <param name="size">The radius of the cone</param>
82 /// <param name="amount">How much impact to add to the terrain (0..2 usually)</param> 82 /// <param name="amount">How much impact to add to the terrain (0..2 usually)</param>
83 public void raiseCone(double rx, double ry, double size, double amount) 83 public void RaiseCone(double rx, double ry, double size, double amount)
84 { 84 {
85 int x, y; 85 int x, y;
86 for (x = 0; x < w; x++) 86 for (x = 0; x < w; x++)
@@ -105,9 +105,9 @@ namespace libTerrain
105 /// <param name="ry">The center the Y coordinate of where you wish to lower the land</param> 105 /// <param name="ry">The center the Y coordinate of where you wish to lower the land</param>
106 /// <param name="size">The radius of the sphere dimple</param> 106 /// <param name="size">The radius of the sphere dimple</param>
107 /// <param name="amount">How much impact to remove from the terrain (0..2 usually)</param> 107 /// <param name="amount">How much impact to remove from the terrain (0..2 usually)</param>
108 public void lower(double rx, double ry, double size, double amount) 108 public void Lower(double rx, double ry, double size, double amount)
109 { 109 {
110 lowerSphere(rx, ry, size, amount); 110 LowerSphere(rx, ry, size, amount);
111 } 111 }
112 112
113 /// <summary> 113 /// <summary>
@@ -117,7 +117,7 @@ namespace libTerrain
117 /// <param name="ry">The center the Y coordinate of where you wish to lower the land</param> 117 /// <param name="ry">The center the Y coordinate of where you wish to lower the land</param>
118 /// <param name="size">The radius of the sphere dimple</param> 118 /// <param name="size">The radius of the sphere dimple</param>
119 /// <param name="amount">How much impact to remove from the terrain (0..2 usually)</param> 119 /// <param name="amount">How much impact to remove from the terrain (0..2 usually)</param>
120 public void lowerSphere(double rx, double ry, double size, double amount) 120 public void LowerSphere(double rx, double ry, double size, double amount)
121 { 121 {
122 int x, y; 122 int x, y;
123 for (x = 0; x < w; x++) 123 for (x = 0; x < w; x++)