diff options
author | Jeff Ames | 2008-02-20 18:38:20 +0000 |
---|---|---|
committer | Jeff Ames | 2008-02-20 18:38:20 +0000 |
commit | a8cfbbe963529728acbab4d9936cb89af380d1ac (patch) | |
tree | 16a72fba3d15556f6702127e7cfb98aa9fb9cf81 /OpenSim/Region/Physics/Meshing | |
parent | Fix exception when reading OpenSim.ini file. (diff) | |
download | opensim-SC_OLD-a8cfbbe963529728acbab4d9936cb89af380d1ac.zip opensim-SC_OLD-a8cfbbe963529728acbab4d9936cb89af380d1ac.tar.gz opensim-SC_OLD-a8cfbbe963529728acbab4d9936cb89af380d1ac.tar.bz2 opensim-SC_OLD-a8cfbbe963529728acbab4d9936cb89af380d1ac.tar.xz |
Minor cleanup.
Diffstat (limited to 'OpenSim/Region/Physics/Meshing')
-rw-r--r-- | OpenSim/Region/Physics/Meshing/HelperTypes.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Physics/Meshing/Meshmerizer.cs | 22 | ||||
-rw-r--r-- | OpenSim/Region/Physics/Meshing/SimpleHull.cs | 10 |
3 files changed, 10 insertions, 24 deletions
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 @@ | |||
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * 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 @@ | |||
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
@@ -53,7 +53,7 @@ namespace OpenSim.Region.Physics.Meshing | |||
53 | 53 | ||
54 | public class Meshmerizer : IMesher | 54 | public class Meshmerizer : IMesher |
55 | { | 55 | { |
56 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | 56 | //private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); |
57 | 57 | ||
58 | // Setting baseDir to a path will enable the dumping of raw files | 58 | // Setting baseDir to a path will enable the dumping of raw files |
59 | // raw files can be imported by blender so a visual inspection of the results can be done | 59 | // 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 | |||
530 | } | 530 | } |
531 | } | 531 | } |
532 | 532 | ||
533 | |||
534 | |||
535 | Mesh result = extr.Extrude(m); | 533 | Mesh result = extr.Extrude(m); |
536 | result.DumpRaw(baseDir, primName, "Z extruded"); | 534 | result.DumpRaw(baseDir, primName, "Z extruded"); |
537 | return result; | 535 | return result; |
538 | } | 536 | } |
537 | |||
539 | private static Mesh CreateCyllinderMesh(String primName, PrimitiveBaseShape primShape, PhysicsVector size) | 538 | private static Mesh CreateCyllinderMesh(String primName, PrimitiveBaseShape primShape, PhysicsVector size) |
540 | // Builds the z (+ and -) surfaces of a box shaped prim | 539 | // Builds the z (+ and -) surfaces of a box shaped prim |
541 | { | 540 | { |
@@ -601,7 +600,6 @@ namespace OpenSim.Region.Physics.Meshing | |||
601 | Vertex Q1Q13 = new Vertex(-0.43f, -0.24f, 0.0f); | 600 | Vertex Q1Q13 = new Vertex(-0.43f, -0.24f, 0.0f); |
602 | Vertex Q1Q14 = new Vertex(-0.40f, -0.30f, 0.0f); | 601 | Vertex Q1Q14 = new Vertex(-0.40f, -0.30f, 0.0f); |
603 | 602 | ||
604 | |||
605 | SimpleHull outerHull = new SimpleHull(); | 603 | SimpleHull outerHull = new SimpleHull(); |
606 | //Clockwise around the quadrants | 604 | //Clockwise around the quadrants |
607 | outerHull.AddVertex(Q1Q15); | 605 | outerHull.AddVertex(Q1Q15); |
@@ -684,7 +682,7 @@ namespace OpenSim.Region.Physics.Meshing | |||
684 | // Calculated separately to avoid errors | 682 | // Calculated separately to avoid errors |
685 | cutHull.AddVertex(legEnd); | 683 | cutHull.AddVertex(legEnd); |
686 | 684 | ||
687 | // m_log.DebugFormat("Starting cutting of the hollow shape from the prim {1}", 0, primName); | 685 | // m_log.DebugFormat("Starting cutting of the hollow shape from the prim {1}", 0, primName); |
688 | SimpleHull cuttedHull = SimpleHull.SubtractHull(outerHull, cutHull); | 686 | SimpleHull cuttedHull = SimpleHull.SubtractHull(outerHull, cutHull); |
689 | 687 | ||
690 | outerHull = cuttedHull; | 688 | outerHull = cuttedHull; |
@@ -693,7 +691,6 @@ namespace OpenSim.Region.Physics.Meshing | |||
693 | // Deal with the hole here | 691 | // Deal with the hole here |
694 | if (hollowFactor > 0) | 692 | if (hollowFactor > 0) |
695 | { | 693 | { |
696 | |||
697 | SimpleHull holeHull = BuildHoleHull(primShape, primShape.ProfileShape, primShape.HollowShape, hollowFactor); | 694 | SimpleHull holeHull = BuildHoleHull(primShape, primShape.ProfileShape, primShape.HollowShape, hollowFactor); |
698 | if (holeHull != null) | 695 | if (holeHull != null) |
699 | { | 696 | { |
@@ -799,10 +796,8 @@ namespace OpenSim.Region.Physics.Meshing | |||
799 | Mesh result = extr.Extrude(m); | 796 | Mesh result = extr.Extrude(m); |
800 | result.DumpRaw(baseDir, primName, "Z extruded"); | 797 | result.DumpRaw(baseDir, primName, "Z extruded"); |
801 | return result; | 798 | return result; |
802 | |||
803 | } | 799 | } |
804 | 800 | ||
805 | |||
806 | private static Mesh CreatePrismMesh(String primName, PrimitiveBaseShape primShape, PhysicsVector size) | 801 | private static Mesh CreatePrismMesh(String primName, PrimitiveBaseShape primShape, PhysicsVector size) |
807 | // Builds the z (+ and -) surfaces of a box shaped prim | 802 | // Builds the z (+ and -) surfaces of a box shaped prim |
808 | { | 803 | { |
@@ -837,7 +832,6 @@ namespace OpenSim.Region.Physics.Meshing | |||
837 | outerHull.AddVertex(PM); | 832 | outerHull.AddVertex(PM); |
838 | outerHull.AddVertex(PP); | 833 | outerHull.AddVertex(PP); |
839 | 834 | ||
840 | |||
841 | // Deal with cuts now | 835 | // Deal with cuts now |
842 | if ((profileBegin != 0) || (profileEnd != 0)) | 836 | if ((profileBegin != 0) || (profileEnd != 0)) |
843 | { | 837 | { |
@@ -882,8 +876,6 @@ namespace OpenSim.Region.Physics.Meshing | |||
882 | // Deal with the hole here | 876 | // Deal with the hole here |
883 | if (hollowFactor > 0) | 877 | if (hollowFactor > 0) |
884 | { | 878 | { |
885 | |||
886 | |||
887 | SimpleHull holeHull = BuildHoleHull(primShape, primShape.ProfileShape, primShape.HollowShape, hollowFactor); | 879 | SimpleHull holeHull = BuildHoleHull(primShape, primShape.ProfileShape, primShape.HollowShape, hollowFactor); |
888 | if (holeHull != null) | 880 | if (holeHull != null) |
889 | { | 881 | { |
@@ -940,7 +932,6 @@ namespace OpenSim.Region.Physics.Meshing | |||
940 | extr.taperBotFactorX = 1.0f - ((100 - (float)taperX) / 100); | 932 | extr.taperBotFactorX = 1.0f - ((100 - (float)taperX) / 100); |
941 | //m_log.Warn("taperBotFactorX: " + extr.taperBotFactorX.ToString()); | 933 | //m_log.Warn("taperBotFactorX: " + extr.taperBotFactorX.ToString()); |
942 | } | 934 | } |
943 | |||
944 | } | 935 | } |
945 | 936 | ||
946 | if (taperY != 100) | 937 | if (taperY != 100) |
@@ -957,7 +948,6 @@ namespace OpenSim.Region.Physics.Meshing | |||
957 | } | 948 | } |
958 | } | 949 | } |
959 | 950 | ||
960 | |||
961 | if (pathShearX != 0) | 951 | if (pathShearX != 0) |
962 | { | 952 | { |
963 | if (pathShearX > 50) | 953 | if (pathShearX > 50) |
@@ -988,8 +978,6 @@ namespace OpenSim.Region.Physics.Meshing | |||
988 | } | 978 | } |
989 | } | 979 | } |
990 | 980 | ||
991 | |||
992 | |||
993 | Mesh result = extr.Extrude(m); | 981 | Mesh result = extr.Extrude(m); |
994 | result.DumpRaw(baseDir, primName, "Z extruded"); | 982 | result.DumpRaw(baseDir, primName, "Z extruded"); |
995 | return result; | 983 | return result; |
@@ -1090,4 +1078,4 @@ namespace OpenSim.Region.Physics.Meshing | |||
1090 | return mesh; | 1078 | return mesh; |
1091 | } | 1079 | } |
1092 | } | 1080 | } |
1093 | } \ No newline at end of file | 1081 | } |
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 | |||
42 | // is defined by the hull lies inside or outside the simplex chain | 42 | // is defined by the hull lies inside or outside the simplex chain |
43 | public class SimpleHull | 43 | public class SimpleHull |
44 | { | 44 | { |
45 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | 45 | //private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); |
46 | 46 | ||
47 | private List<Vertex> vertices = new List<Vertex>(); | 47 | private List<Vertex> vertices = new List<Vertex>(); |
48 | private List<Vertex> holeVertices = new List<Vertex>(); // Only used, when the hull is hollow | 48 | private List<Vertex> holeVertices = new List<Vertex>(); // Only used, when the hull is hollow |
@@ -228,8 +228,8 @@ namespace OpenSim.Region.Physics.Meshing | |||
228 | distToV1 = distTemp; | 228 | distToV1 = distTemp; |
229 | bestIntersectingSimplex = sTest; | 229 | bestIntersectingSimplex = sTest; |
230 | } | 230 | } |
231 | } // end if vTemp | 231 | } |
232 | } // end foreach | 232 | } |
233 | 233 | ||
234 | Intersection = bestIntersection; | 234 | Intersection = bestIntersection; |
235 | if (bestIntersectingSimplex != null) | 235 | if (bestIntersectingSimplex != null) |
@@ -308,7 +308,6 @@ namespace OpenSim.Region.Physics.Meshing | |||
308 | //m_log.Debug("State after intersection detection for the base hull"); | 308 | //m_log.Debug("State after intersection detection for the base hull"); |
309 | //m_log.DebugFormat("The otherHull is:\n{1}", 0, otherHullClone.ToString()); | 309 | //m_log.DebugFormat("The otherHull is:\n{1}", 0, otherHullClone.ToString()); |
310 | 310 | ||
311 | |||
312 | bool otherIsInBase = baseHullClone.containsPointsFrom(otherHullClone); | 311 | bool otherIsInBase = baseHullClone.containsPointsFrom(otherHullClone); |
313 | if (!intersects && otherIsInBase) | 312 | if (!intersects && otherIsInBase) |
314 | { | 313 | { |
@@ -317,7 +316,6 @@ namespace OpenSim.Region.Physics.Meshing | |||
317 | return baseHullClone; | 316 | return baseHullClone; |
318 | } | 317 | } |
319 | 318 | ||
320 | |||
321 | SimpleHull result = new SimpleHull(); | 319 | SimpleHull result = new SimpleHull(); |
322 | 320 | ||
323 | // Find a good starting Simplex from baseHull | 321 | // Find a good starting Simplex from baseHull |
@@ -394,4 +392,4 @@ namespace OpenSim.Region.Physics.Meshing | |||
394 | return result; | 392 | return result; |
395 | } | 393 | } |
396 | } | 394 | } |
397 | } \ No newline at end of file | 395 | } |