From 9396ccc078516023d63b5a86b3262ff97a1e97fb Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Mon, 31 Dec 2012 16:54:39 -0800 Subject: BulletSim: eliminate the use of the unmanaged HeightMapInfo structure. Remove all related calls from the unmanaged and BSAPITemplate interfaces. Update DLLs and SOs to include the version without HeightMapInfo structures. --- OpenSim/Region/Physics/BulletSPlugin/BSTerrainHeightmap.cs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSTerrainHeightmap.cs') diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSTerrainHeightmap.cs b/OpenSim/Region/Physics/BulletSPlugin/BSTerrainHeightmap.cs index 0802b3a..114c0aa 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSTerrainHeightmap.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSTerrainHeightmap.cs @@ -58,7 +58,7 @@ public sealed class BSTerrainHeightmap : BSTerrainPhys { initialMap[ii] = BSTerrainManager.HEIGHT_INITIALIZATION; } - m_mapInfo = new BulletHMapInfo(id, initialMap, IntPtr.Zero); + m_mapInfo = new BulletHMapInfo(id, initialMap); m_mapInfo.minCoords = minTerrainCoords; m_mapInfo.maxCoords = maxTerrainCoords; m_mapInfo.terrainRegionBase = TerrainBase; @@ -72,7 +72,7 @@ public sealed class BSTerrainHeightmap : BSTerrainPhys Vector3 minCoords, Vector3 maxCoords) : base(physicsScene, regionBase, id) { - m_mapInfo = new BulletHMapInfo(id, initialMap, IntPtr.Zero); + m_mapInfo = new BulletHMapInfo(id, initialMap); m_mapInfo.minCoords = minCoords; m_mapInfo.maxCoords = maxCoords; m_mapInfo.minZ = minCoords.Z; @@ -91,12 +91,11 @@ public sealed class BSTerrainHeightmap : BSTerrainPhys // Using the information in m_mapInfo, create the physical representation of the heightmap. private void BuildHeightmapTerrain() { - m_mapInfo.ptr = PhysicsScene.PE.CreateHeightMapInfo(PhysicsScene.World, m_mapInfo.ID, - m_mapInfo.minCoords, m_mapInfo.maxCoords, - m_mapInfo.heightMap, BSParam.TerrainCollisionMargin); - // Create the terrain shape from the mapInfo - m_mapInfo.terrainShape = PhysicsScene.PE.CreateTerrainShape(m_mapInfo.ptr); + m_mapInfo.terrainShape = PhysicsScene.PE.CreateTerrainShape( m_mapInfo.ID, + new Vector3(m_mapInfo.sizeX, m_mapInfo.sizeY, 0), m_mapInfo.minZ, m_mapInfo.maxZ, + m_mapInfo.heightMap, 1f, BSParam.TerrainCollisionMargin); + // The terrain object initial position is at the center of the object Vector3 centerPos; @@ -138,7 +137,6 @@ public sealed class BSTerrainHeightmap : BSTerrainPhys PhysicsScene.PE.RemoveObjectFromWorld(PhysicsScene.World, m_mapInfo.terrainBody); // Frees both the body and the shape. PhysicsScene.PE.DestroyObject(PhysicsScene.World, m_mapInfo.terrainBody); - PhysicsScene.PE.ReleaseHeightMapInfo(m_mapInfo.ptr); } } m_mapInfo = null; -- cgit v1.1