From 9988558ec16144f1a69b666d39428cda4c0849c3 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 3 Oct 2012 23:14:56 +0100 Subject: meshworker basic replacement of SOP CheckSculptAndLoad ( for now disabled for all physics engines) --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 2 + .../Region/Physics/UbitOdePlugin/ODEMeshWorker.cs | 43 ++++++++++++++++++++-- 2 files changed, 41 insertions(+), 4 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index e6ad89c..1bddf22 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -4902,6 +4902,8 @@ namespace OpenSim.Region.Framework.Scenes { // m_log.DebugFormat("Processing CheckSculptAndLoad for {0} {1}", Name, LocalId); + return; + if (ParentGroup.IsDeleted) return; diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODEMeshWorker.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODEMeshWorker.cs index f57149c..b0231e9 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/ODEMeshWorker.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/ODEMeshWorker.cs @@ -29,12 +29,11 @@ namespace OpenSim.Region.Physics.OdePlugin public float meshSculptLOD = 32; public float MeshSculptphysicalLOD = 32; - public ODEMeshWorker(OdeScene pScene, ILog pLog, IMesher pMesher, IConfig pConfig) { m_scene = pScene; m_log = pLog; - m_mesher = pMesher; + m_mesher = pMesher; if (pConfig != null) { @@ -45,8 +44,6 @@ namespace OpenSim.Region.Physics.OdePlugin } } - - /// /// Routine to figure out if we need to mesh this prim with our mesher /// @@ -207,9 +204,47 @@ namespace OpenSim.Region.Physics.OdePlugin if(pbs.SculptData != null && pbs.SculptData.Length >0) return m_mesher.CreateMesh(actor.Name, pbs, size, clod, true, convex); + + ODEAssetRequest asr; + RequestAssetDelegate assetProvider = m_scene.RequestAssetMethod; + if (assetProvider != null) + asr = new ODEAssetRequest(this, assetProvider, actor, pbs); + return null; } } return mesh; } } + + public class ODEAssetRequest + { + PhysicsActor m_actor; + ODEMeshWorker m_worker; + PrimitiveBaseShape m_pbs; + + public ODEAssetRequest(ODEMeshWorker pWorker, RequestAssetDelegate provider, PhysicsActor pActor, PrimitiveBaseShape ppbs) + { + m_actor = pActor; + m_worker = pWorker; + m_pbs = ppbs; + + if (provider == null) + return; + + UUID assetID = m_pbs.SculptTexture; + if (assetID == UUID.Zero) + return; + + provider(assetID, ODEassetReceived); + } + + void ODEassetReceived(AssetBase asset) + { + if (m_actor != null && m_pbs != null && asset != null && asset.Data != null && asset.Data.Length > 0) + { + m_pbs.SculptData = asset.Data; + m_actor.Shape = m_pbs; + } + } + } } \ No newline at end of file -- cgit v1.1