diff options
author | UbitUmarov | 2018-10-03 21:17:23 +0100 |
---|---|---|
committer | UbitUmarov | 2018-10-03 21:17:23 +0100 |
commit | 1bcdcc2419b9b4f9c64db740f71bacfb8cd02127 (patch) | |
tree | 7d372391fe013f00d58394d8b145c904e0e2df7c /OpenSim/Region/PhysicsModules/BulletS | |
parent | missed new c# version only code (diff) | |
download | opensim-SC-1bcdcc2419b9b4f9c64db740f71bacfb8cd02127.zip opensim-SC-1bcdcc2419b9b4f9c64db740f71bacfb8cd02127.tar.gz opensim-SC-1bcdcc2419b9b4f9c64db740f71bacfb8cd02127.tar.bz2 opensim-SC-1bcdcc2419b9b4f9c64db740f71bacfb8cd02127.tar.xz |
mantis 8384: try to fix bullet heimap managed memory sharing with unmanaged lib
Diffstat (limited to '')
-rwxr-xr-x | OpenSim/Region/PhysicsModules/BulletS/BSTerrainHeightmap.cs | 1 | ||||
-rwxr-xr-x | OpenSim/Region/PhysicsModules/BulletS/BulletSimData.cs | 10 |
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 @@ | |||
27 | using System; | 27 | using System; |
28 | using System.Collections.Generic; | 28 | using System.Collections.Generic; |
29 | using System.Text; | 29 | using System.Text; |
30 | using System.Runtime.InteropServices; | ||
30 | using OMV = OpenMetaverse; | 31 | using OMV = OpenMetaverse; |
31 | 32 | ||
32 | namespace OpenSim.Region.PhysicsModule.BulletS | 33 | namespace 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. |