aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics
diff options
context:
space:
mode:
authorJeff Ames2008-05-30 08:35:57 +0000
committerJeff Ames2008-05-30 08:35:57 +0000
commit04625109560fb54d613b1fc9c81a8a9f387720c9 (patch)
treeaf00035a676beee3542a55cd13ce09e57f1ad778 /OpenSim/Region/Physics
parentthanks krtaylor for a (diff)
downloadopensim-SC_OLD-04625109560fb54d613b1fc9c81a8a9f387720c9.zip
opensim-SC_OLD-04625109560fb54d613b1fc9c81a8a9f387720c9.tar.gz
opensim-SC_OLD-04625109560fb54d613b1fc9c81a8a9f387720c9.tar.bz2
opensim-SC_OLD-04625109560fb54d613b1fc9c81a8a9f387720c9.tar.xz
Update svn properties. Formatting cleanup.
Diffstat (limited to 'OpenSim/Region/Physics')
-rw-r--r--OpenSim/Region/Physics/Meshing/Extruder.cs27
-rw-r--r--OpenSim/Region/Physics/Meshing/Meshmerizer.cs8
2 files changed, 10 insertions, 25 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 }
diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
index 5ef392c..3fbc7c9 100644
--- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
+++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
@@ -255,7 +255,7 @@ namespace OpenSim.Region.Physics.Meshing
255 holeHull.AddVertex(IPM); 255 holeHull.AddVertex(IPM);
256 } 256 }
257 //if (hshape == HollowShape.Circle && pbs.PathCurve == (byte)Extrusion.Straight) 257 //if (hshape == HollowShape.Circle && pbs.PathCurve == (byte)Extrusion.Straight)
258 if ( hshape == HollowShape.Circle ) 258 if (hshape == HollowShape.Circle)
259 { 259 {
260 float hollowFactorF = (float)fhollowFactor / (float)50000; 260 float hollowFactorF = (float)fhollowFactor / (float)50000;
261 261
@@ -1346,7 +1346,7 @@ namespace OpenSim.Region.Physics.Meshing
1346 // || (primShape.ProfileCurve & 0x07) == (byte) ProfileShape.Square) 1346 // || (primShape.ProfileCurve & 0x07) == (byte) ProfileShape.Square)
1347 { 1347 {
1348 //Console.WriteLine("Meshmerizer thinks " + primName + " is a TORUS"); 1348 //Console.WriteLine("Meshmerizer thinks " + primName + " is a TORUS");
1349 if ( hollowShape == HollowShape.Same ) 1349 if (hollowShape == HollowShape.Same)
1350 hollowShape = HollowShape.Circle; 1350 hollowShape = HollowShape.Circle;
1351 1351
1352 // build the profile shape 1352 // build the profile shape
@@ -1381,7 +1381,7 @@ namespace OpenSim.Region.Physics.Meshing
1381 else if ((primShape.ProfileCurve & 0x07) == (byte)ProfileShape.Square) // a ring 1381 else if ((primShape.ProfileCurve & 0x07) == (byte)ProfileShape.Square) // a ring
1382 { 1382 {
1383 //Console.WriteLine("Meshmerizer thinks " + primName + " is a TUBE"); 1383 //Console.WriteLine("Meshmerizer thinks " + primName + " is a TUBE");
1384 if ( hollowShape == HollowShape.Same ) 1384 if (hollowShape == HollowShape.Same)
1385 hollowShape = HollowShape.Square; 1385 hollowShape = HollowShape.Square;
1386 1386
1387 outerHull.AddVertex(new Vertex(+0.5f, +0.5f, 0.0f)); 1387 outerHull.AddVertex(new Vertex(+0.5f, +0.5f, 0.0f));
@@ -1393,7 +1393,7 @@ namespace OpenSim.Region.Physics.Meshing
1393 else if ((primShape.ProfileCurve & 0x07) == (byte)ProfileShape.EquilateralTriangle) 1393 else if ((primShape.ProfileCurve & 0x07) == (byte)ProfileShape.EquilateralTriangle)
1394 { 1394 {
1395 //Console.WriteLine("Meshmerizer thinks " + primName + " is a RING"); 1395 //Console.WriteLine("Meshmerizer thinks " + primName + " is a RING");
1396 if ( hollowShape == HollowShape.Same ) 1396 if (hollowShape == HollowShape.Same)
1397 hollowShape = HollowShape.Triangle; 1397 hollowShape = HollowShape.Triangle;
1398 1398
1399 outerHull.AddVertex(new Vertex(+0.255f, -0.375f, 0.0f)); 1399 outerHull.AddVertex(new Vertex(+0.255f, -0.375f, 0.0f));