diff options
author | UbitUmarov | 2012-10-03 23:14:56 +0100 |
---|---|---|
committer | UbitUmarov | 2012-10-03 23:14:56 +0100 |
commit | 9988558ec16144f1a69b666d39428cda4c0849c3 (patch) | |
tree | 30f652e355115fe0451b05956948ab77cb813aff /OpenSim | |
parent | making meshworker have more work.. (diff) | |
download | opensim-SC_OLD-9988558ec16144f1a69b666d39428cda4c0849c3.zip opensim-SC_OLD-9988558ec16144f1a69b666d39428cda4c0849c3.tar.gz opensim-SC_OLD-9988558ec16144f1a69b666d39428cda4c0849c3.tar.bz2 opensim-SC_OLD-9988558ec16144f1a69b666d39428cda4c0849c3.tar.xz |
meshworker basic replacement of SOP CheckSculptAndLoad ( for now disabled
for all physics engines)
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 2 | ||||
-rw-r--r-- | OpenSim/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 | |||
4902 | { | 4902 | { |
4903 | // m_log.DebugFormat("Processing CheckSculptAndLoad for {0} {1}", Name, LocalId); | 4903 | // m_log.DebugFormat("Processing CheckSculptAndLoad for {0} {1}", Name, LocalId); |
4904 | 4904 | ||
4905 | return; | ||
4906 | |||
4905 | if (ParentGroup.IsDeleted) | 4907 | if (ParentGroup.IsDeleted) |
4906 | return; | 4908 | return; |
4907 | 4909 | ||
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 | |||
29 | public float meshSculptLOD = 32; | 29 | public float meshSculptLOD = 32; |
30 | public float MeshSculptphysicalLOD = 32; | 30 | public float MeshSculptphysicalLOD = 32; |
31 | 31 | ||
32 | |||
33 | public ODEMeshWorker(OdeScene pScene, ILog pLog, IMesher pMesher, IConfig pConfig) | 32 | public ODEMeshWorker(OdeScene pScene, ILog pLog, IMesher pMesher, IConfig pConfig) |
34 | { | 33 | { |
35 | m_scene = pScene; | 34 | m_scene = pScene; |
36 | m_log = pLog; | 35 | m_log = pLog; |
37 | m_mesher = pMesher; | 36 | m_mesher = pMesher; |
38 | 37 | ||
39 | if (pConfig != null) | 38 | if (pConfig != null) |
40 | { | 39 | { |
@@ -45,8 +44,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
45 | } | 44 | } |
46 | } | 45 | } |
47 | 46 | ||
48 | |||
49 | |||
50 | /// <summary> | 47 | /// <summary> |
51 | /// Routine to figure out if we need to mesh this prim with our mesher | 48 | /// Routine to figure out if we need to mesh this prim with our mesher |
52 | /// </summary> | 49 | /// </summary> |
@@ -207,9 +204,47 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
207 | 204 | ||
208 | if(pbs.SculptData != null && pbs.SculptData.Length >0) | 205 | if(pbs.SculptData != null && pbs.SculptData.Length >0) |
209 | return m_mesher.CreateMesh(actor.Name, pbs, size, clod, true, convex); | 206 | return m_mesher.CreateMesh(actor.Name, pbs, size, clod, true, convex); |
207 | |||
208 | ODEAssetRequest asr; | ||
209 | RequestAssetDelegate assetProvider = m_scene.RequestAssetMethod; | ||
210 | if (assetProvider != null) | ||
211 | asr = new ODEAssetRequest(this, assetProvider, actor, pbs); | ||
212 | return null; | ||
210 | } | 213 | } |
211 | } | 214 | } |
212 | return mesh; | 215 | return mesh; |
213 | } | 216 | } |
214 | } | 217 | } |
218 | |||
219 | public class ODEAssetRequest | ||
220 | { | ||
221 | PhysicsActor m_actor; | ||
222 | ODEMeshWorker m_worker; | ||
223 | PrimitiveBaseShape m_pbs; | ||
224 | |||
225 | public ODEAssetRequest(ODEMeshWorker pWorker, RequestAssetDelegate provider, PhysicsActor pActor, PrimitiveBaseShape ppbs) | ||
226 | { | ||
227 | m_actor = pActor; | ||
228 | m_worker = pWorker; | ||
229 | m_pbs = ppbs; | ||
230 | |||
231 | if (provider == null) | ||
232 | return; | ||
233 | |||
234 | UUID assetID = m_pbs.SculptTexture; | ||
235 | if (assetID == UUID.Zero) | ||
236 | return; | ||
237 | |||
238 | provider(assetID, ODEassetReceived); | ||
239 | } | ||
240 | |||
241 | void ODEassetReceived(AssetBase asset) | ||
242 | { | ||
243 | if (m_actor != null && m_pbs != null && asset != null && asset.Data != null && asset.Data.Length > 0) | ||
244 | { | ||
245 | m_pbs.SculptData = asset.Data; | ||
246 | m_actor.Shape = m_pbs; | ||
247 | } | ||
248 | } | ||
249 | } | ||
215 | } \ No newline at end of file | 250 | } \ No newline at end of file |