aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Modules/AssetDownloadModule.cs204
-rw-r--r--OpenSim/Region/Environment/Modules/DynamicTextureModule.cs9
-rw-r--r--OpenSim/Region/Environment/Modules/Terrain/PaintBrushes/FlattenSphere.cs65
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs39
-rw-r--r--OpenSim/Region/ExtensionsScriptModule/Engines/CSharp/Examples/ExportRegionToLSL.cs35
-rw-r--r--OpenSim/Region/Physics/Meshing/Meshmerizer.cs59
-rw-r--r--OpenSim/Region/Physics/Meshing/SimpleHull.cs11
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODECharacter.cs41
-rw-r--r--OpenSim/Region/Physics/OdePlugin/OdePlugin.cs11
-rw-r--r--OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs82
-rw-r--r--OpenSim/Region/ScriptEngine/Common/TRPC/TCPClient.cs13
-rw-r--r--OpenSim/Region/ScriptEngine/LSOEngine/LSO/IL_common_functions.cs27
-rw-r--r--OpenSim/Region/ScriptEngine/LSOEngine/LSO/LSL_OPCODE_IL_processor.cs9
-rw-r--r--OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs48
-rw-r--r--OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Editing/Flatten.cs85
-rw-r--r--OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Manipulators/NavierStokes.cs13
16 files changed, 381 insertions, 370 deletions
diff --git a/OpenSim/Region/Environment/Modules/AssetDownloadModule.cs b/OpenSim/Region/Environment/Modules/AssetDownloadModule.cs
index 07f13ce..d5f1b36 100644
--- a/OpenSim/Region/Environment/Modules/AssetDownloadModule.cs
+++ b/OpenSim/Region/Environment/Modules/AssetDownloadModule.cs
@@ -175,117 +175,119 @@ namespace OpenSim.Region.Environment.Modules
175 } 175 }
176 } 176 }
177 177
178 private void RunAssetQueue() 178// TODO: unused
179 { 179// private void RunAssetQueue()
180 while (true) 180// {
181 { 181// while (true)
182 try 182// {
183 { 183// try
184 ProcessAssetQueue(); 184// {
185 Thread.Sleep(500); 185// ProcessAssetQueue();
186 } 186// Thread.Sleep(500);
187 catch (Exception) 187// }
188 { 188// catch (Exception)
189 // m_log.Error("[ASSET CACHE]: " + e.ToString()); 189// {
190 } 190// // m_log.Error("[ASSET CACHE]: " + e.ToString());
191 } 191// }
192 } 192// }
193// }
193 194
194 /// <summary> 195// TODO: unused
195 /// Process the asset queue which sends packets directly back to the client. 196// /// <summary>
196 /// </summary> 197// /// Process the asset queue which sends packets directly back to the client.
197 private void ProcessAssetQueue() 198// /// </summary>
198 { 199// private void ProcessAssetQueue()
199 //should move the asset downloading to a module, like has been done with texture downloading 200// {
200 if (AssetRequests.Count == 0) 201// //should move the asset downloading to a module, like has been done with texture downloading
201 { 202// if (AssetRequests.Count == 0)
202 //no requests waiting 203// {
203 return; 204// //no requests waiting
204 } 205// return;
205 // if less than 5, do all of them 206// }
206 int num = Math.Min(5, AssetRequests.Count); 207// // if less than 5, do all of them
208// int num = Math.Min(5, AssetRequests.Count);
207 209
208 AssetRequest req; 210// AssetRequest req;
209 for (int i = 0; i < num; i++) 211// for (int i = 0; i < num; i++)
210 { 212// {
211 req = (AssetRequest)AssetRequests[i]; 213// req = (AssetRequest)AssetRequests[i];
212 //Console.WriteLine("sending asset " + req.RequestAssetID); 214// //Console.WriteLine("sending asset " + req.RequestAssetID);
213 TransferInfoPacket Transfer = new TransferInfoPacket(); 215// TransferInfoPacket Transfer = new TransferInfoPacket();
214 Transfer.TransferInfo.ChannelType = 2; 216// Transfer.TransferInfo.ChannelType = 2;
215 Transfer.TransferInfo.Status = 0; 217// Transfer.TransferInfo.Status = 0;
216 Transfer.TransferInfo.TargetType = 0; 218// Transfer.TransferInfo.TargetType = 0;
217 if (req.AssetRequestSource == 2) 219// if (req.AssetRequestSource == 2)
218 { 220// {
219 Transfer.TransferInfo.Params = new byte[20]; 221// Transfer.TransferInfo.Params = new byte[20];
220 Array.Copy(req.RequestAssetID.GetBytes(), 0, Transfer.TransferInfo.Params, 0, 16); 222// Array.Copy(req.RequestAssetID.GetBytes(), 0, Transfer.TransferInfo.Params, 0, 16);
221 int assType = (int)req.AssetInf.Type; 223// int assType = (int)req.AssetInf.Type;
222 Array.Copy(Helpers.IntToBytes(assType), 0, Transfer.TransferInfo.Params, 16, 4); 224// Array.Copy(Helpers.IntToBytes(assType), 0, Transfer.TransferInfo.Params, 16, 4);
223 } 225// }
224 else if (req.AssetRequestSource == 3) 226// else if (req.AssetRequestSource == 3)
225 { 227// {
226 Transfer.TransferInfo.Params = req.Params; 228// Transfer.TransferInfo.Params = req.Params;
227 // Transfer.TransferInfo.Params = new byte[100]; 229// // Transfer.TransferInfo.Params = new byte[100];
228 //Array.Copy(req.RequestUser.AgentId.GetBytes(), 0, Transfer.TransferInfo.Params, 0, 16); 230// //Array.Copy(req.RequestUser.AgentId.GetBytes(), 0, Transfer.TransferInfo.Params, 0, 16);
229 //Array.Copy(req.RequestUser.SessionId.GetBytes(), 0, Transfer.TransferInfo.Params, 16, 16); 231// //Array.Copy(req.RequestUser.SessionId.GetBytes(), 0, Transfer.TransferInfo.Params, 16, 16);
230 } 232// }
231 Transfer.TransferInfo.Size = (int)req.AssetInf.Data.Length; 233// Transfer.TransferInfo.Size = (int)req.AssetInf.Data.Length;
232 Transfer.TransferInfo.TransferID = req.TransferRequestID; 234// Transfer.TransferInfo.TransferID = req.TransferRequestID;
233 req.RequestUser.OutPacket(Transfer, ThrottleOutPacketType.Asset); 235// req.RequestUser.OutPacket(Transfer, ThrottleOutPacketType.Asset);
234 236
235 if (req.NumPackets == 1) 237// if (req.NumPackets == 1)
236 { 238// {
237 TransferPacketPacket TransferPacket = new TransferPacketPacket(); 239// TransferPacketPacket TransferPacket = new TransferPacketPacket();
238 TransferPacket.TransferData.Packet = 0; 240// TransferPacket.TransferData.Packet = 0;
239 TransferPacket.TransferData.ChannelType = 2; 241// TransferPacket.TransferData.ChannelType = 2;
240 TransferPacket.TransferData.TransferID = req.TransferRequestID; 242// TransferPacket.TransferData.TransferID = req.TransferRequestID;
241 TransferPacket.TransferData.Data = req.AssetInf.Data; 243// TransferPacket.TransferData.Data = req.AssetInf.Data;
242 TransferPacket.TransferData.Status = 1; 244// TransferPacket.TransferData.Status = 1;
243 req.RequestUser.OutPacket(TransferPacket, ThrottleOutPacketType.Asset); 245// req.RequestUser.OutPacket(TransferPacket, ThrottleOutPacketType.Asset);
244 } 246// }
245 else 247// else
246 { 248// {
247 int processedLength = 0; 249// int processedLength = 0;
248 // libsecondlife hardcodes 1500 as the maximum data chunk size 250// // libsecondlife hardcodes 1500 as the maximum data chunk size
249 int maxChunkSize = 1250; 251// int maxChunkSize = 1250;
250 int packetNumber = 0; 252// int packetNumber = 0;
251 253
252 while (processedLength < req.AssetInf.Data.Length) 254// while (processedLength < req.AssetInf.Data.Length)
253 { 255// {
254 TransferPacketPacket TransferPacket = new TransferPacketPacket(); 256// TransferPacketPacket TransferPacket = new TransferPacketPacket();
255 TransferPacket.TransferData.Packet = packetNumber; 257// TransferPacket.TransferData.Packet = packetNumber;
256 TransferPacket.TransferData.ChannelType = 2; 258// TransferPacket.TransferData.ChannelType = 2;
257 TransferPacket.TransferData.TransferID = req.TransferRequestID; 259// TransferPacket.TransferData.TransferID = req.TransferRequestID;
258 260
259 int chunkSize = Math.Min(req.AssetInf.Data.Length - processedLength, maxChunkSize); 261// int chunkSize = Math.Min(req.AssetInf.Data.Length - processedLength, maxChunkSize);
260 byte[] chunk = new byte[chunkSize]; 262// byte[] chunk = new byte[chunkSize];
261 Array.Copy(req.AssetInf.Data, processedLength, chunk, 0, chunk.Length); 263// Array.Copy(req.AssetInf.Data, processedLength, chunk, 0, chunk.Length);
262 264
263 TransferPacket.TransferData.Data = chunk; 265// TransferPacket.TransferData.Data = chunk;
264 266
265 // 0 indicates more packets to come, 1 indicates last packet 267// // 0 indicates more packets to come, 1 indicates last packet
266 if (req.AssetInf.Data.Length - processedLength > maxChunkSize) 268// if (req.AssetInf.Data.Length - processedLength > maxChunkSize)
267 { 269// {
268 TransferPacket.TransferData.Status = 0; 270// TransferPacket.TransferData.Status = 0;
269 } 271// }
270 else 272// else
271 { 273// {
272 TransferPacket.TransferData.Status = 1; 274// TransferPacket.TransferData.Status = 1;
273 } 275// }
274 276
275 req.RequestUser.OutPacket(TransferPacket, ThrottleOutPacketType.Asset); 277// req.RequestUser.OutPacket(TransferPacket, ThrottleOutPacketType.Asset);
276 278
277 processedLength += chunkSize; 279// processedLength += chunkSize;
278 packetNumber++; 280// packetNumber++;
279 } 281// }
280 } 282// }
281 } 283// }
282 284
283 //remove requests that have been completed 285// //remove requests that have been completed
284 for (int i = 0; i < num; i++) 286// for (int i = 0; i < num; i++)
285 { 287// {
286 AssetRequests.RemoveAt(0); 288// AssetRequests.RemoveAt(0);
287 } 289// }
288 } 290// }
289 291
290 /// <summary> 292 /// <summary>
291 /// Calculate the number of packets required to send the asset to the client. 293 /// Calculate the number of packets required to send the asset to the client.
diff --git a/OpenSim/Region/Environment/Modules/DynamicTextureModule.cs b/OpenSim/Region/Environment/Modules/DynamicTextureModule.cs
index e16eb92..ee84499 100644
--- a/OpenSim/Region/Environment/Modules/DynamicTextureModule.cs
+++ b/OpenSim/Region/Environment/Modules/DynamicTextureModule.cs
@@ -228,10 +228,11 @@ namespace OpenSim.Region.Environment.Modules
228 part.ScheduleFullUpdate(); 228 part.ScheduleFullUpdate();
229 } 229 }
230 230
231 private byte[] BlendTextures(byte[] frontImage, byte[] backImage) 231// TODO: unused
232 { 232// private byte[] BlendTextures(byte[] frontImage, byte[] backImage)
233 return BlendTextures(frontImage, backImage, false, 0); 233// {
234 } 234// return BlendTextures(frontImage, backImage, false, 0);
235// }
235 236
236 private byte[] BlendTextures(byte[] frontImage, byte[] backImage, bool setNewAlpha, byte newAlpha) 237 private byte[] BlendTextures(byte[] frontImage, byte[] backImage, bool setNewAlpha, byte newAlpha)
237 { 238 {
diff --git a/OpenSim/Region/Environment/Modules/Terrain/PaintBrushes/FlattenSphere.cs b/OpenSim/Region/Environment/Modules/Terrain/PaintBrushes/FlattenSphere.cs
index 6cbd390..9bfb981 100644
--- a/OpenSim/Region/Environment/Modules/Terrain/PaintBrushes/FlattenSphere.cs
+++ b/OpenSim/Region/Environment/Modules/Terrain/PaintBrushes/FlattenSphere.cs
@@ -37,38 +37,39 @@ namespace OpenSim.Region.Environment.Modules.Terrain.PaintBrushes
37 return z; 37 return z;
38 } 38 }
39 39
40 private double GetBilinearInterpolate(double x, double y, ITerrainChannel map) 40// TODO: unused
41 { 41// private double GetBilinearInterpolate(double x, double y, ITerrainChannel map)
42 int w = map.Width; 42// {
43 int h = map.Height; 43// int w = map.Width;
44 44// int h = map.Height;
45 if (x > w - 2.0) 45
46 x = w - 2.0; 46// if (x > w - 2.0)
47 if (y > h - 2.0) 47// x = w - 2.0;
48 y = h - 2.0; 48// if (y > h - 2.0)
49 if (x < 0.0) 49// y = h - 2.0;
50 x = 0.0; 50// if (x < 0.0)
51 if (y < 0.0) 51// x = 0.0;
52 y = 0.0; 52// if (y < 0.0)
53 53// y = 0.0;
54 int stepSize = 1; 54
55 double h00 = map[(int)x, (int)y]; 55// int stepSize = 1;
56 double h10 = map[(int)x + stepSize, (int)y]; 56// double h00 = map[(int)x, (int)y];
57 double h01 = map[(int)x, (int)y + stepSize]; 57// double h10 = map[(int)x + stepSize, (int)y];
58 double h11 = map[(int)x + stepSize, (int)y + stepSize]; 58// double h01 = map[(int)x, (int)y + stepSize];
59 double h1 = h00; 59// double h11 = map[(int)x + stepSize, (int)y + stepSize];
60 double h2 = h10; 60// double h1 = h00;
61 double h3 = h01; 61// double h2 = h10;
62 double h4 = h11; 62// double h3 = h01;
63 double a00 = h1; 63// double h4 = h11;
64 double a10 = h2 - h1; 64// double a00 = h1;
65 double a01 = h3 - h1; 65// double a10 = h2 - h1;
66 double a11 = h1 - h2 - h3 + h4; 66// double a01 = h3 - h1;
67 double partialx = x - (int)x; 67// double a11 = h1 - h2 - h3 + h4;
68 double partialz = y - (int)y; 68// double partialx = x - (int)x;
69 double hi = a00 + (a10 * partialx) + (a01 * partialz) + (a11 * partialx * partialz); 69// double partialz = y - (int)y;
70 return hi; 70// double hi = a00 + (a10 * partialx) + (a01 * partialz) + (a11 * partialx * partialz);
71 } 71// return hi;
72// }
72 73
73 #region ITerrainPaintableEffect Members 74 #region ITerrainPaintableEffect Members
74 75
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index e8708a1..bba5ae1 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -790,25 +790,26 @@ namespace OpenSim.Region.Environment.Scenes
790 } 790 }
791 791
792 //Updates the time in the viewer. 792 //Updates the time in the viewer.
793 private void UpdateInWorldTime() 793// TODO: unused
794 { 794// private void UpdateInWorldTime()
795 m_timeUpdateCount++; 795// {
796 if (m_timeUpdateCount > 600) 796// m_timeUpdateCount++;
797 { 797// if (m_timeUpdateCount > 600)
798 List<ScenePresence> avatars = GetAvatars(); 798// {
799 foreach (ScenePresence avatar in avatars) 799// List<ScenePresence> avatars = GetAvatars();
800 { 800// foreach (ScenePresence avatar in avatars)
801 avatar.ControllingClient.SendViewerTime(m_timePhase); 801// {
802 } 802// avatar.ControllingClient.SendViewerTime(m_timePhase);
803 803// }
804 m_timeUpdateCount = 0; 804
805 m_timePhase++; 805// m_timeUpdateCount = 0;
806 if (m_timePhase > 94) 806// m_timePhase++;
807 { 807// if (m_timePhase > 94)
808 m_timePhase = 0; 808// {
809 } 809// m_timePhase = 0;
810 } 810// }
811 } 811// }
812// }
812 813
813 private void SendSimStatsPackets(SimStatsPacket pack) 814 private void SendSimStatsPackets(SimStatsPacket pack)
814 { 815 {
diff --git a/OpenSim/Region/ExtensionsScriptModule/Engines/CSharp/Examples/ExportRegionToLSL.cs b/OpenSim/Region/ExtensionsScriptModule/Engines/CSharp/Examples/ExportRegionToLSL.cs
index 529ff6d..00a7df3 100644
--- a/OpenSim/Region/ExtensionsScriptModule/Engines/CSharp/Examples/ExportRegionToLSL.cs
+++ b/OpenSim/Region/ExtensionsScriptModule/Engines/CSharp/Examples/ExportRegionToLSL.cs
@@ -72,22 +72,23 @@ namespace OpenSim.Region.ExtensionsScriptModule.CSharp.Examples
72 }*/ 72 }*/
73 } 73 }
74 74
75 private string processPrimitiveToString(SceneObjectPart prim) 75// TODO: unused
76 { 76// private string processPrimitiveToString(SceneObjectPart prim)
77 /*string desc = prim.Description; 77// {
78 string name = prim.Name; 78// /*string desc = prim.Description;
79 LLVector3 pos = prim.Pos; 79// string name = prim.Name;
80 LLQuaternion rot = new LLQuaternion(prim.Rotation.x, prim.Rotation.y, prim.Rotation.z, prim.Rotation.w); 80// LLVector3 pos = prim.Pos;
81 LLVector3 scale = prim.Scale; 81// LLQuaternion rot = new LLQuaternion(prim.Rotation.x, prim.Rotation.y, prim.Rotation.z, prim.Rotation.w);
82 LLVector3 rootPos = prim.WorldPos; 82// LLVector3 scale = prim.Scale;
83 83// LLVector3 rootPos = prim.WorldPos;
84 string setPrimParams = String.Empty; 84
85 85// string setPrimParams = String.Empty;
86 setPrimParams += "[PRIM_SCALE, " + scale.ToString() + ", PRIM_POS, " + rootPos.ToString() + ", PRIM_ROTATION, " + rot.ToString() + "]\n"; 86
87 87// setPrimParams += "[PRIM_SCALE, " + scale.ToString() + ", PRIM_POS, " + rootPos.ToString() + ", PRIM_ROTATION, " + rot.ToString() + "]\n";
88 return setPrimParams; 88
89 */ 89// return setPrimParams;
90 return System.String.Empty; 90// */
91 } 91// return System.String.Empty;
92// }
92 } 93 }
93} 94}
diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
index 48a1c0e..ce46dae 100644
--- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
+++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
@@ -59,35 +59,36 @@ namespace OpenSim.Region.Physics.Meshing
59 // const string baseDir = "rawFiles"; 59 // const string baseDir = "rawFiles";
60 private const string baseDir = null; //"rawFiles"; 60 private const string baseDir = null; //"rawFiles";
61 61
62 private static void IntersectionParameterPD(PhysicsVector p1, PhysicsVector r1, PhysicsVector p2, 62// TODO: unused
63 PhysicsVector r2, ref float lambda, ref float mu) 63// private static void IntersectionParameterPD(PhysicsVector p1, PhysicsVector r1, PhysicsVector p2,
64 { 64// PhysicsVector r2, ref float lambda, ref float mu)
65 // p1, p2, points on the straight 65// {
66 // r1, r2, directional vectors of the straight. Not necessarily of length 1! 66// // p1, p2, points on the straight
67 // note, that l, m can be scaled such, that the range 0..1 is mapped to the area between two points, 67// // r1, r2, directional vectors of the straight. Not necessarily of length 1!
68 // thus allowing to decide whether an intersection is between two points 68// // note, that l, m can be scaled such, that the range 0..1 is mapped to the area between two points,
69 69// // thus allowing to decide whether an intersection is between two points
70 float r1x = r1.X; 70
71 float r1y = r1.Y; 71// float r1x = r1.X;
72 float r2x = r2.X; 72// float r1y = r1.Y;
73 float r2y = r2.Y; 73// float r2x = r2.X;
74 74// float r2y = r2.Y;
75 float denom = r1y*r2x - r1x*r2y; 75
76 76// float denom = r1y*r2x - r1x*r2y;
77 if (denom == 0.0) 77
78 { 78// if (denom == 0.0)
79 lambda = Single.NaN; 79// {
80 mu = Single.NaN; 80// lambda = Single.NaN;
81 return; 81// mu = Single.NaN;
82 } 82// return;
83 83// }
84 float p1x = p1.X; 84
85 float p1y = p1.Y; 85// float p1x = p1.X;
86 float p2x = p2.X; 86// float p1y = p1.Y;
87 float p2y = p2.Y; 87// float p2x = p2.X;
88 lambda = (-p2x*r2y + p1x*r2y + (p2y - p1y)*r2x)/denom; 88// float p2y = p2.Y;
89 mu = (-p2x*r1y + p1x*r1y + (p2y - p1y)*r1x)/denom; 89// lambda = (-p2x*r2y + p1x*r2y + (p2y - p1y)*r2x)/denom;
90 } 90// mu = (-p2x*r1y + p1x*r1y + (p2y - p1y)*r1x)/denom;
91// }
91 92
92 private static List<Triangle> FindInfluencedTriangles(List<Triangle> triangles, Vertex v) 93 private static List<Triangle> FindInfluencedTriangles(List<Triangle> triangles, Vertex v)
93 { 94 {
diff --git a/OpenSim/Region/Physics/Meshing/SimpleHull.cs b/OpenSim/Region/Physics/Meshing/SimpleHull.cs
index 3d3f42c..c518b78 100644
--- a/OpenSim/Region/Physics/Meshing/SimpleHull.cs
+++ b/OpenSim/Region/Physics/Meshing/SimpleHull.cs
@@ -170,11 +170,12 @@ namespace OpenSim.Region.Physics.Meshing
170 return result; 170 return result;
171 } 171 }
172 172
173 private bool InsertVertex(Vertex v, int iAfter) 173// TODO: unused
174 { 174// private bool InsertVertex(Vertex v, int iAfter)
175 vertices.Insert(iAfter + 1, v); 175// {
176 return true; 176// vertices.Insert(iAfter + 1, v);
177 } 177// return true;
178// }
178 179
179 private Vertex getNextVertex(Vertex currentVertex) 180 private Vertex getNextVertex(Vertex currentVertex)
180 { 181 {
diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
index b870a77..62978fd 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
@@ -504,26 +504,27 @@ namespace OpenSim.Region.Physics.OdePlugin
504 { 504 {
505 505
506 } 506 }
507 private void standupStraight() 507
508 { 508// TODO: unused:
509 509// private void standupStraight()
510 // The purpose of this routine here is to quickly stabilize the Body while it's popped up in the air. 510// {
511 // The amotor needs a few seconds to stabilize so without it, the avatar shoots up sky high when you 511// // The purpose of this routine here is to quickly stabilize the Body while it's popped up in the air.
512 // change appearance and when you enter the simulator 512// // The amotor needs a few seconds to stabilize so without it, the avatar shoots up sky high when you
513 // After this routine is done, the amotor stabilizes much quicker 513// // change appearance and when you enter the simulator
514 d.Vector3 feet; 514// // After this routine is done, the amotor stabilizes much quicker
515 d.Vector3 head; 515// d.Vector3 feet;
516 d.BodyGetRelPointPos(Body, 0.0f, 0.0f, -1.0f, out feet); 516// d.Vector3 head;
517 d.BodyGetRelPointPos(Body, 0.0f, 0.0f, 1.0f, out head); 517// d.BodyGetRelPointPos(Body, 0.0f, 0.0f, -1.0f, out feet);
518 float posture = head.Z - feet.Z; 518// d.BodyGetRelPointPos(Body, 0.0f, 0.0f, 1.0f, out head);
519 519// float posture = head.Z - feet.Z;
520 // restoring force proportional to lack of posture: 520
521 float servo = (2.5f - posture) * POSTURE_SERVO; 521// // restoring force proportional to lack of posture:
522 d.BodyAddForceAtRelPos(Body, 0.0f, 0.0f, servo, 0.0f, 0.0f, 1.0f); 522// float servo = (2.5f - posture) * POSTURE_SERVO;
523 d.BodyAddForceAtRelPos(Body, 0.0f, 0.0f, -servo, 0.0f, 0.0f, -1.0f); 523// d.BodyAddForceAtRelPos(Body, 0.0f, 0.0f, servo, 0.0f, 0.0f, 1.0f);
524 //d.Matrix3 bodyrotation = d.BodyGetRotation(Body); 524// d.BodyAddForceAtRelPos(Body, 0.0f, 0.0f, -servo, 0.0f, 0.0f, -1.0f);
525 //m_log.Info("[PHYSICSAV]: Rotation: " + bodyrotation.M00 + " : " + bodyrotation.M01 + " : " + bodyrotation.M02 + " : " + bodyrotation.M10 + " : " + bodyrotation.M11 + " : " + bodyrotation.M12 + " : " + bodyrotation.M20 + " : " + bodyrotation.M21 + " : " + bodyrotation.M22); 525// //d.Matrix3 bodyrotation = d.BodyGetRotation(Body);
526 } 526// //m_log.Info("[PHYSICSAV]: Rotation: " + bodyrotation.M00 + " : " + bodyrotation.M01 + " : " + bodyrotation.M02 + " : " + bodyrotation.M10 + " : " + bodyrotation.M11 + " : " + bodyrotation.M12 + " : " + bodyrotation.M20 + " : " + bodyrotation.M21 + " : " + bodyrotation.M22);
527// }
527 528
528 public override PhysicsVector Force 529 public override PhysicsVector Force
529 { 530 {
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
index abac967..8529234 100644
--- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
+++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
@@ -981,12 +981,11 @@ namespace OpenSim.Region.Physics.OdePlugin
981 981
982 #endregion 982 #endregion
983 983
984 private float GetTerrainHeightAtXY(float x, float y) 984// TODO: unused
985 { 985// private float GetTerrainHeightAtXY(float x, float y)
986 return (float)_origheightmap[(int)y * Constants.RegionSize + (int)x]; 986// {
987 987// return (float)_origheightmap[(int)y * Constants.RegionSize + (int)x];
988 988// }
989 }
990 989
991 #region Add/Remove Entities 990 #region Add/Remove Entities
992 991
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs
index 04de990..09f84d6 100644
--- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs
+++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs
@@ -141,26 +141,27 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
141 } 141 }
142 142
143 private static int privateThreadCount = 0; 143 private static int privateThreadCount = 0;
144 private Thread StartScriptLoadUnloadThread() 144// TODO: unused
145 { 145// private Thread StartScriptLoadUnloadThread()
146 Thread t = new Thread(ScriptLoadUnloadThreadLoop); 146// {
147 string name = "ScriptLoadUnloadThread:"; 147// Thread t = new Thread(ScriptLoadUnloadThreadLoop);
148 if (PrivateThread) 148// string name = "ScriptLoadUnloadThread:";
149 { 149// if (PrivateThread)
150 name += "Private:" + privateThreadCount; 150// {
151 privateThreadCount++; 151// name += "Private:" + privateThreadCount;
152 } 152// privateThreadCount++;
153 else 153// }
154 { 154// else
155 name += "Shared"; 155// {
156 } 156// name += "Shared";
157 t.Name = name; 157// }
158 t.IsBackground = true; 158// t.Name = name;
159 t.Priority = ThreadPriority.Normal; 159// t.IsBackground = true;
160 t.Start(); 160// t.Priority = ThreadPriority.Normal;
161 OpenSim.Framework.ThreadTracker.Add(t); 161// t.Start();
162 return t; 162// OpenSim.Framework.ThreadTracker.Add(t);
163 } 163// return t;
164// }
164 165
165 ~ScriptManager() 166 ~ScriptManager()
166 { 167 {
@@ -184,26 +185,27 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
184 185
185 #region Load / Unload scripts (Thread loop) 186 #region Load / Unload scripts (Thread loop)
186 187
187 private void ScriptLoadUnloadThreadLoop() 188// TODO: unused
188 { 189// private void ScriptLoadUnloadThreadLoop()
189 try 190// {
190 { 191// try
191 while (true) 192// {
192 { 193// while (true)
193 if (LUQueue.Count == 0) 194// {
194 Thread.Sleep(scriptLoadUnloadThread_IdleSleepms); 195// if (LUQueue.Count == 0)
195 //if (PleaseShutdown) 196// Thread.Sleep(scriptLoadUnloadThread_IdleSleepms);
196 // return; 197// //if (PleaseShutdown)
197 DoScriptLoadUnload(); 198// // return;
198 } 199// DoScriptLoadUnload();
199 } 200// }
200 catch (ThreadAbortException tae) 201// }
201 { 202// catch (ThreadAbortException tae)
202 string a = tae.ToString(); 203// {
203 a = String.Empty; 204// string a = tae.ToString();
204 // Expected 205// a = String.Empty;
205 } 206// // Expected
206 } 207// }
208// }
207 209
208 public void DoScriptLoadUnload() 210 public void DoScriptLoadUnload()
209 { 211 {
diff --git a/OpenSim/Region/ScriptEngine/Common/TRPC/TCPClient.cs b/OpenSim/Region/ScriptEngine/Common/TRPC/TCPClient.cs
index 1187287..7689d69 100644
--- a/OpenSim/Region/ScriptEngine/Common/TRPC/TCPClient.cs
+++ b/OpenSim/Region/ScriptEngine/Common/TRPC/TCPClient.cs
@@ -74,12 +74,13 @@ namespace OpenSim.Region.ScriptEngine.Common.TRPC
74 Clients[ID].Disconnect(); 74 Clients[ID].Disconnect();
75 } 75 }
76 76
77 void asyncConnected(IAsyncResult iar) 77// TODO: unused
78 { 78// void asyncConnected(IAsyncResult iar)
79 Socket client = (Socket)iar.AsyncState; 79// {
80 client.EndConnect(iar); 80// Socket client = (Socket)iar.AsyncState;
81 ProcessConnection(client); 81// client.EndConnect(iar);
82 } 82// ProcessConnection(client);
83// }
83 84
84 private int ProcessConnection(Socket client) 85 private int ProcessConnection(Socket client)
85 { 86 {
diff --git a/OpenSim/Region/ScriptEngine/LSOEngine/LSO/IL_common_functions.cs b/OpenSim/Region/ScriptEngine/LSOEngine/LSO/IL_common_functions.cs
index a36ab1b..60d68f5 100644
--- a/OpenSim/Region/ScriptEngine/LSOEngine/LSO/IL_common_functions.cs
+++ b/OpenSim/Region/ScriptEngine/LSOEngine/LSO/IL_common_functions.cs
@@ -34,18 +34,19 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
34{ 34{
35 internal partial class LSO_Parser 35 internal partial class LSO_Parser
36 { 36 {
37 private static TypeBuilder CreateType(ModuleBuilder modBuilder, string typeName) 37// TODO: unused:
38 { 38// private static TypeBuilder CreateType(ModuleBuilder modBuilder, string typeName)
39 TypeBuilder typeBuilder = modBuilder.DefineType(typeName, 39// {
40 TypeAttributes.Public | 40// TypeBuilder typeBuilder = modBuilder.DefineType(typeName,
41 TypeAttributes.Class | 41// TypeAttributes.Public |
42 TypeAttributes.AutoClass | 42// TypeAttributes.Class |
43 TypeAttributes.AnsiClass | 43// TypeAttributes.AutoClass |
44 TypeAttributes.BeforeFieldInit | 44// TypeAttributes.AnsiClass |
45 TypeAttributes.AutoLayout, 45// TypeAttributes.BeforeFieldInit |
46 typeof (object), 46// TypeAttributes.AutoLayout,
47 new Type[] {typeof (object)}); 47// typeof (object),
48 return typeBuilder; 48// new Type[] {typeof (object)});
49 } 49// return typeBuilder;
50// }
50 } 51 }
51} 52}
diff --git a/OpenSim/Region/ScriptEngine/LSOEngine/LSO/LSL_OPCODE_IL_processor.cs b/OpenSim/Region/ScriptEngine/LSOEngine/LSO/LSL_OPCODE_IL_processor.cs
index ff0fe77..34a784c 100644
--- a/OpenSim/Region/ScriptEngine/LSOEngine/LSO/LSL_OPCODE_IL_processor.cs
+++ b/OpenSim/Region/ScriptEngine/LSOEngine/LSO/LSL_OPCODE_IL_processor.cs
@@ -342,10 +342,11 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
342 return false; 342 return false;
343 } 343 }
344 344
345 private void IL_PopToStack(ILGenerator il) 345// TODO: unused
346 { 346// private void IL_PopToStack(ILGenerator il)
347 IL_PopToStack(il, 1); 347// {
348 } 348// IL_PopToStack(il, 1);
349// }
349 350
350 private void IL_PopToStack(ILGenerator il, int count) 351 private void IL_PopToStack(ILGenerator il, int count)
351 { 352 {
diff --git a/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs b/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs
index 308f35b..4ab535b 100644
--- a/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs
+++ b/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs
@@ -310,37 +310,33 @@ namespace OpenSim.Region.Terrain
310 } 310 }
311 } 311 }
312 312
313
314 lastEdit = DateTime.Now; 313 lastEdit = DateTime.Now;
315 314
316 return; 315 return;
317 } 316 }
318 317
319 318// TODO: unused
320 319// /// <summary>
321 320// /// Checks to make sure the terrain is within baked values +/- maxRaise/minLower
322 /// <summary> 321// /// </summary>
323 /// Checks to make sure the terrain is within baked values +/- maxRaise/minLower 322// private void SetTerrainWithinBounds()
324 /// </summary> 323// {
325 private void SetTerrainWithinBounds() 324// int x, y;
326 { 325// for (x = 0; x < w; x++)
327 int x, y; 326// {
328 for (x = 0; x < w; x++) 327// for (y = 0; y < h; y++)
329 { 328// {
330 for (y = 0; y < h; y++) 329// if ((heightmap.Get(x, y) > revertmap.Get(x, y) + maxRaise))
331 { 330// {
332 if ((heightmap.Get(x, y) > revertmap.Get(x, y) + maxRaise)) 331// heightmap.map[x, y] = revertmap.Get(x, y) + maxRaise;
333 { 332// }
334 heightmap.map[x, y] = revertmap.Get(x, y) + maxRaise; 333// if ((heightmap.Get(x, y) > revertmap.Get(x, y) - minLower))
335 } 334// {
336 if ((heightmap.Get(x, y) > revertmap.Get(x, y) - minLower)) 335// heightmap.map[x, y] = revertmap.Get(x, y) - minLower;
337 { 336// }
338 heightmap.map[x, y] = revertmap.Get(x, y) - minLower; 337// }
339 } 338// }
340 } 339// }
341 }
342 }
343
344 340
345 /// <summary> 341 /// <summary>
346 /// Converts the heightmap to a 65536 value 1D floating point array 342 /// Converts the heightmap to a 65536 value 1D floating point array
diff --git a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Editing/Flatten.cs b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Editing/Flatten.cs
index aa102b8..ba076c2 100644
--- a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Editing/Flatten.cs
+++ b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Editing/Flatten.cs
@@ -70,48 +70,49 @@ namespace libTerrain
70 Blend(flat, temp); 70 Blend(flat, temp);
71 } 71 }
72 72
73 private void FlattenFast(double rx, double ry, double size, double amount) 73// TODO: unused
74 { 74// private void FlattenFast(double rx, double ry, double size, double amount)
75 int x, y; 75// {
76 double avg = 0; 76// int x, y;
77 double div = 0; 77// double avg = 0;
78 78// double div = 0;
79 int minX = Math.Max(0, (int) (rx - (size + 1))); 79
80 int maxX = Math.Min(w, (int) (rx + (size + 1))); 80// int minX = Math.Max(0, (int) (rx - (size + 1)));
81 int minY = Math.Max(0, (int) (ry - (size + 1))); 81// int maxX = Math.Min(w, (int) (rx + (size + 1)));
82 int maxY = Math.Min(h, (int) (ry + (size + 1))); 82// int minY = Math.Max(0, (int) (ry - (size + 1)));
83 83// int maxY = Math.Min(h, (int) (ry + (size + 1)));
84 for (x = minX; x < maxX; x++) 84
85 { 85// for (x = minX; x < maxX; x++)
86 for (y = minY; y < maxY; y++) 86// {
87 { 87// for (y = minY; y < maxY; y++)
88 double z = size; 88// {
89 z *= z; 89// double z = size;
90 z -= ((x - rx)*(x - rx)) + ((y - ry)*(y - ry)); 90// z *= z;
91 91// z -= ((x - rx)*(x - rx)) + ((y - ry)*(y - ry));
92 if (z < 0) 92
93 z = 0; 93// if (z < 0)
94 94// z = 0;
95 avg += z*amount; 95
96 div += z; 96// avg += z*amount;
97 } 97// div += z;
98 } 98// }
99 99// }
100 double height = avg/div; 100
101 101// double height = avg/div;
102 for (x = minX; x < maxX; x++) 102
103 { 103// for (x = minX; x < maxX; x++)
104 for (y = minY; y < maxY; y++) 104// {
105 { 105// for (y = minY; y < maxY; y++)
106 double z = size; 106// {
107 z *= z; 107// double z = size;
108 z -= ((x - rx)*(x - rx)) + ((y - ry)*(y - ry)); 108// z *= z;
109 109// z -= ((x - rx)*(x - rx)) + ((y - ry)*(y - ry));
110 if (z > 0.0) 110
111 Set(x, y, Tools.LinearInterpolate(map[x, y], height, z)); 111// if (z > 0.0)
112 } 112// Set(x, y, Tools.LinearInterpolate(map[x, y], height, z));
113 } 113// }
114 } 114// }
115// }
115 116
116 public void Flatten(Channel mask, double amount) 117 public void Flatten(Channel mask, double amount)
117 { 118 {
diff --git a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Manipulators/NavierStokes.cs b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Manipulators/NavierStokes.cs
index 7840f8b..8f12637 100644
--- a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Manipulators/NavierStokes.cs
+++ b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Manipulators/NavierStokes.cs
@@ -40,12 +40,13 @@ namespace libTerrain
40 return ((i) + (N + 2)*(j)); 40 return ((i) + (N + 2)*(j));
41 } 41 }
42 42
43 private static void nsSwap(ref double x0, ref double x) 43// TODO: unused
44 { 44// private static void nsSwap(ref double x0, ref double x)
45 double tmp = x0; 45// {
46 x0 = x; 46// double tmp = x0;
47 x = tmp; 47// x0 = x;
48 } 48// x = tmp;
49// }
49 50
50 private static void nsSwap(ref double[] x0, ref double[] x) 51 private static void nsSwap(ref double[] x0, ref double[] x)
51 { 52 {