From a8cfbbe963529728acbab4d9936cb89af380d1ac Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Wed, 20 Feb 2008 18:38:20 +0000 Subject: Minor cleanup. --- OpenSim/Region/Physics/Meshing/HelperTypes.cs | 2 +- OpenSim/Region/Physics/Meshing/Meshmerizer.cs | 22 +++++----------------- OpenSim/Region/Physics/Meshing/SimpleHull.cs | 10 ++++------ 3 files changed, 10 insertions(+), 24 deletions(-) (limited to 'OpenSim/Region/Physics/Meshing') diff --git a/OpenSim/Region/Physics/Meshing/HelperTypes.cs b/OpenSim/Region/Physics/Meshing/HelperTypes.cs index ac06614..bcc2c37 100644 --- a/OpenSim/Region/Physics/Meshing/HelperTypes.cs +++ b/OpenSim/Region/Physics/Meshing/HelperTypes.cs @@ -13,7 +13,7 @@ * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * -* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY +* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs index ec13564..30fab39 100644 --- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs +++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs @@ -13,7 +13,7 @@ * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * -* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY +* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY @@ -53,7 +53,7 @@ namespace OpenSim.Region.Physics.Meshing public class Meshmerizer : IMesher { - private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); + //private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); // Setting baseDir to a path will enable the dumping of raw files // raw files can be imported by blender so a visual inspection of the results can be done @@ -530,12 +530,11 @@ namespace OpenSim.Region.Physics.Meshing } } - - Mesh result = extr.Extrude(m); result.DumpRaw(baseDir, primName, "Z extruded"); return result; } + private static Mesh CreateCyllinderMesh(String primName, PrimitiveBaseShape primShape, PhysicsVector size) // Builds the z (+ and -) surfaces of a box shaped prim { @@ -601,7 +600,6 @@ namespace OpenSim.Region.Physics.Meshing Vertex Q1Q13 = new Vertex(-0.43f, -0.24f, 0.0f); Vertex Q1Q14 = new Vertex(-0.40f, -0.30f, 0.0f); - SimpleHull outerHull = new SimpleHull(); //Clockwise around the quadrants outerHull.AddVertex(Q1Q15); @@ -684,7 +682,7 @@ namespace OpenSim.Region.Physics.Meshing // Calculated separately to avoid errors cutHull.AddVertex(legEnd); - // m_log.DebugFormat("Starting cutting of the hollow shape from the prim {1}", 0, primName); + // m_log.DebugFormat("Starting cutting of the hollow shape from the prim {1}", 0, primName); SimpleHull cuttedHull = SimpleHull.SubtractHull(outerHull, cutHull); outerHull = cuttedHull; @@ -693,7 +691,6 @@ namespace OpenSim.Region.Physics.Meshing // Deal with the hole here if (hollowFactor > 0) { - SimpleHull holeHull = BuildHoleHull(primShape, primShape.ProfileShape, primShape.HollowShape, hollowFactor); if (holeHull != null) { @@ -799,10 +796,8 @@ namespace OpenSim.Region.Physics.Meshing Mesh result = extr.Extrude(m); result.DumpRaw(baseDir, primName, "Z extruded"); return result; - } - private static Mesh CreatePrismMesh(String primName, PrimitiveBaseShape primShape, PhysicsVector size) // Builds the z (+ and -) surfaces of a box shaped prim { @@ -837,7 +832,6 @@ namespace OpenSim.Region.Physics.Meshing outerHull.AddVertex(PM); outerHull.AddVertex(PP); - // Deal with cuts now if ((profileBegin != 0) || (profileEnd != 0)) { @@ -882,8 +876,6 @@ namespace OpenSim.Region.Physics.Meshing // Deal with the hole here if (hollowFactor > 0) { - - SimpleHull holeHull = BuildHoleHull(primShape, primShape.ProfileShape, primShape.HollowShape, hollowFactor); if (holeHull != null) { @@ -940,7 +932,6 @@ namespace OpenSim.Region.Physics.Meshing extr.taperBotFactorX = 1.0f - ((100 - (float)taperX) / 100); //m_log.Warn("taperBotFactorX: " + extr.taperBotFactorX.ToString()); } - } if (taperY != 100) @@ -957,7 +948,6 @@ namespace OpenSim.Region.Physics.Meshing } } - if (pathShearX != 0) { if (pathShearX > 50) @@ -988,8 +978,6 @@ namespace OpenSim.Region.Physics.Meshing } } - - Mesh result = extr.Extrude(m); result.DumpRaw(baseDir, primName, "Z extruded"); return result; @@ -1090,4 +1078,4 @@ namespace OpenSim.Region.Physics.Meshing return mesh; } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Physics/Meshing/SimpleHull.cs b/OpenSim/Region/Physics/Meshing/SimpleHull.cs index 91df98f..58b9a0e 100644 --- a/OpenSim/Region/Physics/Meshing/SimpleHull.cs +++ b/OpenSim/Region/Physics/Meshing/SimpleHull.cs @@ -42,7 +42,7 @@ namespace OpenSim.Region.Physics.Meshing // is defined by the hull lies inside or outside the simplex chain public class SimpleHull { - private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); + //private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); private List vertices = new List(); private List holeVertices = new List(); // Only used, when the hull is hollow @@ -228,8 +228,8 @@ namespace OpenSim.Region.Physics.Meshing distToV1 = distTemp; bestIntersectingSimplex = sTest; } - } // end if vTemp - } // end foreach + } + } Intersection = bestIntersection; if (bestIntersectingSimplex != null) @@ -308,7 +308,6 @@ namespace OpenSim.Region.Physics.Meshing //m_log.Debug("State after intersection detection for the base hull"); //m_log.DebugFormat("The otherHull is:\n{1}", 0, otherHullClone.ToString()); - bool otherIsInBase = baseHullClone.containsPointsFrom(otherHullClone); if (!intersects && otherIsInBase) { @@ -317,7 +316,6 @@ namespace OpenSim.Region.Physics.Meshing return baseHullClone; } - SimpleHull result = new SimpleHull(); // Find a good starting Simplex from baseHull @@ -394,4 +392,4 @@ namespace OpenSim.Region.Physics.Meshing return result; } } -} \ No newline at end of file +} -- cgit v1.1