From bc66a851d6628b6997a1a9dd95cb18facd0054dc Mon Sep 17 00:00:00 2001 From: Dahlia Trimble Date: Wed, 25 Jun 2008 07:17:36 +0000 Subject: [PATCH] Modifies box prim profile cut parameters to avoid angles which cause spurious triangles in mesh --- OpenSim/Region/Physics/Meshing/Meshmerizer.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs index c9be614f07..72c5d7f46e 100644 --- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs +++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs @@ -475,9 +475,20 @@ namespace OpenSim.Region.Physics.Meshing fProfileBeginAngle -= (90.0 + 45.0); // for some reasons, the SL client counts from the corner -X/-Y double fProfileEndAngle = 360.0 - profileEnd/50000.0*360.0; // Pathend comes as complement to 1.0 fProfileEndAngle -= (90.0 + 45.0); + + // avoid some problem angles until the hull subtraction routine is fixed + if ((fProfileBeginAngle + 45.0f) % 90.0f == 0.0f) + fProfileBeginAngle += 5.0f; + if ((fProfileEndAngle + 45.0f) % 90.0f == 0.0f) + fProfileEndAngle -= 5.0f; + if (fProfileBeginAngle < fProfileEndAngle) fProfileEndAngle -= 360.0; +#if SPAM + Console.WriteLine("Meshmerizer: fProfileBeginAngle: " + fProfileBeginAngle.ToString() + " fProfileEndAngle: " + fProfileEndAngle.ToString()); +#endif + // Note, that we don't want to cut out a triangle, even if this is a // good approximation for small cuts. Indeed we want to cut out an arc // and we approximate this arc by a polygon chain