aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-10-18 23:32:40 +0100
committerJustin Clark-Casey (justincc)2012-10-18 23:32:40 +0100
commit8aa43e72e53cf57047be979499b31c2a970b0324 (patch)
tree3f467214f8e2d77b57d258a3bc3571cc8d2648ff
parentAdd number of inventory items to information displayed via "show part" consol... (diff)
parentRemove extraneous calls to the now commented CheckSculptAndLoad (diff)
downloadopensim-SC_OLD-8aa43e72e53cf57047be979499b31c2a970b0324.zip
opensim-SC_OLD-8aa43e72e53cf57047be979499b31c2a970b0324.tar.gz
opensim-SC_OLD-8aa43e72e53cf57047be979499b31c2a970b0324.tar.bz2
opensim-SC_OLD-8aa43e72e53cf57047be979499b31c2a970b0324.tar.xz
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs3
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs52
-rw-r--r--OpenSim/Region/Physics/Manager/PhysicsScene.cs2
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODEPrim.cs51
-rw-r--r--OpenSim/Region/Physics/OdePlugin/OdeScene.cs2
5 files changed, 70 insertions, 40 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 45bbbda..1fa6a75 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -3432,6 +3432,7 @@ namespace OpenSim.Region.Framework.Scenes
3432 /// <remarks> 3432 /// <remarks>
3433 /// When the physics engine has finished with it, the sculpt data is discarded to save memory. 3433 /// When the physics engine has finished with it, the sculpt data is discarded to save memory.
3434 /// </remarks> 3434 /// </remarks>
3435/*
3435 public void CheckSculptAndLoad() 3436 public void CheckSculptAndLoad()
3436 { 3437 {
3437 if (IsDeleted) 3438 if (IsDeleted)
@@ -3447,7 +3448,7 @@ namespace OpenSim.Region.Framework.Scenes
3447 for (int i = 0; i < parts.Length; i++) 3448 for (int i = 0; i < parts.Length; i++)
3448 parts[i].CheckSculptAndLoad(); 3449 parts[i].CheckSculptAndLoad();
3449 } 3450 }
3450 3451*/
3451 /// <summary> 3452 /// <summary>
3452 /// Set the user group to which this scene object belongs. 3453 /// Set the user group to which this scene object belongs.
3453 /// </summary> 3454 /// </summary>
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 199526e..da2c069 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -1014,9 +1014,9 @@ namespace OpenSim.Region.Framework.Scenes
1014 { 1014 {
1015 actor.Size = m_shape.Scale; 1015 actor.Size = m_shape.Scale;
1016 1016
1017 if (Shape.SculptEntry) 1017// if (Shape.SculptEntry)
1018 CheckSculptAndLoad(); 1018// CheckSculptAndLoad();
1019 else 1019// else
1020 ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(actor); 1020 ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(actor);
1021 } 1021 }
1022 } 1022 }
@@ -1620,12 +1620,13 @@ namespace OpenSim.Region.Framework.Scenes
1620 1620
1621 if (userExposed) 1621 if (userExposed)
1622 { 1622 {
1623/*
1623 if (dupe.m_shape.SculptEntry && dupe.m_shape.SculptTexture != UUID.Zero) 1624 if (dupe.m_shape.SculptEntry && dupe.m_shape.SculptTexture != UUID.Zero)
1624 { 1625 {
1625 ParentGroup.Scene.AssetService.Get( 1626 ParentGroup.Scene.AssetService.Get(
1626 dupe.m_shape.SculptTexture.ToString(), dupe, dupe.AssetReceived); 1627 dupe.m_shape.SculptTexture.ToString(), dupe, dupe.AssetReceived);
1627 } 1628 }
1628 1629*/
1629 bool UsePhysics = ((dupe.Flags & PrimFlags.Physics) != 0); 1630 bool UsePhysics = ((dupe.Flags & PrimFlags.Physics) != 0);
1630 dupe.DoPhysicsPropertyUpdate(UsePhysics, true); 1631 dupe.DoPhysicsPropertyUpdate(UsePhysics, true);
1631 } 1632 }
@@ -1643,6 +1644,7 @@ namespace OpenSim.Region.Framework.Scenes
1643 /// <param name="id">ID of asset received</param> 1644 /// <param name="id">ID of asset received</param>
1644 /// <param name="sender">Register</param> 1645 /// <param name="sender">Register</param>
1645 /// <param name="asset"></param> 1646 /// <param name="asset"></param>
1647/*
1646 protected void AssetReceived(string id, Object sender, AssetBase asset) 1648 protected void AssetReceived(string id, Object sender, AssetBase asset)
1647 { 1649 {
1648 if (asset != null) 1650 if (asset != null)
@@ -1652,7 +1654,7 @@ namespace OpenSim.Region.Framework.Scenes
1652 "[SCENE OBJECT PART]: Part {0} {1} requested mesh/sculpt data for asset id {2} from asset service but received no data", 1654 "[SCENE OBJECT PART]: Part {0} {1} requested mesh/sculpt data for asset id {2} from asset service but received no data",
1653 Name, UUID, id); 1655 Name, UUID, id);
1654 } 1656 }
1655 1657*/
1656 /// <summary> 1658 /// <summary>
1657 /// Do a physics property update for a NINJA joint. 1659 /// Do a physics property update for a NINJA joint.
1658 /// </summary> 1660 /// </summary>
@@ -1833,9 +1835,9 @@ namespace OpenSim.Region.Framework.Scenes
1833 1835
1834 // If this part is a sculpt then delay the physics update until we've asynchronously loaded the 1836 // If this part is a sculpt then delay the physics update until we've asynchronously loaded the
1835 // mesh data. 1837 // mesh data.
1836 if (Shape.SculptEntry) 1838// if (Shape.SculptEntry)
1837 CheckSculptAndLoad(); 1839// CheckSculptAndLoad();
1838 else 1840// else
1839 ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(pa); 1841 ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(pa);
1840 } 1842 }
1841 } 1843 }
@@ -2511,6 +2513,7 @@ namespace OpenSim.Region.Framework.Scenes
2511 /// Set sculpt and mesh data, and tell the physics engine to process the change. 2513 /// Set sculpt and mesh data, and tell the physics engine to process the change.
2512 /// </summary> 2514 /// </summary>
2513 /// <param name="texture">The mesh itself.</param> 2515 /// <param name="texture">The mesh itself.</param>
2516/*
2514 public void SculptTextureCallback(AssetBase texture) 2517 public void SculptTextureCallback(AssetBase texture)
2515 { 2518 {
2516 if (m_shape.SculptEntry) 2519 if (m_shape.SculptEntry)
@@ -2538,7 +2541,7 @@ namespace OpenSim.Region.Framework.Scenes
2538 } 2541 }
2539 } 2542 }
2540 } 2543 }
2541 2544*/
2542 /// <summary> 2545 /// <summary>
2543 /// Send a full update to the client for the given part 2546 /// Send a full update to the client for the given part
2544 /// </summary> 2547 /// </summary>
@@ -3783,7 +3786,7 @@ namespace OpenSim.Region.Framework.Scenes
3783 public void UpdateExtraParam(ushort type, bool inUse, byte[] data) 3786 public void UpdateExtraParam(ushort type, bool inUse, byte[] data)
3784 { 3787 {
3785 m_shape.ReadInUpdateExtraParam(type, inUse, data); 3788 m_shape.ReadInUpdateExtraParam(type, inUse, data);
3786 3789/*
3787 if (type == 0x30) 3790 if (type == 0x30)
3788 { 3791 {
3789 if (m_shape.SculptEntry && m_shape.SculptTexture != UUID.Zero) 3792 if (m_shape.SculptEntry && m_shape.SculptTexture != UUID.Zero)
@@ -3791,7 +3794,7 @@ namespace OpenSim.Region.Framework.Scenes
3791 ParentGroup.Scene.AssetService.Get(m_shape.SculptTexture.ToString(), this, AssetReceived); 3794 ParentGroup.Scene.AssetService.Get(m_shape.SculptTexture.ToString(), this, AssetReceived);
3792 } 3795 }
3793 } 3796 }
3794 3797*/
3795 if (ParentGroup != null) 3798 if (ParentGroup != null)
3796 { 3799 {
3797 ParentGroup.HasGroupChanged = true; 3800 ParentGroup.HasGroupChanged = true;
@@ -4025,14 +4028,6 @@ namespace OpenSim.Region.Framework.Scenes
4025 if (!wasUsingPhysics) 4028 if (!wasUsingPhysics)
4026 { 4029 {
4027 DoPhysicsPropertyUpdate(UsePhysics, false); 4030 DoPhysicsPropertyUpdate(UsePhysics, false);
4028
4029 if (!ParentGroup.IsDeleted)
4030 {
4031 if (LocalId == ParentGroup.RootPart.LocalId)
4032 {
4033 ParentGroup.CheckSculptAndLoad();
4034 }
4035 }
4036 } 4031 }
4037 } 4032 }
4038 else 4033 else
@@ -4072,14 +4067,6 @@ namespace OpenSim.Region.Framework.Scenes
4072 pa.SetMaterial(Material); 4067 pa.SetMaterial(Material);
4073 DoPhysicsPropertyUpdate(UsePhysics, true); 4068 DoPhysicsPropertyUpdate(UsePhysics, true);
4074 4069
4075 if (!ParentGroup.IsDeleted)
4076 {
4077 if (LocalId == ParentGroup.RootPart.LocalId)
4078 {
4079 ParentGroup.CheckSculptAndLoad();
4080 }
4081 }
4082
4083 if ( 4070 if (
4084 ((AggregateScriptEvents & scriptEvents.collision) != 0) || 4071 ((AggregateScriptEvents & scriptEvents.collision) != 0) ||
4085 ((AggregateScriptEvents & scriptEvents.collision_end) != 0) || 4072 ((AggregateScriptEvents & scriptEvents.collision_end) != 0) ||
@@ -4104,14 +4091,6 @@ namespace OpenSim.Region.Framework.Scenes
4104 else // it already has a physical representation 4091 else // it already has a physical representation
4105 { 4092 {
4106 DoPhysicsPropertyUpdate(UsePhysics, false); // Update physical status. If it's phantom this will remove the prim 4093 DoPhysicsPropertyUpdate(UsePhysics, false); // Update physical status. If it's phantom this will remove the prim
4107
4108 if (!ParentGroup.IsDeleted)
4109 {
4110 if (LocalId == ParentGroup.RootPart.LocalId)
4111 {
4112 ParentGroup.CheckSculptAndLoad();
4113 }
4114 }
4115 } 4094 }
4116 } 4095 }
4117 4096
@@ -4341,6 +4320,7 @@ namespace OpenSim.Region.Framework.Scenes
4341 /// <remarks> 4320 /// <remarks>
4342 /// When the physics engine has finished with it, the sculpt data is discarded to save memory. 4321 /// When the physics engine has finished with it, the sculpt data is discarded to save memory.
4343 /// </remarks> 4322 /// </remarks>
4323/*
4344 public void CheckSculptAndLoad() 4324 public void CheckSculptAndLoad()
4345 { 4325 {
4346// m_log.DebugFormat("Processing CheckSculptAndLoad for {0} {1}", Name, LocalId); 4326// m_log.DebugFormat("Processing CheckSculptAndLoad for {0} {1}", Name, LocalId);
@@ -4366,7 +4346,7 @@ namespace OpenSim.Region.Framework.Scenes
4366 } 4346 }
4367 } 4347 }
4368 } 4348 }
4369 4349*/
4370 /// <summary> 4350 /// <summary>
4371 /// Update the texture entry for this part. 4351 /// Update the texture entry for this part.
4372 /// </summary> 4352 /// </summary>
diff --git a/OpenSim/Region/Physics/Manager/PhysicsScene.cs b/OpenSim/Region/Physics/Manager/PhysicsScene.cs
index 6a0558a..488900e 100644
--- a/OpenSim/Region/Physics/Manager/PhysicsScene.cs
+++ b/OpenSim/Region/Physics/Manager/PhysicsScene.cs
@@ -76,7 +76,7 @@ namespace OpenSim.Region.Physics.Manager
76 get { return new NullPhysicsScene(); } 76 get { return new NullPhysicsScene(); }
77 } 77 }
78 78
79 public RequestAssetDelegate RequestAssetMethod { private get; set; } 79 public RequestAssetDelegate RequestAssetMethod { get; set; }
80 80
81 public virtual void TriggerPhysicsBasedRestart() 81 public virtual void TriggerPhysicsBasedRestart()
82 { 82 {
diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
index e7b3b2b..c86084c 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
@@ -100,6 +100,9 @@ namespace OpenSim.Region.Physics.OdePlugin
100 private Vector3 m_taintAngularLock = Vector3.One; 100 private Vector3 m_taintAngularLock = Vector3.One;
101 private IntPtr Amotor = IntPtr.Zero; 101 private IntPtr Amotor = IntPtr.Zero;
102 102
103 private object m_assetsLock = new object();
104 private bool m_assetFailed = false;
105
103 private Vector3 m_PIDTarget; 106 private Vector3 m_PIDTarget;
104 private float m_PIDTau; 107 private float m_PIDTau;
105 private float PID_D = 35f; 108 private float PID_D = 35f;
@@ -282,6 +285,7 @@ namespace OpenSim.Region.Physics.OdePlugin
282 } 285 }
283 286
284 m_taintadd = true; 287 m_taintadd = true;
288 m_assetFailed = false;
285 _parent_scene.AddPhysicsActorTaint(this); 289 _parent_scene.AddPhysicsActorTaint(this);
286 } 290 }
287 291
@@ -1498,6 +1502,8 @@ Console.WriteLine("CreateGeom:");
1498 mesh = _parent_scene.mesher.CreateMesh(Name, _pbs, _size, _parent_scene.meshSculptLOD, IsPhysical); 1502 mesh = _parent_scene.mesher.CreateMesh(Name, _pbs, _size, _parent_scene.meshSculptLOD, IsPhysical);
1499 // createmesh returns null when it's a shape that isn't a cube. 1503 // createmesh returns null when it's a shape that isn't a cube.
1500 // m_log.Debug(m_localID); 1504 // m_log.Debug(m_localID);
1505 if (mesh == null)
1506 CheckMeshAsset();
1501 } 1507 }
1502 1508
1503#if SPAM 1509#if SPAM
@@ -1997,7 +2003,12 @@ Console.WriteLine(" JointCreateFixed");
1997 // Don't need to re-enable body.. it's done in SetMesh 2003 // Don't need to re-enable body.. it's done in SetMesh
1998 2004
1999 if (_parent_scene.needsMeshing(_pbs)) 2005 if (_parent_scene.needsMeshing(_pbs))
2006 {
2000 mesh = _parent_scene.mesher.CreateMesh(Name, _pbs, _size, meshlod, IsPhysical); 2007 mesh = _parent_scene.mesher.CreateMesh(Name, _pbs, _size, meshlod, IsPhysical);
2008 if (mesh == null)
2009 CheckMeshAsset();
2010 }
2011
2001 } 2012 }
2002 2013
2003 CreateGeom(m_targetSpace, mesh); 2014 CreateGeom(m_targetSpace, mesh);
@@ -2057,6 +2068,8 @@ Console.WriteLine(" JointCreateFixed");
2057 /// </summary> 2068 /// </summary>
2058 private void changeshape() 2069 private void changeshape()
2059 { 2070 {
2071 m_taintshape = false;
2072
2060 // Cleanup of old prim geometry and Bodies 2073 // Cleanup of old prim geometry and Bodies
2061 if (IsPhysical && Body != IntPtr.Zero) 2074 if (IsPhysical && Body != IntPtr.Zero)
2062 { 2075 {
@@ -2084,6 +2097,7 @@ Console.WriteLine(" JointCreateFixed");
2084 2097
2085 IMesh mesh = null; 2098 IMesh mesh = null;
2086 2099
2100
2087 if (_parent_scene.needsMeshing(_pbs)) 2101 if (_parent_scene.needsMeshing(_pbs))
2088 { 2102 {
2089 // Don't need to re-enable body.. it's done in CreateMesh 2103 // Don't need to re-enable body.. it's done in CreateMesh
@@ -2094,6 +2108,8 @@ Console.WriteLine(" JointCreateFixed");
2094 2108
2095 // createmesh returns null when it doesn't mesh. 2109 // createmesh returns null when it doesn't mesh.
2096 mesh = _parent_scene.mesher.CreateMesh(Name, _pbs, _size, meshlod, IsPhysical); 2110 mesh = _parent_scene.mesher.CreateMesh(Name, _pbs, _size, meshlod, IsPhysical);
2111 if (mesh == null)
2112 CheckMeshAsset();
2097 } 2113 }
2098 2114
2099 CreateGeom(m_targetSpace, mesh); 2115 CreateGeom(m_targetSpace, mesh);
@@ -2130,7 +2146,7 @@ Console.WriteLine(" JointCreateFixed");
2130 } 2146 }
2131 2147
2132 resetCollisionAccounting(); 2148 resetCollisionAccounting();
2133 m_taintshape = false; 2149// m_taintshape = false;
2134 } 2150 }
2135 2151
2136 /// <summary> 2152 /// <summary>
@@ -2396,6 +2412,7 @@ Console.WriteLine(" JointCreateFixed");
2396 set 2412 set
2397 { 2413 {
2398 _pbs = value; 2414 _pbs = value;
2415 m_assetFailed = false;
2399 m_taintshape = true; 2416 m_taintshape = true;
2400 } 2417 }
2401 } 2418 }
@@ -3234,5 +3251,37 @@ Console.WriteLine(" JointCreateFixed");
3234 { 3251 {
3235 m_material = pMaterial; 3252 m_material = pMaterial;
3236 } 3253 }
3254
3255
3256 private void CheckMeshAsset()
3257 {
3258 if (_pbs.SculptEntry && !m_assetFailed && _pbs.SculptTexture != UUID.Zero)
3259 {
3260 m_assetFailed = true;
3261 Util.FireAndForget(delegate
3262 {
3263 RequestAssetDelegate assetProvider = _parent_scene.RequestAssetMethod;
3264 if (assetProvider != null)
3265 assetProvider(_pbs.SculptTexture, MeshAssetReveived);
3266 });
3267 }
3268 }
3269
3270 void MeshAssetReveived(AssetBase asset)
3271 {
3272 if (asset.Data != null && asset.Data.Length > 0)
3273 {
3274 if (!_pbs.SculptEntry)
3275 return;
3276 if (_pbs.SculptTexture.ToString() != asset.ID)
3277 return;
3278
3279 _pbs.SculptData = new byte[asset.Data.Length];
3280 asset.Data.CopyTo(_pbs.SculptData, 0);
3281 m_assetFailed = false;
3282 m_taintshape = true;
3283 _parent_scene.AddPhysicsActorTaint(this);
3284 }
3285 }
3237 } 3286 }
3238} \ No newline at end of file 3287} \ No newline at end of file
diff --git a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
index cbe21e2..d53bd90 100644
--- a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
+++ b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
@@ -4320,4 +4320,4 @@ namespace OpenSim.Region.Physics.OdePlugin
4320 m_stats[ODEPrimUpdateFrameMsStatName] = 0; 4320 m_stats[ODEPrimUpdateFrameMsStatName] = 0;
4321 } 4321 }
4322 } 4322 }
4323} \ No newline at end of file 4323}