added pgs/jacobi cpu solver making the gpu rigid body pipeline work again (aside from running the solver on CPU)

This commit is contained in:
erwin coumans
2013-03-15 18:44:55 -07:00
parent d49e9fd44d
commit d91d18b5f5
24 changed files with 5154 additions and 95 deletions

View File

@@ -48,9 +48,9 @@ static const char* integrateKernelCL= \
"{\n"
" int nodeID = get_global_id(0);\n"
" float BT_GPU_ANGULAR_MOTION_THRESHOLD = (0.25f * 3.14159254f);\n"
" if( nodeID < numNodes )\n"
" if( nodeID < numNodes && (bodies[nodeID].m_invMass != 0.f))\n"
" {\n"
" if (1)\n"
" //angular velocity\n"
" {\n"
" float4 axis;\n"
" //add some hardcoded angular damping\n"
@@ -84,9 +84,13 @@ static const char* integrateKernelCL= \
" bodies[nodeID].m_quat=predictedOrn;\n"
" }\n"
"\n"
" //linear velocity \n"
" //linear velocity \n"
" bodies[nodeID].m_pos += bodies[nodeID].m_linVel * timeStep;\n"
" \n"
" //apply gravity\n"
" float4 gravityAcceleration = (float4)(0.f,-9.8f,0.f,0.f);\n"
" bodies[nodeID].m_linVel += gravityAcceleration * timeStep;\n"
" \n"
" }\n"
"}\n"
"\n"