Corrects errors in sphere mesh with dimple start angle > 0 and hollow == 0

0.6.0-stable
Dahlia Trimble 2008-07-06 17:18:59 +00:00
parent ca97dda603
commit ae468bfc9b
1 changed files with 2 additions and 2 deletions

View File

@ -1582,14 +1582,14 @@ namespace OpenSim.Region.Physics.Meshing
if ((primShape.ProfileCurve & 0x07) == (byte)ProfileShape.HalfCircle) if ((primShape.ProfileCurve & 0x07) == (byte)ProfileShape.HalfCircle)
{ // dimpled sphere uses profile cut but since it's a half circle the angles are smaller { // dimpled sphere uses profile cut but since it's a half circle the angles are smaller
if (hollowFactor == 0) hollowFactor = 1000; // bare minimum hollow to keep the triangulator happy
fProfileBeginAngle = 0.0036f * (float)primShape.ProfileBegin; fProfileBeginAngle = 0.0036f * (float)primShape.ProfileBegin;
fProfileEndAngle = 180.0f - 0.0036f * (float)primShape.ProfileEnd; fProfileEndAngle = 180.0f - 0.0036f * (float)primShape.ProfileEnd;
if (fProfileBeginAngle < fProfileEndAngle) if (fProfileBeginAngle < fProfileEndAngle)
fProfileEndAngle -= 360.0f; fProfileEndAngle -= 360.0f;
// a cut starting at 0 degrees with a hollow causes an infinite loop so move the start angle // a cut starting at 0 degrees with a hollow causes an infinite loop so move the start angle
// past it into the empty part of the circle to avoid this condition // past it into the empty part of the circle to avoid this condition
if (fProfileBeginAngle == 0.0f) fProfileBeginAngle = -10.0f; if (fProfileBeginAngle == 0.0f && hollowFactor != 0) fProfileBeginAngle = -10.0f;
#if SPAM #if SPAM
Console.WriteLine("Sphere dimple: fProfileBeginAngle: " + fProfileBeginAngle.ToString() + " fProfileEndAngle: " + fProfileEndAngle.ToString()); Console.WriteLine("Sphere dimple: fProfileBeginAngle: " + fProfileBeginAngle.ToString() + " fProfileEndAngle: " + fProfileEndAngle.ToString());