diff options
Diffstat (limited to 'OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs')
-rw-r--r-- | OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs index 61e31a1..aec7ec3 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs | |||
@@ -366,7 +366,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
366 | /// </summary> | 366 | /// </summary> |
367 | private void Initialization() | 367 | private void Initialization() |
368 | { | 368 | { |
369 | // checkThread(); | 369 | d.AllocateODEDataForThread(~0U); |
370 | |||
370 | SimulationLock = new Object(); | 371 | SimulationLock = new Object(); |
371 | 372 | ||
372 | nearCallback = near; | 373 | nearCallback = near; |
@@ -1290,7 +1291,11 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1290 | public override void RemoveAvatar(PhysicsActor actor) | 1291 | public override void RemoveAvatar(PhysicsActor actor) |
1291 | { | 1292 | { |
1292 | //m_log.Debug("[PHYSICS]:ODELOCK"); | 1293 | //m_log.Debug("[PHYSICS]:ODELOCK"); |
1293 | ((OdeCharacter) actor).Destroy(); | 1294 | lock (OdeLock) |
1295 | { | ||
1296 | d.AllocateODEDataForThread(0); | ||
1297 | ((OdeCharacter) actor).Destroy(); | ||
1298 | } | ||
1294 | } | 1299 | } |
1295 | 1300 | ||
1296 | 1301 | ||
@@ -1319,6 +1324,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1319 | OdePrim newPrim; | 1324 | OdePrim newPrim; |
1320 | lock (OdeLock) | 1325 | lock (OdeLock) |
1321 | { | 1326 | { |
1327 | |||
1322 | newPrim = new OdePrim(name, this, position, size, rotation, pbs, isphysical, isPhantom, shapeType, localID); | 1328 | newPrim = new OdePrim(name, this, position, size, rotation, pbs, isphysical, isPhantom, shapeType, localID); |
1323 | lock (_prims) | 1329 | lock (_prims) |
1324 | _prims.Add(newPrim); | 1330 | _prims.Add(newPrim); |
@@ -1547,6 +1553,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1547 | return; | 1553 | return; |
1548 | } | 1554 | } |
1549 | 1555 | ||
1556 | d.AllocateODEDataForThread(~0U); | ||
1557 | |||
1550 | ODEchangeitem item; | 1558 | ODEchangeitem item; |
1551 | 1559 | ||
1552 | int donechanges = 0; | 1560 | int donechanges = 0; |
@@ -1630,7 +1638,9 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1630 | int changestimeMS = 0; | 1638 | int changestimeMS = 0; |
1631 | int maxChangestime = (int)(reqTimeStep * 500f); // half the time | 1639 | int maxChangestime = (int)(reqTimeStep * 500f); // half the time |
1632 | int maxLoopTime = (int)(reqTimeStep * 1200f); // 1.2 the time | 1640 | int maxLoopTime = (int)(reqTimeStep * 1200f); // 1.2 the time |
1633 | 1641 | ||
1642 | d.AllocateODEDataForThread(~0U); | ||
1643 | |||
1634 | if (ChangesQueue.Count > 0) | 1644 | if (ChangesQueue.Count > 0) |
1635 | { | 1645 | { |
1636 | while (ChangesQueue.Dequeue(out item)) | 1646 | while (ChangesQueue.Dequeue(out item)) |
@@ -2260,6 +2270,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
2260 | 2270 | ||
2261 | lock (OdeLock) | 2271 | lock (OdeLock) |
2262 | { | 2272 | { |
2273 | d.AllocateODEDataForThread(~0U); | ||
2274 | |||
2263 | IntPtr GroundGeom = IntPtr.Zero; | 2275 | IntPtr GroundGeom = IntPtr.Zero; |
2264 | if (RegionTerrain.TryGetValue(pOffset, out GroundGeom)) | 2276 | if (RegionTerrain.TryGetValue(pOffset, out GroundGeom)) |
2265 | { | 2277 | { |
@@ -2450,9 +2462,12 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
2450 | { | 2462 | { |
2451 | lock (OdeLock) | 2463 | lock (OdeLock) |
2452 | { | 2464 | { |
2465 | |||
2453 | if (world == IntPtr.Zero) | 2466 | if (world == IntPtr.Zero) |
2454 | return; | 2467 | return; |
2455 | 2468 | ||
2469 | d.AllocateODEDataForThread(~0U); | ||
2470 | |||
2456 | if (m_meshWorker != null) | 2471 | if (m_meshWorker != null) |
2457 | m_meshWorker.Stop(); | 2472 | m_meshWorker.Stop(); |
2458 | 2473 | ||