From 04625109560fb54d613b1fc9c81a8a9f387720c9 Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Fri, 30 May 2008 08:35:57 +0000 Subject: Update svn properties. Formatting cleanup. --- OpenSim/Region/Physics/Meshing/Extruder.cs | 27 ++++++--------------------- OpenSim/Region/Physics/Meshing/Meshmerizer.cs | 8 ++++---- 2 files changed, 10 insertions(+), 25 deletions(-) (limited to 'OpenSim/Region/Physics/Meshing') 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 public float pathTaperX = 0.0f; public float pathTaperY = 0.0f; - public Mesh Extrude(Mesh m) { startParameter = float.MinValue; @@ -129,8 +128,8 @@ namespace OpenSim.Region.Physics.Meshing v.Y = v2.Y; v.Z = v2.Z; } - } + foreach (Vertex v in workingMinus.vertices) { if (v == null) @@ -159,10 +158,8 @@ namespace OpenSim.Region.Physics.Meshing } result.Append(workingMinus); - result.Append(workingMiddle); - int iLastNull = 0; for (int i = 0; i < workingMiddle.vertices.Count; i++) @@ -228,6 +225,7 @@ namespace OpenSim.Region.Physics.Meshing new Triangle(workingPlus.vertices[iNext], workingMiddle.vertices[i], workingMiddle.vertices[iNext]); result.Add(tSide); } + if (twistMid != 0) { foreach (Vertex v in result.vertices) @@ -245,6 +243,7 @@ namespace OpenSim.Region.Physics.Meshing } return result; } + public Mesh ExtrudeCircularPath(Mesh m) { //startParameter = float.MinValue; @@ -294,8 +293,6 @@ namespace OpenSim.Region.Physics.Meshing //System.Console.WriteLine("taperBotFactorX: " + taperBotFactorX.ToString() + " taperBotFactorY: " + taperBotFactorY.ToString() // + " taperTopFactorX: " + taperTopFactorX.ToString() + " taperTopFactorY: " + taperTopFactorY.ToString()); - - do { float percentOfPath = 1.0f; @@ -328,10 +325,6 @@ namespace OpenSim.Region.Physics.Meshing //System.Console.WriteLine("Extruder: radius: " + radius.ToString() + " radiusScale: " + radiusScale.ToString()); - - - - float twist = twistBot + (twistTotal * (float)percentOfPath); float zOffset = (float)(System.Math.Sin(angle) * (0.5f - yPathScale)) * radiusScale; @@ -404,13 +397,6 @@ namespace OpenSim.Region.Physics.Meshing } lastLayer = newLayer; - - - - - - - // calc next angle if (angle >= endAngle) @@ -421,10 +407,7 @@ namespace OpenSim.Region.Physics.Meshing if (angle > endAngle) angle = endAngle; } - } - while (!done); - - + } while (!done); // scale the mesh to the desired size float xScale = size.X; @@ -432,12 +415,14 @@ namespace OpenSim.Region.Physics.Meshing float zScale = size.Z; foreach (Vertex v in result.vertices) + { if (v != null) { v.X *= xScale; v.Y *= yScale; v.Z *= zScale; } + } return result; } 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 holeHull.AddVertex(IPM); } //if (hshape == HollowShape.Circle && pbs.PathCurve == (byte)Extrusion.Straight) - if ( hshape == HollowShape.Circle ) + if (hshape == HollowShape.Circle) { float hollowFactorF = (float)fhollowFactor / (float)50000; @@ -1346,7 +1346,7 @@ namespace OpenSim.Region.Physics.Meshing // || (primShape.ProfileCurve & 0x07) == (byte) ProfileShape.Square) { //Console.WriteLine("Meshmerizer thinks " + primName + " is a TORUS"); - if ( hollowShape == HollowShape.Same ) + if (hollowShape == HollowShape.Same) hollowShape = HollowShape.Circle; // build the profile shape @@ -1381,7 +1381,7 @@ namespace OpenSim.Region.Physics.Meshing else if ((primShape.ProfileCurve & 0x07) == (byte)ProfileShape.Square) // a ring { //Console.WriteLine("Meshmerizer thinks " + primName + " is a TUBE"); - if ( hollowShape == HollowShape.Same ) + if (hollowShape == HollowShape.Same) hollowShape = HollowShape.Square; outerHull.AddVertex(new Vertex(+0.5f, +0.5f, 0.0f)); @@ -1393,7 +1393,7 @@ namespace OpenSim.Region.Physics.Meshing else if ((primShape.ProfileCurve & 0x07) == (byte)ProfileShape.EquilateralTriangle) { //Console.WriteLine("Meshmerizer thinks " + primName + " is a RING"); - if ( hollowShape == HollowShape.Same ) + if (hollowShape == HollowShape.Same) hollowShape = HollowShape.Triangle; outerHull.AddVertex(new Vertex(+0.255f, -0.375f, 0.0f)); -- cgit v1.1