Example #1
0
 public void UnloadData()
 {
     if (!m_meshShape.Base.IsZero)
     {
         MyPhysics.AssertThread();
         Debug.Assert(m_meshShape.Base.ReferenceCount > 0);
         m_meshShape.Base.RemoveReference();
     }
     m_meshShape = (HkBvCompressedMeshShape)HkShape.Empty;
 }
Example #2
0
            //  This methods needs to be called after every cell cache released!! It releases vertex buffer. It's important,
            //  because when this cell cache will be associated to a new cell, not same material vertex buffer will be used so unused needs to be disposed!!
            public void Reset()
            {
                using (m_syncRoot.AcquireExclusiveUsing())
                {
                    if (!m_meshShape.Base.IsZero)
                    {
                        MyPhysics.AssertThread();
                        Debug.Assert(m_meshShape.Base.ReferenceCount > 0);
                        m_meshShape.Base.RemoveReference();
                    }
                    m_meshShape = (HkBvCompressedMeshShape)HkShape.Empty;

                    VoxelTrianglesCount = 0;
                    VoxelTriangles      = null;
                    m_octree            = null;

                    VoxelVerticesCount = 0;
                    m_voxelVertices    = null;
                    Key = INVALID_KEY;

                    m_octree = null;
                }
            }