diff options
author | Teravus Ovares | 2008-02-14 00:39:08 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-02-14 00:39:08 +0000 |
commit | 0d14c47c28f4e453540f5f6807ba8b86d5ff50c2 (patch) | |
tree | 538fa1a6079dfb496ade0e43d8699ebee4f5eaf9 /OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | |
parent | * Bigish ODE stability Update. Run Prebuild (diff) | |
download | opensim-SC-0d14c47c28f4e453540f5f6807ba8b86d5ff50c2.zip opensim-SC-0d14c47c28f4e453540f5f6807ba8b86d5ff50c2.tar.gz opensim-SC-0d14c47c28f4e453540f5f6807ba8b86d5ff50c2.tar.bz2 opensim-SC-0d14c47c28f4e453540f5f6807ba8b86d5ff50c2.tar.xz |
* Bigisn ODE Stability update 2
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 45 |
1 files changed, 28 insertions, 17 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index 66af095..5ff74dc 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | |||
@@ -736,6 +736,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
736 | /// <param name="prim"></param> | 736 | /// <param name="prim"></param> |
737 | public void RemovePrimThreadLocked(OdePrim prim) | 737 | public void RemovePrimThreadLocked(OdePrim prim) |
738 | { | 738 | { |
739 | prim.ResetTaints(); | ||
739 | lock (OdeLock) | 740 | lock (OdeLock) |
740 | { | 741 | { |
741 | System.Threading.Thread.Sleep(20); | 742 | System.Threading.Thread.Sleep(20); |
@@ -1237,31 +1238,39 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1237 | actor.Move(timeStep); | 1238 | actor.Move(timeStep); |
1238 | actor.collidelock = true; | 1239 | actor.collidelock = true; |
1239 | } | 1240 | } |
1240 | 1241 | if (!ode.lockquery()) | |
1241 | ode.dlock(world); | 1242 | { |
1243 | ode.dlock(world); | ||
1242 | 1244 | ||
1243 | collision_optimized(timeStep); | 1245 | collision_optimized(timeStep); |
1244 | 1246 | ||
1245 | |||
1246 | 1247 | ||
1247 | ode.dunlock(world); | 1248 | |
1248 | 1249 | ||
1249 | try | 1250 | |
1250 | { | 1251 | try |
1251 | d.WorldQuickStep(world, ODE_STEPSIZE); | 1252 | { |
1253 | d.WorldQuickStep(world, ODE_STEPSIZE); | ||
1254 | } | ||
1255 | catch (StackOverflowException) | ||
1256 | { | ||
1257 | d.WorldQuickStep(world, 0.001f); | ||
1258 | } | ||
1259 | d.JointGroupEmpty(contactgroup); | ||
1260 | ode.dunlock(world); | ||
1261 | |||
1262 | step_time -= ODE_STEPSIZE; | ||
1263 | i++; | ||
1252 | } | 1264 | } |
1253 | catch (StackOverflowException) | 1265 | else |
1254 | { | 1266 | { |
1255 | d.WorldQuickStep(world, 0.001f); | 1267 | fps = 0; |
1256 | } | 1268 | } |
1257 | d.JointGroupEmpty(contactgroup); | 1269 | |
1258 | foreach (OdeCharacter actor in _characters) | 1270 | foreach (OdeCharacter actor in _characters) |
1259 | { | 1271 | { |
1260 | actor.collidelock = false; | 1272 | actor.collidelock = false; |
1261 | } | 1273 | } |
1262 | |||
1263 | step_time -= ODE_STEPSIZE; | ||
1264 | i++; | ||
1265 | } | 1274 | } |
1266 | 1275 | ||
1267 | foreach (OdeCharacter actor in _characters) | 1276 | foreach (OdeCharacter actor in _characters) |
@@ -1273,12 +1282,14 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1273 | { | 1282 | { |
1274 | bool processedtaints = false; | 1283 | bool processedtaints = false; |
1275 | foreach (OdePrim prim in _taintedPrim) | 1284 | foreach (OdePrim prim in _taintedPrim) |
1276 | { | 1285 | { |
1277 | prim.ProcessTaints(timeStep); | ||
1278 | if (prim.m_taintremove) | 1286 | if (prim.m_taintremove) |
1279 | { | 1287 | { |
1280 | RemovePrimThreadLocked(prim); | 1288 | RemovePrimThreadLocked(prim); |
1281 | } | 1289 | } |
1290 | |||
1291 | prim.ProcessTaints(timeStep); | ||
1292 | |||
1282 | processedtaints = true; | 1293 | processedtaints = true; |
1283 | prim.m_collisionscore = 0; | 1294 | prim.m_collisionscore = 0; |
1284 | } | 1295 | } |