Logo Search packages:      
Sourcecode: blender version File versions  Download package

template<typename BP_FP_INT_TYPE>
void btAxisSweep3Internal< BP_FP_INT_TYPE >::removeHandle ( BP_FP_INT_TYPE  handle,
btDispatcher dispatcher 
) [inline]

Todo:
: compare performance

Definition at line 534 of file btAxisSweep3.h.

References btOverlappingPairCache::hasDeferredRemoval(), and btOverlappingPairCallback::removeOverlappingPairsContainingProxy().

{

      Handle* pHandle = getHandle(handle);

      //explicitly remove the pairs containing the proxy
      //we could do it also in the sortMinUp (passing true)
      ///@todo: compare performance
      if (!m_pairCache->hasDeferredRemoval())
      {
            m_pairCache->removeOverlappingPairsContainingProxy(pHandle,dispatcher);
      }

      // compute current limit of edge arrays
      int limit = static_cast<int>(m_numHandles * 2);
      
      int axis;

      for (axis = 0;axis<3;axis++)
      {
            m_pHandles[0].m_maxEdges[axis] -= 2;
      }

      // remove the edges by sorting them up to the end of the list
      for ( axis = 0; axis < 3; axis++)
      {
            Edge* pEdges = m_pEdges[axis];
            BP_FP_INT_TYPE max = pHandle->m_maxEdges[axis];
            pEdges[max].m_pos = m_handleSentinel;

            sortMaxUp(axis,max,dispatcher,false);


            BP_FP_INT_TYPE i = pHandle->m_minEdges[axis];
            pEdges[i].m_pos = m_handleSentinel;


            sortMinUp(axis,i,dispatcher,false);

            pEdges[limit-1].m_handle = 0;
            pEdges[limit-1].m_pos = m_handleSentinel;
            
#ifdef DEBUG_BROADPHASE
                  debugPrintAxis(axis,false);
#endif //DEBUG_BROADPHASE


      }


      // free the handle
      freeHandle(handle);

      
}


Generated by  Doxygen 1.6.0   Back to index