// Release all the terrain structures we might have allocated public void ReleaseGroundPlaneAndTerrain() { if (m_groundPlane.HasPhysicalBody) { if (BulletSimAPI.RemoveObjectFromWorld2(PhysicsScene.World.ptr, m_groundPlane.ptr)) { BulletSimAPI.DestroyObject2(PhysicsScene.World.ptr, m_groundPlane.ptr); } m_groundPlane.Clear(); } ReleaseTerrain(); }