aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/PhysicsModules/BulletS/BulletSimData.cs
diff options
context:
space:
mode:
authorUbitUmarov2018-10-03 21:17:23 +0100
committerUbitUmarov2018-10-03 21:17:23 +0100
commit1bcdcc2419b9b4f9c64db740f71bacfb8cd02127 (patch)
tree7d372391fe013f00d58394d8b145c904e0e2df7c /OpenSim/Region/PhysicsModules/BulletS/BulletSimData.cs
parentmissed new c# version only code (diff)
downloadopensim-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-xOpenSim/Region/PhysicsModules/BulletS/BulletSimData.cs10
1 files changed, 9 insertions, 1 deletions
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.