partially revert commit f29d5ad662387b97d9e881f28df584dc19fa8c07: if mesh asset does not contain data for PRIM type warn and use convex, do avoid physical peims going underground etc

melanie
UbitUmarov 2016-11-07 18:34:45 +00:00
parent 07893ec3e7
commit 7ebc08ad65
1 changed files with 145 additions and 139 deletions

View File

@ -395,6 +395,10 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing
{
// m_log.DebugFormat("[MESH]: experimental mesh proxy generation for {0}", primName);
// for ubOde we have a diferent mesh use priority
// priority is to use full mesh then decomposition
// SL does the oposite
bool usemesh = false;
coords = new List<Coord>();
@ -443,17 +447,11 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing
if (physicsParms != null)
usemesh = true;
else
{
m_log.WarnFormat("[MESH]: Data for PRIM shape type not found for prim {0}",primName);
return false;
}
}
if(!usemesh && (map.ContainsKey("physics_convex")))
physicsParms = (OSDMap)map["physics_convex"];
if (physicsParms == null)
{
m_log.WarnFormat("[MESH]: unknown mesh type for prim {0}",primName);
@ -555,7 +553,10 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing
range = range - min;
range *= invMaxU16;
if (!convex && cmap.ContainsKey("HullList") && cmap.ContainsKey("Positions"))
if(!convex)
{
// if mesh data not present and not convex then we need convex decomposition data
if (cmap.ContainsKey("HullList") && cmap.ContainsKey("Positions"))
{
List<int> hsizes = new List<int>();
int totalpoints = 0;
@ -624,7 +625,7 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing
vs.Clear();
continue;
}
/*
/*
if (!HullUtils.ComputeHull(vs, ref hullr, 0, 0.0f))
{
vs.Clear();
@ -662,7 +663,7 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing
f = new Face(vertsoffset + t1, vertsoffset + t2, vertsoffset + t3);
faces.Add(f);
}
*/
*/
List<int> indices;
if (!HullUtils.ComputeHull(vs, out indices))
{
@ -708,7 +709,12 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing
if (coords.Count > 0 && faces.Count > 0)
return true;
}
else
{
// if neither mesh or decomposition present, warn and use convex
m_log.WarnFormat("[MESH]: Data for PRIM shape type ( mesh or decomposition) not found for prim {0}",primName);
}
}
vs.Clear();
if (cmap.ContainsKey("BoundingVerts"))