return;
}
private PrimMesh GeneratePrimMesh(Primitive prim, DetailLevel lod, boolean viewerMode)
{
ConstructionData primData = prim.PrimData;
int sides = 4;
int hollowsides = 4;
float profileBegin = primData.ProfileBegin;
float profileEnd = primData.ProfileEnd;
if (ProfileCurve.get((byte)(primData.profileCurve & 0x07)) == ProfileCurve.Circle)
{
switch (lod)
{
case Low:
sides = 6;
break;
case Medium:
sides = 12;
break;
default:
sides = 24;
break;
}
}
else if (ProfileCurve.get((byte)(primData.profileCurve & 0x07)) == ProfileCurve.EqualTriangle)
sides = 3;
else if (ProfileCurve.get((byte)(primData.profileCurve & 0x07)) == ProfileCurve.HalfCircle)
{
// half circle, prim is a sphere
switch (lod)
{
case Low:
sides = 6;
break;
case Medium:
sides = 12;
break;
default:
sides = 24;
break;
}
profileBegin = 0.5f * profileBegin + 0.5f;
profileEnd = 0.5f * profileEnd + 0.5f;
}
if ((HoleType)primData.getProfileHole() == HoleType.Same)
hollowsides = sides;
else if ((HoleType)primData.getProfileHole() == HoleType.Circle)
{
switch (lod)
{
case Low:
hollowsides = 6;
break;
case Medium:
hollowsides = 12;
break;
default:
hollowsides = 24;
break;
}
}
else if ((HoleType)primData.getProfileHole() == HoleType.Triangle)
hollowsides = 3;
PrimMesh newPrim = new PrimMesh(sides, profileBegin, profileEnd, (float)primData.ProfileHollow, hollowsides);
newPrim.viewerMode = viewerMode;
newPrim.holeSizeX = primData.PathScaleX;