detect a fully degenerated mesh and avoid using it and so crashing ubOde
parent
af5ea18f33
commit
3d8384b696
|
@ -278,6 +278,16 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing
|
|||
return new Vector3(x, y, z);
|
||||
}
|
||||
|
||||
public int numberVertices()
|
||||
{
|
||||
return m_bdata.m_vertices.Count;
|
||||
}
|
||||
|
||||
public int numberTriangles()
|
||||
{
|
||||
return m_bdata.m_triangles.Count;
|
||||
}
|
||||
|
||||
public List<Vector3> getVertexList()
|
||||
{
|
||||
List<Vector3> result = new List<Vector3>();
|
||||
|
|
|
@ -337,7 +337,6 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing
|
|||
return null;
|
||||
}
|
||||
|
||||
primShape.SculptData = Utils.EmptyBytes;
|
||||
|
||||
int numCoords = coords.Count;
|
||||
int numFaces = faces.Count;
|
||||
|
@ -355,6 +354,14 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing
|
|||
coords.Clear();
|
||||
faces.Clear();
|
||||
|
||||
if(mesh.numberVertices() < 3 || mesh.numberTriangles() < 1)
|
||||
{
|
||||
m_log.ErrorFormat("[MESH]: invalid degenerated mesh for prim " + primName + " ignored");
|
||||
return null;
|
||||
}
|
||||
|
||||
primShape.SculptData = Utils.EmptyBytes;
|
||||
|
||||
return mesh;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue