finished RemoveHandle implementation
authorErwin Coumans <blender@erwincoumans.com>
Tue, 11 Apr 2006 02:48:34 +0000 (02:48 +0000)
committerErwin Coumans <blender@erwincoumans.com>
Tue, 11 Apr 2006 02:48:34 +0000 (02:48 +0000)
extern/bullet/Bullet/BroadphaseCollision/AxisSweep3.cpp

index 52410b2689b5ee99dba82af8d423c71c924de13d..000db0169b7b8677c4df270daa929ef18a225b85 100644 (file)
@@ -24,6 +24,7 @@
 BroadphaseProxy*       AxisSweep3::CreateProxy(  const SimdVector3& min,  const SimdVector3& max,int shapeType,void* userPtr )
 {
                unsigned short handleId = AddHandle(min,max, userPtr);
+               
                Handle* handle = GetHandle(handleId);
                return handle;
 }
@@ -204,26 +205,33 @@ void AxisSweep3::RemoveHandle(unsigned short handle)
 
        RemoveOverlappingPairsContainingProxy(pHandle);
 
-       
 
-//     assert(false);  // TODO
        // compute current limit of edge arrays
-/*     int limit = m_numHandles * 2;
-
+       int limit = m_numHandles * 2;
+       
        // remove the edges by sorting them up to the end of the list
        for (int axis = 0; axis < 3; axis++)
        {
                Edge* pEdges = m_pEdges[axis];
+               int max = pHandle->m_maxEdges[axis];
+               pEdges[max].m_pos = 0xffff;
 
+               SortMaxUp(axis,max,false);
+               
                int i = pHandle->m_minEdges[axis];
-               int max = pHandle->m_maxEdges[axis];
+               pEdges[i].m_pos = 0xffff;
+
+               SortMinUp(axis,i,false);
+
+               pEdges[limit-1].m_handle = 0;
+               pEdges[limit-1].m_pos = 0xffff;
 
-               while (i < max)
-                       pEdges[i - 1]
        }
-*/
+
        // free the handle
        FreeHandle(handle);
+
+       
 }
 
 bool AxisSweep3::TestOverlap(int ignoreAxis,const Handle* pHandleA, const Handle* pHandleB)