meshworker basic replacement of SOP CheckSculptAndLoad ( for now disabled

for all physics engines)
avinationmerge
UbitUmarov 2012-10-03 23:14:56 +01:00
parent 4f51cc325c
commit 9988558ec1
2 changed files with 41 additions and 4 deletions

View File

@ -4902,6 +4902,8 @@ namespace OpenSim.Region.Framework.Scenes
{
// m_log.DebugFormat("Processing CheckSculptAndLoad for {0} {1}", Name, LocalId);
return;
if (ParentGroup.IsDeleted)
return;

View File

@ -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
}
}
/// <summary>
/// Routine to figure out if we need to mesh this prim with our mesher
/// </summary>
@ -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;
}
}
}
}