From 4f51cc325c627e9e9c1381e6e813a266968895d4 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 3 Oct 2012 20:36:41 +0100 Subject: making meshworker have more work.. --- .../Region/Physics/UbitOdePlugin/ODEMeshWorker.cs | 24 ++++++++++++++++++---- OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs | 3 +++ 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODEMeshWorker.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODEMeshWorker.cs index 81d59a6..f57149c 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/ODEMeshWorker.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/ODEMeshWorker.cs @@ -5,6 +5,7 @@ using System; using System.Threading; using System.Collections.Generic; +using System.IO; using System.Reflection; using System.Runtime.InteropServices; using System.Text; @@ -177,7 +178,7 @@ namespace OpenSim.Region.Physics.OdePlugin Vector3 size = psize; byte shapetype = pshapetype; - if (needsMeshing(pbs) && (pbs.SculptData.Length > 0)) + if (needsMeshing(pbs)) { bool convex; int clod = (int)LevelOfDetail.High; @@ -189,9 +190,24 @@ namespace OpenSim.Region.Physics.OdePlugin if (pbs.SculptType != (byte)SculptType.Mesh) clod = (int)LevelOfDetail.Low; } - mesh = m_mesher.CreateMesh(actor.Name, pbs, size, clod, true, convex); - if(mesh == null) - mesh = m_mesher.CreateMesh(actor.Name, pbs, size, clod, true, convex); + mesh = m_mesher.GetMesh(actor.Name, pbs, size, clod, true, convex); + if (mesh == null) + { + if (!pbs.SculptEntry) + return m_mesher.CreateMesh(actor.Name, pbs, size, clod, true, convex); + + if (pbs.SculptTexture == UUID.Zero) + return null; + + if(pbs.SculptType != (byte)SculptType.Mesh) + { // check for sculpt decoded image on cache) + if (File.Exists(System.IO.Path.Combine("j2kDecodeCache", "smap_" + pbs.SculptTexture.ToString()))) + return m_mesher.CreateMesh(actor.Name, pbs, size, clod, true, convex); + } + + if(pbs.SculptData != null && pbs.SculptData.Length >0) + return m_mesher.CreateMesh(actor.Name, pbs, size, clod, true, convex); + } } return mesh; } diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs index 545bd27..f328066 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs @@ -1353,6 +1353,7 @@ namespace OpenSim.Region.Physics.OdePlugin { if (m_mesh == null) { +/* bool convex; int clod = (int)LevelOfDetail.High; @@ -1366,6 +1367,8 @@ namespace OpenSim.Region.Physics.OdePlugin } mesh = _parent_scene.mesher.CreateMesh(Name, _pbs, _size, clod, true, convex); +*/ + mesh = _parent_scene.m_meshWorker.getMesh(this, _pbs, _size, m_shapetype); } else { -- cgit v1.1