Enable MPR by default
Add the contact point from MPR, in addition to SAT/clipping contacts. Added a new kernel to clear/reset the number of contacts in pairs (stored in the z component) Always sample unit sphere directions, if there are more edge-edge combinations than unit sphere directions (162 by default) Remember last running demo for Bullet 3 (and save it in a text file, Bullet Enable the testFileFracture.bullet in the Bullet2FileDemo
This commit is contained in:
@@ -24,6 +24,11 @@ static const char* solverUtilsCL= \
|
||||
"};\n"
|
||||
"#ifdef __cplusplus\n"
|
||||
"#else\n"
|
||||
"//keep B3_LARGE_FLOAT*B3_LARGE_FLOAT < FLT_MAX\n"
|
||||
"#define B3_LARGE_FLOAT 1e18f\n"
|
||||
"#define B3_INFINITY 1e18f\n"
|
||||
"#define b3Assert(a)\n"
|
||||
"#define b3ConstArray(a) __global const a*\n"
|
||||
"#define b3AtomicInc atomic_inc\n"
|
||||
"#define b3AtomicAdd atomic_add\n"
|
||||
"#define b3Fabs fabs\n"
|
||||
@@ -60,6 +65,29 @@ static const char* solverUtilsCL= \
|
||||
" return false;\n"
|
||||
" return true;\n"
|
||||
"}\n"
|
||||
"inline int b3MaxDot( b3Float4ConstArg vec, __global const b3Float4* vecArray, int vecLen, float* dotOut )\n"
|
||||
"{\n"
|
||||
" float maxDot = -B3_INFINITY;\n"
|
||||
" int i = 0;\n"
|
||||
" int ptIndex = -1;\n"
|
||||
" for( i = 0; i < vecLen; i++ )\n"
|
||||
" {\n"
|
||||
" float dot = b3Dot3F4(vecArray[i],vec);\n"
|
||||
" \n"
|
||||
" if( dot > maxDot )\n"
|
||||
" {\n"
|
||||
" maxDot = dot;\n"
|
||||
" ptIndex = i;\n"
|
||||
" }\n"
|
||||
" }\n"
|
||||
" b3Assert(ptIndex>=0);\n"
|
||||
" if (ptIndex<0)\n"
|
||||
" {\n"
|
||||
" ptIndex = 0;\n"
|
||||
" }\n"
|
||||
" *dotOut = maxDot;\n"
|
||||
" return ptIndex;\n"
|
||||
"}\n"
|
||||
"#endif //B3_FLOAT4_H\n"
|
||||
"typedef struct b3Contact4Data b3Contact4Data_t;\n"
|
||||
"struct b3Contact4Data\n"
|
||||
|
||||
Reference in New Issue
Block a user