let meshs work indenpendently of mesh_sculpted_prim config option

avinationmerge
UbitUmarov 2012-05-28 14:32:16 +01:00
parent 5141f4075f
commit 60cebe9a5b
1 changed files with 25 additions and 29 deletions

View File

@ -1675,41 +1675,43 @@ namespace OpenSim.Region.Physics.OdePlugin
/// <returns></returns> /// <returns></returns>
public bool needsMeshing(PrimitiveBaseShape pbs) public bool needsMeshing(PrimitiveBaseShape pbs)
{ {
// most of this is redundant now as the mesher will return null if it cant mesh a prim
// but we still need to check for sculptie meshing being enabled so this is the most
// convenient place to do it for now...
// //if (pbs.PathCurve == (byte)Primitive.PathCurve.Circle && pbs.ProfileCurve == (byte)Primitive.ProfileCurve.Circle && pbs.PathScaleY <= 0.75f)
// //m_log.Debug("needsMeshing: " + " pathCurve: " + pbs.PathCurve.ToString() + " profileCurve: " + pbs.ProfileCurve.ToString() + " pathScaleY: " + Primitive.UnpackPathScale(pbs.PathScaleY).ToString());
int iPropertiesNotSupportedDefault = 0;
// check sculpts or meshs
if (pbs.SculptEntry) if (pbs.SculptEntry)
{ {
if(!meshSculptedPrim) if (pbs.SculptType == (byte)SculptType.Mesh) // always do meshs
return true;
if (!meshSculptedPrim)
return false; return false;
else
return true;
} }
int iPropertiesNotSupportedDefault = 0;
if (forceSimplePrimMeshing)
return true;
// if it's a standard box or sphere with no cuts, hollows, twist or top shear, return false since ODE can use an internal representation for the prim // if it's a standard box or sphere with no cuts, hollows, twist or top shear, return false since ODE can use an internal representation for the prim
if (!forceSimplePrimMeshing && !pbs.SculptEntry)
{ if ((pbs.ProfileShape == ProfileShape.Square && pbs.PathCurve == (byte)Extrusion.Straight)
if ((pbs.ProfileShape == ProfileShape.Square && pbs.PathCurve == (byte)Extrusion.Straight)
|| (pbs.ProfileShape == ProfileShape.HalfCircle && pbs.PathCurve == (byte)Extrusion.Curve1 || (pbs.ProfileShape == ProfileShape.HalfCircle && pbs.PathCurve == (byte)Extrusion.Curve1
&& pbs.Scale.X == pbs.Scale.Y && pbs.Scale.Y == pbs.Scale.Z)) && pbs.Scale.X == pbs.Scale.Y && pbs.Scale.Y == pbs.Scale.Z))
{ {
if (pbs.ProfileBegin == 0 && pbs.ProfileEnd == 0 if (pbs.ProfileBegin == 0 && pbs.ProfileEnd == 0
&& pbs.ProfileHollow == 0 && pbs.ProfileHollow == 0
&& pbs.PathTwist == 0 && pbs.PathTwistBegin == 0 && pbs.PathTwist == 0 && pbs.PathTwistBegin == 0
&& pbs.PathBegin == 0 && pbs.PathEnd == 0 && pbs.PathBegin == 0 && pbs.PathEnd == 0
&& pbs.PathTaperX == 0 && pbs.PathTaperY == 0 && pbs.PathTaperX == 0 && pbs.PathTaperY == 0
&& pbs.PathScaleX == 100 && pbs.PathScaleY == 100 && pbs.PathScaleX == 100 && pbs.PathScaleY == 100
&& pbs.PathShearX == 0 && pbs.PathShearY == 0) && pbs.PathShearX == 0 && pbs.PathShearY == 0)
{ {
#if SPAM #if SPAM
m_log.Warn("NonMesh"); m_log.Warn("NonMesh");
#endif #endif
return false; return false;
}
} }
} }
@ -1717,9 +1719,6 @@ namespace OpenSim.Region.Physics.OdePlugin
// and it's odd.. so for now just return true if asked to force meshs // and it's odd.. so for now just return true if asked to force meshs
// hopefully mesher will fail if doesn't suport so things still get basic boxes // hopefully mesher will fail if doesn't suport so things still get basic boxes
if (forceSimplePrimMeshing)
return true;
if (pbs.ProfileHollow != 0) if (pbs.ProfileHollow != 0)
iPropertiesNotSupportedDefault++; iPropertiesNotSupportedDefault++;
@ -1787,9 +1786,6 @@ namespace OpenSim.Region.Physics.OdePlugin
} }
} }
if (pbs.SculptEntry && meshSculptedPrim)
iPropertiesNotSupportedDefault++;
if (iPropertiesNotSupportedDefault == 0) if (iPropertiesNotSupportedDefault == 0)
{ {
#if SPAM #if SPAM