add re-usable createGraphicsSphere method in GpuDemo.

introduce and use maxContactCapacity (needs to be fixed in various other contact kernels)
implement sphere versus trimesh
disable new/sequential GPU batching (only uses 1 thread in a warp, slow but works on NVIDIA/Apple OpenCL)
This commit is contained in:
erwin coumans
2013-04-04 17:54:45 -07:00
parent 733572e625
commit 358f4f97a2
15 changed files with 1008 additions and 139 deletions

View File

@@ -7,6 +7,7 @@ static const char* bvhTraversalKernelCL= \
"#define SHAPE_CONCAVE_TRIMESH 5\n"
"#define TRIANGLE_NUM_CONVEX_FACES 5\n"
"#define SHAPE_COMPOUND_OF_CONVEX_HULLS 6\n"
"#define SHAPE_SPHERE 7\n"
"\n"
"typedef unsigned int u32;\n"
"\n"
@@ -213,9 +214,13 @@ static const char* bvhTraversalKernelCL= \
" if (collidables[collidableIndexA].m_shapeType!=SHAPE_CONCAVE_TRIMESH)\n"
" return;\n"
"\n"
" if (collidables[collidableIndexB].m_shapeType!=SHAPE_CONVEX_HULL)\n"
" int shapeTypeB = collidables[collidableIndexB].m_shapeType;\n"
" \n"
" if (shapeTypeB!=SHAPE_CONVEX_HULL &&\n"
" shapeTypeB!=SHAPE_SPHERE )\n"
" return;\n"
"\n"
" \n"
" unsigned short int quantizedQueryAabbMin[3];\n"
" unsigned short int quantizedQueryAabbMax[3];\n"
" quantizeWithClamp(quantizedQueryAabbMin,aabbs[bodyIndexB].m_min,false,bvhAabbMin, bvhAabbMax,bvhQuantization);\n"