more work towards GPU Jacobi solver.

Not fully working yet, GPU version shows explosion at high iteration count.
This commit is contained in:
erwin coumans
2013-03-27 21:40:26 -07:00
parent 2133712207
commit a1aa281622
7 changed files with 441 additions and 661 deletions

View File

@@ -111,13 +111,13 @@ void btGpuRigidBodyPipeline::stepSimulation(float deltaTime)
btOpenCLArray<btContact4> gpuContacts(m_data->m_context,m_data->m_queue,0,true);
gpuContacts.setFromOpenCLBuffer(m_data->m_narrowphase->getContactsGpu(),m_data->m_narrowphase->getNumContactsGpu());
bool useJacobi = true;
bool useJacobi = false;
if (useJacobi)
{
bool useGpu = true;
if (useGpu)
{
bool forceHost = true;
bool forceHost = false;
if (forceHost)
{
btAlignedObjectArray<btRigidBodyCL> hostBodies;
@@ -133,8 +133,7 @@ void btGpuRigidBodyPipeline::stepSimulation(float deltaTime)
{
btJacobiSolverInfo solverInfo;
// m_data->m_solver3->solveGroupHost(&hostBodies[0], &hostInertias[0], hostBodies.size(),&hostContacts[0],hostContacts.size(),0,0,solverInfo);
m_data->m_solver3->solveGroupMixedHost(&hostBodies[0], &hostInertias[0], hostBodies.size(),&hostContacts[0],hostContacts.size(),0,0,solverInfo);
m_data->m_solver3->solveGroupHost(&hostBodies[0], &hostInertias[0], hostBodies.size(),&hostContacts[0],hostContacts.size(),0,0,solverInfo);
}