add gjk/epa (host only), possibly improve convex-convex with many edge-edge tests
more preparation towards persistent/incremental contact cache
This commit is contained in:
@@ -599,7 +599,7 @@ static const char* primitiveContactsKernelsCL= \
|
||||
"\n"
|
||||
"#define MAX_PLANE_CONVEX_POINTS 64\n"
|
||||
"\n"
|
||||
"void computeContactPlaneConvex(int pairIndex,\n"
|
||||
"int computeContactPlaneConvex(int pairIndex,\n"
|
||||
" int bodyIndexA, int bodyIndexB, \n"
|
||||
" int collidableIndexA, int collidableIndexB, \n"
|
||||
" __global const BodyData* rigidBodies, \n"
|
||||
@@ -615,6 +615,7 @@ static const char* primitiveContactsKernelsCL= \
|
||||
" Quaternion ornB\n"
|
||||
" )\n"
|
||||
"{\n"
|
||||
" int resultIndex=-1;\n"
|
||||
"\n"
|
||||
" int shapeIndex = collidables[collidableIndexB].m_shapeIndex;\n"
|
||||
" __global const ConvexPolyhedronCL* hullB = &convexShapes[shapeIndex];\n"
|
||||
@@ -708,6 +709,7 @@ static const char* primitiveContactsKernelsCL= \
|
||||
"\n"
|
||||
" if (dstIdx < maxContactCapacity)\n"
|
||||
" {\n"
|
||||
" resultIndex = dstIdx;\n"
|
||||
" __global Contact4* c = &globalContactsOut[dstIdx];\n"
|
||||
" c->m_worldNormal = planeNormalWorld;\n"
|
||||
" //c->setFrictionCoeff(0.7);\n"
|
||||
@@ -737,6 +739,8 @@ static const char* primitiveContactsKernelsCL= \
|
||||
" GET_NPOINTS(*c) = numReducedPoints;\n"
|
||||
" }//if (dstIdx < numPairs)\n"
|
||||
" } \n"
|
||||
"\n"
|
||||
" return resultIndex;\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"\n"
|
||||
@@ -804,7 +808,7 @@ static const char* primitiveContactsKernelsCL= \
|
||||
"}\n"
|
||||
"\n"
|
||||
"\n"
|
||||
"__kernel void primitiveContactsKernel( __global const int4* pairs, \n"
|
||||
"__kernel void primitiveContactsKernel( __global int4* pairs, \n"
|
||||
" __global const BodyData* rigidBodies, \n"
|
||||
" __global const btCollidableGpu* collidables,\n"
|
||||
" __global const ConvexPolyhedronCL* convexShapes, \n"
|
||||
@@ -847,9 +851,12 @@ static const char* primitiveContactsKernelsCL= \
|
||||
" posB = rigidBodies[bodyIndexB].m_pos;\n"
|
||||
" Quaternion ornB;\n"
|
||||
" ornB = rigidBodies[bodyIndexB].m_quat;\n"
|
||||
" computeContactPlaneConvex(pairIndex, bodyIndexA, bodyIndexB, collidableIndexA, collidableIndexB, \n"
|
||||
" int contactIndex = computeContactPlaneConvex(pairIndex, bodyIndexA, bodyIndexB, collidableIndexA, collidableIndexB, \n"
|
||||
" rigidBodies,collidables,convexShapes,vertices,indices,\n"
|
||||
" faces, globalContactsOut, nGlobalContactsOut,maxContactCapacity, posB,ornB);\n"
|
||||
" if (contactIndex>=0)\n"
|
||||
" pairs[pairIndex].z = contactIndex;\n"
|
||||
"\n"
|
||||
" return;\n"
|
||||
" }\n"
|
||||
"\n"
|
||||
@@ -864,10 +871,13 @@ static const char* primitiveContactsKernelsCL= \
|
||||
" ornA = rigidBodies[bodyIndexA].m_quat;\n"
|
||||
"\n"
|
||||
"\n"
|
||||
" computeContactPlaneConvex( pairIndex, bodyIndexB,bodyIndexA, collidableIndexB,collidableIndexA, \n"
|
||||
" int contactIndex = computeContactPlaneConvex( pairIndex, bodyIndexB,bodyIndexA, collidableIndexB,collidableIndexA, \n"
|
||||
" rigidBodies,collidables,convexShapes,vertices,indices,\n"
|
||||
" faces, globalContactsOut, nGlobalContactsOut,maxContactCapacity,posA,ornA);\n"
|
||||
"\n"
|
||||
" if (contactIndex>=0)\n"
|
||||
" pairs[pairIndex].z = contactIndex;\n"
|
||||
"\n"
|
||||
" return;\n"
|
||||
" }\n"
|
||||
"\n"
|
||||
|
||||
Reference in New Issue
Block a user