* Patch from Dahlia - 0001576: Exception of type 'System.OutOfMemoryException' was thrown .Void set_Capacity(Int32), with regards to sphere mesh. Thanks Dahlia!

* Also allows a sphere to be hollow with no cuts or dimples. (walking around inside the sphere).
0.6.0-stable
Teravus Ovares 2008-06-19 17:21:17 +00:00
parent f69f696181
commit 1d91613679
1 changed files with 4 additions and 0 deletions

View File

@ -1500,6 +1500,7 @@ namespace OpenSim.Region.Physics.Meshing
&& primShape.PathTwistBegin == 0
&& primShape.ProfileBegin == 0
&& primShape.ProfileEnd == 0
&& primShape.ProfileHollow == 0
) // simple sphere, revert to geodesic shape
)
@ -1547,6 +1548,9 @@ namespace OpenSim.Region.Physics.Meshing
fProfileEndAngle = 180.0f - 0.0036f * (float)primShape.ProfileEnd;
if (fProfileBeginAngle < fProfileEndAngle)
fProfileEndAngle -= 360.0f;
// 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
if (fProfileBeginAngle == 0.0f) fProfileBeginAngle = -10.0f;
#if SPAM
Console.WriteLine("Sphere dimple: fProfileBeginAngle: " + fProfileBeginAngle.ToString() + " fProfileEndAngle: " + fProfileEndAngle.ToString());