aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xOpenSim/Region/PhysicsModules/BulletS/BSTerrainHeightmap.cs1
-rwxr-xr-xOpenSim/Region/PhysicsModules/BulletS/BulletSimData.cs10
2 files changed, 10 insertions, 1 deletions
diff --git a/OpenSim/Region/PhysicsModules/BulletS/BSTerrainHeightmap.cs b/OpenSim/Region/PhysicsModules/BulletS/BSTerrainHeightmap.cs
index f72ad28..1cb948e 100755
--- a/OpenSim/Region/PhysicsModules/BulletS/BSTerrainHeightmap.cs
+++ b/OpenSim/Region/PhysicsModules/BulletS/BSTerrainHeightmap.cs
@@ -136,6 +136,7 @@ public sealed class BSTerrainHeightmap : BSTerrainPhys
136 // Frees both the body and the shape. 136 // Frees both the body and the shape.
137 m_physicsScene.PE.DestroyObject(m_physicsScene.World, m_mapInfo.terrainBody); 137 m_physicsScene.PE.DestroyObject(m_physicsScene.World, m_mapInfo.terrainBody);
138 } 138 }
139 m_mapInfo.Release();
139 } 140 }
140 m_mapInfo = null; 141 m_mapInfo = null;
141 } 142 }
diff --git a/OpenSim/Region/PhysicsModules/BulletS/BulletSimData.cs b/OpenSim/Region/PhysicsModules/BulletS/BulletSimData.cs
index 308769b..9f4f4a6 100755
--- a/OpenSim/Region/PhysicsModules/BulletS/BulletSimData.cs
+++ b/OpenSim/Region/PhysicsModules/BulletS/BulletSimData.cs
@@ -27,6 +27,7 @@
27using System; 27using System;
28using System.Collections.Generic; 28using System.Collections.Generic;
29using System.Text; 29using System.Text;
30using System.Runtime.InteropServices;
30using OMV = OpenMetaverse; 31using OMV = OpenMetaverse;
31 32
32namespace OpenSim.Region.PhysicsModule.BulletS 33namespace OpenSim.Region.PhysicsModule.BulletS
@@ -169,7 +170,7 @@ public class BulletHMapInfo
169 public BulletHMapInfo(uint id, float[] hm, float pSizeX, float pSizeY) { 170 public BulletHMapInfo(uint id, float[] hm, float pSizeX, float pSizeY) {
170 ID = id; 171 ID = id;
171 heightMap = hm; 172 heightMap = hm;
172 terrainRegionBase = OMV.Vector3.Zero; 173 heightMapHandle = GCHandle.Alloc(heightMap, GCHandleType.Pinned);
173 minCoords = new OMV.Vector3(100f, 100f, 25f); 174 minCoords = new OMV.Vector3(100f, 100f, 25f);
174 maxCoords = new OMV.Vector3(101f, 101f, 26f); 175 maxCoords = new OMV.Vector3(101f, 101f, 26f);
175 minZ = maxZ = 0f; 176 minZ = maxZ = 0f;
@@ -185,6 +186,13 @@ public class BulletHMapInfo
185 public float minZ, maxZ; 186 public float minZ, maxZ;
186 public BulletShape terrainShape; 187 public BulletShape terrainShape;
187 public BulletBody terrainBody; 188 public BulletBody terrainBody;
189 private GCHandle heightMapHandle;
190
191 public void Release()
192 {
193 if(heightMapHandle.IsAllocated)
194 heightMapHandle.Free();
195 }
188} 196}
189 197
190// The general class of collsion object. 198// The general class of collsion object.