|
|
|
|
@@ -17,8 +17,6 @@ static const char* mprKernelsCL= \
|
|
|
|
|
" */\n"
|
|
|
|
|
"#ifndef B3_MPR_PENETRATION_H\n"
|
|
|
|
|
"#define B3_MPR_PENETRATION_H\n"
|
|
|
|
|
"#ifndef B3_FLOAT4_H\n"
|
|
|
|
|
"#define B3_FLOAT4_H\n"
|
|
|
|
|
"#ifndef B3_PLATFORM_DEFINITIONS_H\n"
|
|
|
|
|
"#define B3_PLATFORM_DEFINITIONS_H\n"
|
|
|
|
|
"struct MyTest\n"
|
|
|
|
|
@@ -38,6 +36,14 @@ static const char* mprKernelsCL= \
|
|
|
|
|
"#define b3Sqrt native_sqrt\n"
|
|
|
|
|
"#define b3Sin native_sin\n"
|
|
|
|
|
"#define b3Cos native_cos\n"
|
|
|
|
|
"#define B3_STATIC\n"
|
|
|
|
|
"#endif\n"
|
|
|
|
|
"#endif\n"
|
|
|
|
|
"#ifndef B3_FLOAT4_H\n"
|
|
|
|
|
"#define B3_FLOAT4_H\n"
|
|
|
|
|
"#ifndef B3_PLATFORM_DEFINITIONS_H\n"
|
|
|
|
|
"#ifdef __cplusplus\n"
|
|
|
|
|
"#else\n"
|
|
|
|
|
"#endif\n"
|
|
|
|
|
"#endif\n"
|
|
|
|
|
"#ifdef __cplusplus\n"
|
|
|
|
|
@@ -509,7 +515,7 @@ static const char* mprKernelsCL= \
|
|
|
|
|
" }\n"
|
|
|
|
|
" return supVec;\n"
|
|
|
|
|
"}\n"
|
|
|
|
|
"static void b3MprConvexSupport(int pairIndex,int bodyIndex, b3ConstArray(b3RigidBodyData_t) cpuBodyBuf, \n"
|
|
|
|
|
"B3_STATIC void b3MprConvexSupport(int pairIndex,int bodyIndex, b3ConstArray(b3RigidBodyData_t) cpuBodyBuf, \n"
|
|
|
|
|
" b3ConstArray(b3ConvexPolyhedronData_t) cpuConvexData, \n"
|
|
|
|
|
" b3ConstArray(b3Collidable_t) cpuCollidables,\n"
|
|
|
|
|
" b3ConstArray(b3Float4) cpuVertices,\n"
|
|
|
|
|
@@ -682,7 +688,7 @@ static const char* mprKernelsCL= \
|
|
|
|
|
" }\n"
|
|
|
|
|
" }\n"
|
|
|
|
|
"}\n"
|
|
|
|
|
"static int b3DiscoverPortal(int pairIndex, int bodyIndexA, int bodyIndexB, b3ConstArray(b3RigidBodyData_t) cpuBodyBuf, \n"
|
|
|
|
|
"B3_STATIC int b3DiscoverPortal(int pairIndex, int bodyIndexA, int bodyIndexB, b3ConstArray(b3RigidBodyData_t) cpuBodyBuf, \n"
|
|
|
|
|
" b3ConstArray(b3ConvexPolyhedronData_t) cpuConvexData, \n"
|
|
|
|
|
" b3ConstArray(b3Collidable_t) cpuCollidables,\n"
|
|
|
|
|
" b3ConstArray(b3Float4) cpuVertices,\n"
|
|
|
|
|
@@ -792,7 +798,7 @@ static const char* mprKernelsCL= \
|
|
|
|
|
" }\n"
|
|
|
|
|
" return 0;\n"
|
|
|
|
|
"}\n"
|
|
|
|
|
"static int b3RefinePortal(int pairIndex,int bodyIndexA, int bodyIndexB, b3ConstArray(b3RigidBodyData_t) cpuBodyBuf, \n"
|
|
|
|
|
"B3_STATIC int b3RefinePortal(int pairIndex,int bodyIndexA, int bodyIndexB, b3ConstArray(b3RigidBodyData_t) cpuBodyBuf, \n"
|
|
|
|
|
" b3ConstArray(b3ConvexPolyhedronData_t) cpuConvexData, \n"
|
|
|
|
|
" b3ConstArray(b3Collidable_t) cpuCollidables,\n"
|
|
|
|
|
" b3ConstArray(b3Float4) cpuVertices,\n"
|
|
|
|
|
@@ -826,7 +832,7 @@ static const char* mprKernelsCL= \
|
|
|
|
|
" }\n"
|
|
|
|
|
" return -1;\n"
|
|
|
|
|
"}\n"
|
|
|
|
|
"static void b3FindPos(const b3MprSimplex_t *portal, b3Float4 *pos)\n"
|
|
|
|
|
"B3_STATIC void b3FindPos(const b3MprSimplex_t *portal, b3Float4 *pos)\n"
|
|
|
|
|
"{\n"
|
|
|
|
|
" b3Float4 zero = b3MakeFloat4(0,0,0,0);\n"
|
|
|
|
|
" b3Float4* b3mpr_vec3_origin = &zero;\n"
|
|
|
|
|
@@ -1000,7 +1006,7 @@ static const char* mprKernelsCL= \
|
|
|
|
|
" }\n"
|
|
|
|
|
" return dist;\n"
|
|
|
|
|
"}\n"
|
|
|
|
|
"static void b3FindPenetr(int pairIndex,int bodyIndexA, int bodyIndexB, b3ConstArray(b3RigidBodyData_t) cpuBodyBuf, \n"
|
|
|
|
|
"B3_STATIC void b3FindPenetr(int pairIndex,int bodyIndexA, int bodyIndexB, b3ConstArray(b3RigidBodyData_t) cpuBodyBuf, \n"
|
|
|
|
|
" b3ConstArray(b3ConvexPolyhedronData_t) cpuConvexData, \n"
|
|
|
|
|
" b3ConstArray(b3Collidable_t) cpuCollidables,\n"
|
|
|
|
|
" b3ConstArray(b3Float4) cpuVertices,\n"
|
|
|
|
|
@@ -1043,7 +1049,7 @@ static const char* mprKernelsCL= \
|
|
|
|
|
" iterations++;\n"
|
|
|
|
|
" }\n"
|
|
|
|
|
"}\n"
|
|
|
|
|
"static void b3FindPenetrTouch(b3MprSimplex_t *portal,float *depth, b3Float4 *dir, b3Float4 *pos)\n"
|
|
|
|
|
"B3_STATIC void b3FindPenetrTouch(b3MprSimplex_t *portal,float *depth, b3Float4 *dir, b3Float4 *pos)\n"
|
|
|
|
|
"{\n"
|
|
|
|
|
" // Touching contact on portal's v1 - so depth is zero and direction\n"
|
|
|
|
|
" // is unimportant and pos can be guessed\n"
|
|
|
|
|
@@ -1055,7 +1061,7 @@ static const char* mprKernelsCL= \
|
|
|
|
|
" b3MprVec3Add(pos, &b3MprSimplexPoint(portal, 1)->v2);\n"
|
|
|
|
|
" b3MprVec3Scale(pos, 0.5);\n"
|
|
|
|
|
"}\n"
|
|
|
|
|
"static void b3FindPenetrSegment(b3MprSimplex_t *portal,\n"
|
|
|
|
|
"B3_STATIC void b3FindPenetrSegment(b3MprSimplex_t *portal,\n"
|
|
|
|
|
" float *depth, b3Float4 *dir, b3Float4 *pos)\n"
|
|
|
|
|
"{\n"
|
|
|
|
|
" \n"
|
|
|
|
|
|