aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
diff options
context:
space:
mode:
authorDahlia Trimble2008-10-13 22:52:39 +0000
committerDahlia Trimble2008-10-13 22:52:39 +0000
commit138a3924e0de5358e73993430ff4c47f5f098667 (patch)
treeaa2e167042907169ccda3075717962326449cc74 /OpenSim/Region/Physics/Meshing/Meshmerizer.cs
parent* ODE.NET Update. No user exposed stuff.... just wrote wrapper routines f... (diff)
downloadopensim-SC_OLD-138a3924e0de5358e73993430ff4c47f5f098667.zip
opensim-SC_OLD-138a3924e0de5358e73993430ff4c47f5f098667.tar.gz
opensim-SC_OLD-138a3924e0de5358e73993430ff4c47f5f098667.tar.bz2
opensim-SC_OLD-138a3924e0de5358e73993430ff4c47f5f098667.tar.xz
Committing more work towards implementing vertex normals. Also added some (hopefully) helpful messages for identifying corrupt prims and some fixup code for corrupt profile cut data.
Diffstat (limited to 'OpenSim/Region/Physics/Meshing/Meshmerizer.cs')
-rw-r--r--OpenSim/Region/Physics/Meshing/Meshmerizer.cs30
1 files changed, 24 insertions, 6 deletions
diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
index 3ca7786..6955aa0 100644
--- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
+++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
@@ -1626,6 +1626,14 @@ namespace OpenSim.Region.Physics.Meshing
1626 } 1626 }
1627 } 1627 }
1628 1628
1629 private void ReportPrimError(string message, string primName, PrimMesh primMesh)
1630 {
1631 Console.WriteLine(message);
1632 Console.WriteLine("\nPrim Name: " + primName);
1633 Console.WriteLine("****** PrimMesh Parameters (Linear) ******\n" + primMesh.ParamsToDisplayString());
1634
1635 }
1636
1629 public Mesh CreateMeshFromPrimMesher(string primName, PrimitiveBaseShape primShape, PhysicsVector size, float lod) 1637 public Mesh CreateMeshFromPrimMesher(string primName, PrimitiveBaseShape primShape, PhysicsVector size, float lod)
1630 { 1638 {
1631 Mesh mesh = new Mesh(); 1639 Mesh mesh = new Mesh();
@@ -1676,6 +1684,13 @@ namespace OpenSim.Region.Physics.Meshing
1676 primMesh.twistEnd = primShape.PathTwist * 18 / 10; 1684 primMesh.twistEnd = primShape.PathTwist * 18 / 10;
1677 primMesh.taperX = pathScaleX; 1685 primMesh.taperX = pathScaleX;
1678 primMesh.taperY = pathScaleY; 1686 primMesh.taperY = pathScaleY;
1687
1688 if (profileBegin < 0.0f || profileBegin >= profileEnd || profileEnd > 1.0f)
1689 {
1690 ReportPrimError("*** CORRUPT PRIM!! ***", primName, primMesh);
1691 if (profileBegin < 0.0f) profileBegin = 0.0f;
1692 if (profileEnd > 1.0f) profileEnd = 1.0f;
1693 }
1679#if SPAM 1694#if SPAM
1680 Console.WriteLine("****** PrimMesh Parameters (Linear) ******\n" + primMesh.ParamsToDisplayString()); 1695 Console.WriteLine("****** PrimMesh Parameters (Linear) ******\n" + primMesh.ParamsToDisplayString());
1681#endif 1696#endif
@@ -1685,9 +1700,7 @@ namespace OpenSim.Region.Physics.Meshing
1685 } 1700 }
1686 catch (Exception ex) 1701 catch (Exception ex)
1687 { 1702 {
1688 Console.WriteLine("Extrusion failure: exception: " + ex.ToString()); 1703 ReportPrimError("Extrusion failure: exception: " + ex.ToString(), primName, primMesh);
1689 Console.WriteLine("\n Prim Name: " + primName);
1690 Console.WriteLine("****** PrimMesh Parameters (Linear) ******\n" + primMesh.ParamsToDisplayString());
1691 return null; 1704 return null;
1692 } 1705 }
1693 } 1706 }
@@ -1702,6 +1715,13 @@ namespace OpenSim.Region.Physics.Meshing
1702 primMesh.twistEnd = primShape.PathTwist * 36 / 10; 1715 primMesh.twistEnd = primShape.PathTwist * 36 / 10;
1703 primMesh.taperX = primShape.PathTaperX * 0.01f; 1716 primMesh.taperX = primShape.PathTaperX * 0.01f;
1704 primMesh.taperY = primShape.PathTaperY * 0.01f; 1717 primMesh.taperY = primShape.PathTaperY * 0.01f;
1718
1719 if (profileBegin < 0.0f || profileBegin >= profileEnd || profileEnd > 1.0f)
1720 {
1721 ReportPrimError("*** CORRUPT PRIM!! ***", primName, primMesh);
1722 if (profileBegin < 0.0f) profileBegin = 0.0f;
1723 if (profileEnd > 1.0f) profileEnd = 1.0f;
1724 }
1705#if SPAM 1725#if SPAM
1706 Console.WriteLine("****** PrimMesh Parameters (Circular) ******\n" + primMesh.ParamsToDisplayString()); 1726 Console.WriteLine("****** PrimMesh Parameters (Circular) ******\n" + primMesh.ParamsToDisplayString());
1707#endif 1727#endif
@@ -1711,9 +1731,7 @@ namespace OpenSim.Region.Physics.Meshing
1711 } 1731 }
1712 catch (Exception ex) 1732 catch (Exception ex)
1713 { 1733 {
1714 Console.WriteLine("Extrusion failure: exception: " + ex.ToString()); 1734 ReportPrimError("Extrusion failure: exception: " + ex.ToString(), primName, primMesh);
1715 Console.WriteLine("\n Prim Name: " + primName);
1716 Console.WriteLine("****** PrimMesh Parameters (Circular) ******\n" + primMesh.ParamsToDisplayString());
1717 return null; 1735 return null;
1718 } 1736 }
1719 } 1737 }