From 9df85eadf4b3719a898fda8769313ae023962c25 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Mon, 10 Dec 2012 15:35:53 -0800 Subject: BulletSim: Fix crash on the destruction of physical linksets. While fixing the above, add methods to physical body and shape pointer wrapper so routines won't have to know that IntPtr.Zero means no physical instance. Fix problem with physical linksets failing after a few sits and unsits by properly restoring child prom positions for compound linksets after multiple selection and deselections. --- OpenSim/Region/Physics/BulletSPlugin/BSTerrainManager.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSTerrainManager.cs') diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSTerrainManager.cs b/OpenSim/Region/Physics/BulletSPlugin/BSTerrainManager.cs index 83df360..c28d69d 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSTerrainManager.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSTerrainManager.cs @@ -151,13 +151,13 @@ public sealed class BSTerrainManager // Release all the terrain structures we might have allocated public void ReleaseGroundPlaneAndTerrain() { - if (m_groundPlane.ptr != IntPtr.Zero) + if (m_groundPlane.HasPhysicalBody) { if (BulletSimAPI.RemoveObjectFromWorld2(PhysicsScene.World.ptr, m_groundPlane.ptr)) { BulletSimAPI.DestroyObject2(PhysicsScene.World.ptr, m_groundPlane.ptr); } - m_groundPlane.ptr = IntPtr.Zero; + m_groundPlane.Clear(); } ReleaseTerrain(); -- cgit v1.1