aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/Meshing/Extruder.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Physics/Meshing/Extruder.cs')
-rw-r--r--OpenSim/Region/Physics/Meshing/Extruder.cs27
1 files changed, 6 insertions, 21 deletions
diff --git a/OpenSim/Region/Physics/Meshing/Extruder.cs b/OpenSim/Region/Physics/Meshing/Extruder.cs
index 154a423..8a95df9 100644
--- a/OpenSim/Region/Physics/Meshing/Extruder.cs
+++ b/OpenSim/Region/Physics/Meshing/Extruder.cs
@@ -62,7 +62,6 @@ namespace OpenSim.Region.Physics.Meshing
62 public float pathTaperX = 0.0f; 62 public float pathTaperX = 0.0f;
63 public float pathTaperY = 0.0f; 63 public float pathTaperY = 0.0f;
64 64
65
66 public Mesh Extrude(Mesh m) 65 public Mesh Extrude(Mesh m)
67 { 66 {
68 startParameter = float.MinValue; 67 startParameter = float.MinValue;
@@ -129,8 +128,8 @@ namespace OpenSim.Region.Physics.Meshing
129 v.Y = v2.Y; 128 v.Y = v2.Y;
130 v.Z = v2.Z; 129 v.Z = v2.Z;
131 } 130 }
132
133 } 131 }
132
134 foreach (Vertex v in workingMinus.vertices) 133 foreach (Vertex v in workingMinus.vertices)
135 { 134 {
136 if (v == null) 135 if (v == null)
@@ -159,10 +158,8 @@ namespace OpenSim.Region.Physics.Meshing
159 } 158 }
160 159
161 result.Append(workingMinus); 160 result.Append(workingMinus);
162
163 result.Append(workingMiddle); 161 result.Append(workingMiddle);
164 162
165
166 int iLastNull = 0; 163 int iLastNull = 0;
167 164
168 for (int i = 0; i < workingMiddle.vertices.Count; i++) 165 for (int i = 0; i < workingMiddle.vertices.Count; i++)
@@ -228,6 +225,7 @@ namespace OpenSim.Region.Physics.Meshing
228 new Triangle(workingPlus.vertices[iNext], workingMiddle.vertices[i], workingMiddle.vertices[iNext]); 225 new Triangle(workingPlus.vertices[iNext], workingMiddle.vertices[i], workingMiddle.vertices[iNext]);
229 result.Add(tSide); 226 result.Add(tSide);
230 } 227 }
228
231 if (twistMid != 0) 229 if (twistMid != 0)
232 { 230 {
233 foreach (Vertex v in result.vertices) 231 foreach (Vertex v in result.vertices)
@@ -245,6 +243,7 @@ namespace OpenSim.Region.Physics.Meshing
245 } 243 }
246 return result; 244 return result;
247 } 245 }
246
248 public Mesh ExtrudeCircularPath(Mesh m) 247 public Mesh ExtrudeCircularPath(Mesh m)
249 { 248 {
250 //startParameter = float.MinValue; 249 //startParameter = float.MinValue;
@@ -294,8 +293,6 @@ namespace OpenSim.Region.Physics.Meshing
294 //System.Console.WriteLine("taperBotFactorX: " + taperBotFactorX.ToString() + " taperBotFactorY: " + taperBotFactorY.ToString() 293 //System.Console.WriteLine("taperBotFactorX: " + taperBotFactorX.ToString() + " taperBotFactorY: " + taperBotFactorY.ToString()
295 // + " taperTopFactorX: " + taperTopFactorX.ToString() + " taperTopFactorY: " + taperTopFactorY.ToString()); 294 // + " taperTopFactorX: " + taperTopFactorX.ToString() + " taperTopFactorY: " + taperTopFactorY.ToString());
296 295
297
298
299 do 296 do
300 { 297 {
301 float percentOfPath = 1.0f; 298 float percentOfPath = 1.0f;
@@ -328,10 +325,6 @@ namespace OpenSim.Region.Physics.Meshing
328 325
329 //System.Console.WriteLine("Extruder: radius: " + radius.ToString() + " radiusScale: " + radiusScale.ToString()); 326 //System.Console.WriteLine("Extruder: radius: " + radius.ToString() + " radiusScale: " + radiusScale.ToString());
330 327
331
332
333
334
335 float twist = twistBot + (twistTotal * (float)percentOfPath); 328 float twist = twistBot + (twistTotal * (float)percentOfPath);
336 329
337 float zOffset = (float)(System.Math.Sin(angle) * (0.5f - yPathScale)) * radiusScale; 330 float zOffset = (float)(System.Math.Sin(angle) * (0.5f - yPathScale)) * radiusScale;
@@ -404,13 +397,6 @@ namespace OpenSim.Region.Physics.Meshing
404 } 397 }
405 lastLayer = newLayer; 398 lastLayer = newLayer;
406 399
407
408
409
410
411
412
413
414 // calc next angle 400 // calc next angle
415 401
416 if (angle >= endAngle) 402 if (angle >= endAngle)
@@ -421,10 +407,7 @@ namespace OpenSim.Region.Physics.Meshing
421 if (angle > endAngle) 407 if (angle > endAngle)
422 angle = endAngle; 408 angle = endAngle;
423 } 409 }
424 } 410 } while (!done);
425 while (!done);
426
427
428 411
429 // scale the mesh to the desired size 412 // scale the mesh to the desired size
430 float xScale = size.X; 413 float xScale = size.X;
@@ -432,12 +415,14 @@ namespace OpenSim.Region.Physics.Meshing
432 float zScale = size.Z; 415 float zScale = size.Z;
433 416
434 foreach (Vertex v in result.vertices) 417 foreach (Vertex v in result.vertices)
418 {
435 if (v != null) 419 if (v != null)
436 { 420 {
437 v.X *= xScale; 421 v.X *= xScale;
438 v.Y *= yScale; 422 v.Y *= yScale;
439 v.Z *= zScale; 423 v.Z *= zScale;
440 } 424 }
425 }
441 426
442 return result; 427 return result;
443 } 428 }