Universe.Physics.BulletSPlugin.BSTerrainHeightmap.ReleaseHeightMapTerrain C# (CSharp) Method

ReleaseHeightMapTerrain() static private method

static private ReleaseHeightMapTerrain ( ) : void
return void
        void ReleaseHeightMapTerrain()
        {
            if (m_mapInfo != null)
            {
                if (m_mapInfo.terrainBody.HasPhysicalBody)
                {
                    PhysicsScene.PE.RemoveObjectFromWorld(PhysicsScene.World, m_mapInfo.terrainBody);
                    // Frees both the body and the shape.
                    PhysicsScene.PE.DestroyObject(PhysicsScene.World, m_mapInfo.terrainBody);
                }
            }
            m_mapInfo = null;
        }