diff options
author | Melanie | 2012-10-18 20:56:34 +0100 |
---|---|---|
committer | Melanie | 2012-10-18 20:56:34 +0100 |
commit | 72c925a6c9eb4dea6f9134db10c3af28ea83df48 (patch) | |
tree | 9f991ade4e71f91fc612759b4e783c9f01a740f3 /OpenSim/Region/Physics/OdePlugin | |
parent | Merge branch 'master' into careminster (diff) | |
parent | Remove redundant and annoyingly modal message box in upload processing. (diff) | |
download | opensim-SC-72c925a6c9eb4dea6f9134db10c3af28ea83df48.zip opensim-SC-72c925a6c9eb4dea6f9134db10c3af28ea83df48.tar.gz opensim-SC-72c925a6c9eb4dea6f9134db10c3af28ea83df48.tar.bz2 opensim-SC-72c925a6c9eb4dea6f9134db10c3af28ea83df48.tar.xz |
Merge branch 'avination' into careminster
Conflicts:
OpenSim/Framework/WebUtil.cs
OpenSim/Region/Physics/OdePlugin/OdeScene.cs
Diffstat (limited to 'OpenSim/Region/Physics/OdePlugin')
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | 55 | ||||
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/ODERayCastRequestManager.cs | 11 | ||||
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/OdeScene.cs | 2 |
3 files changed, 55 insertions, 13 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs index eb02536..7a0857f 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 | ||
@@ -604,8 +608,8 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
604 | break; | 608 | break; |
605 | 609 | ||
606 | case HollowShape.Circle: | 610 | case HollowShape.Circle: |
607 | // Hollow shape is a perfect cylinder in respect to the cube's scale | 611 | // Hollow shape is a perfect cyllinder in respect to the cube's scale |
608 | // Cylinder hollow volume calculation | 612 | // Cyllinder hollow volume calculation |
609 | 613 | ||
610 | hollowVolume *= 0.1963495f * 3.07920140172638f; | 614 | hollowVolume *= 0.1963495f * 3.07920140172638f; |
611 | break; | 615 | break; |
@@ -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/ODERayCastRequestManager.cs b/OpenSim/Region/Physics/OdePlugin/ODERayCastRequestManager.cs index 7e3ec63..8d7d3b3 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODERayCastRequestManager.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODERayCastRequestManager.cs | |||
@@ -137,15 +137,8 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
137 | ODERayCastRequest[] reqs = m_PendingRequests.ToArray(); | 137 | ODERayCastRequest[] reqs = m_PendingRequests.ToArray(); |
138 | for (int i = 0; i < reqs.Length; i++) | 138 | for (int i = 0; i < reqs.Length; i++) |
139 | { | 139 | { |
140 | try | 140 | if (reqs[i].callbackMethod != null) // quick optimization here, don't raycast |
141 | { | 141 | RayCast(reqs[i]); // if there isn't anyone to send results |
142 | if (reqs[i].callbackMethod != null) // quick optimization here, don't raycast | ||
143 | RayCast(reqs[i]); // if there isn't anyone to send results | ||
144 | } | ||
145 | catch | ||
146 | { | ||
147 | //Fail silently | ||
148 | } | ||
149 | } | 142 | } |
150 | 143 | ||
151 | m_PendingRequests.Clear(); | 144 | m_PendingRequests.Clear(); |
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 | } |