aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSScene.cs9
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSTerrainManager.cs10
2 files changed, 16 insertions, 3 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
index cf5bb57..ac99777 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
@@ -349,8 +349,6 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
349 // make sure no stepping happens while we're deleting stuff 349 // make sure no stepping happens while we're deleting stuff
350 m_initialized = false; 350 m_initialized = false;
351 351
352 TerrainManager.ReleaseGroundPlaneAndTerrain();
353
354 foreach (KeyValuePair<uint, BSPhysObject> kvp in PhysObjects) 352 foreach (KeyValuePair<uint, BSPhysObject> kvp in PhysObjects)
355 { 353 {
356 kvp.Value.Destroy(); 354 kvp.Value.Destroy();
@@ -370,6 +368,13 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
370 Shapes = null; 368 Shapes = null;
371 } 369 }
372 370
371 if (TerrainManager != null)
372 {
373 TerrainManager.ReleaseGroundPlaneAndTerrain();
374 TerrainManager.Dispose();
375 TerrainManager = null;
376 }
377
373 // Anything left in the unmanaged code should be cleaned out 378 // Anything left in the unmanaged code should be cleaned out
374 BulletSimAPI.Shutdown2(World.ptr); 379 BulletSimAPI.Shutdown2(World.ptr);
375 380
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSTerrainManager.cs b/OpenSim/Region/Physics/BulletSPlugin/BSTerrainManager.cs
index 5dbd8ce..c68fd69 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSTerrainManager.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSTerrainManager.cs
@@ -67,7 +67,7 @@ public abstract class BSTerrainPhys : IDisposable
67} 67}
68 68
69// ========================================================================================== 69// ==========================================================================================
70public sealed class BSTerrainManager 70public sealed class BSTerrainManager : IDisposable
71{ 71{
72 static string LogHeader = "[BULLETSIM TERRAIN MANAGER]"; 72 static string LogHeader = "[BULLETSIM TERRAIN MANAGER]";
73 73
@@ -122,6 +122,11 @@ public sealed class BSTerrainManager
122 MegaRegionParentPhysicsScene = null; 122 MegaRegionParentPhysicsScene = null;
123 } 123 }
124 124
125 public void Dispose()
126 {
127 ReleaseGroundPlaneAndTerrain();
128 }
129
125 // Create the initial instance of terrain and the underlying ground plane. 130 // Create the initial instance of terrain and the underlying ground plane.
126 // This is called from the initialization routine so we presume it is 131 // This is called from the initialization routine so we presume it is
127 // safe to call Bullet in real time. We hope no one is moving prims around yet. 132 // safe to call Bullet in real time. We hope no one is moving prims around yet.
@@ -366,6 +371,9 @@ public sealed class BSTerrainManager
366 { 371 {
367 PhysicsScene.Logger.ErrorFormat("{0} GetTerrainHeightAtXY: terrain not found: region={1}, x={2}, y={3}", 372 PhysicsScene.Logger.ErrorFormat("{0} GetTerrainHeightAtXY: terrain not found: region={1}, x={2}, y={3}",
368 LogHeader, PhysicsScene.RegionName, tX, tY); 373 LogHeader, PhysicsScene.RegionName, tX, tY);
374 DetailLog("{0},BSTerrainManager.GetTerrainHeightAtXYZ,terrainNotFound,loc={1},base={2}",
375 BSScene.DetailLogZero, loc, terrainBaseXYZ);
376 Util.PrintCallStack(); // DEBUG DEBUG DEBUG
369 } 377 }
370 } 378 }
371 lastHeight = ret; 379 lastHeight = ret;