diff options
Diffstat (limited to 'OpenSim/Region/PhysicsModules')
-rw-r--r-- | OpenSim/Region/PhysicsModules/ubOdeMeshing/Mesh.cs | 10 | ||||
-rw-r--r-- | OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs | 9 |
2 files changed, 18 insertions, 1 deletions
diff --git a/OpenSim/Region/PhysicsModules/ubOdeMeshing/Mesh.cs b/OpenSim/Region/PhysicsModules/ubOdeMeshing/Mesh.cs index da8f623..b860255 100644 --- a/OpenSim/Region/PhysicsModules/ubOdeMeshing/Mesh.cs +++ b/OpenSim/Region/PhysicsModules/ubOdeMeshing/Mesh.cs | |||
@@ -278,6 +278,16 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing | |||
278 | return new Vector3(x, y, z); | 278 | return new Vector3(x, y, z); |
279 | } | 279 | } |
280 | 280 | ||
281 | public int numberVertices() | ||
282 | { | ||
283 | return m_bdata.m_vertices.Count; | ||
284 | } | ||
285 | |||
286 | public int numberTriangles() | ||
287 | { | ||
288 | return m_bdata.m_triangles.Count; | ||
289 | } | ||
290 | |||
281 | public List<Vector3> getVertexList() | 291 | public List<Vector3> getVertexList() |
282 | { | 292 | { |
283 | List<Vector3> result = new List<Vector3>(); | 293 | List<Vector3> result = new List<Vector3>(); |
diff --git a/OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs b/OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs index 84df369..596ce0f 100644 --- a/OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs +++ b/OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs | |||
@@ -337,7 +337,6 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing | |||
337 | return null; | 337 | return null; |
338 | } | 338 | } |
339 | 339 | ||
340 | primShape.SculptData = Utils.EmptyBytes; | ||
341 | 340 | ||
342 | int numCoords = coords.Count; | 341 | int numCoords = coords.Count; |
343 | int numFaces = faces.Count; | 342 | int numFaces = faces.Count; |
@@ -355,6 +354,14 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing | |||
355 | coords.Clear(); | 354 | coords.Clear(); |
356 | faces.Clear(); | 355 | faces.Clear(); |
357 | 356 | ||
357 | if(mesh.numberVertices() < 3 || mesh.numberTriangles() < 1) | ||
358 | { | ||
359 | m_log.ErrorFormat("[MESH]: invalid degenerated mesh for prim " + primName + " ignored"); | ||
360 | return null; | ||
361 | } | ||
362 | |||
363 | primShape.SculptData = Utils.EmptyBytes; | ||
364 | |||
358 | return mesh; | 365 | return mesh; |
359 | } | 366 | } |
360 | 367 | ||