diff --git a/Demos3/BasicGpuDemo/BasicGpuDemo.cpp b/Demos3/BasicGpuDemo/BasicGpuDemo.cpp index 73dc48cc0..eff53d1ea 100644 --- a/Demos3/BasicGpuDemo/BasicGpuDemo.cpp +++ b/Demos3/BasicGpuDemo/BasicGpuDemo.cpp @@ -15,9 +15,9 @@ subject to the following restrictions: ///create 125 (5x5x5) dynamic object -#define ARRAY_SIZE_X 30 +#define ARRAY_SIZE_X 25 #define ARRAY_SIZE_Y 20 -#define ARRAY_SIZE_Z 30 +#define ARRAY_SIZE_Z 25 //maximum number of objects (and allow user to shoot additional boxes) #define MAX_PROXIES (ARRAY_SIZE_X*ARRAY_SIZE_Y*ARRAY_SIZE_Z + 1024) @@ -164,7 +164,7 @@ void BasicGpuDemo::exitCL() BasicGpuDemo::BasicGpuDemo() { m_clData = new btInternalData; - setCameraDistance(btScalar(SCALING*120.)); + setCameraDistance(btScalar(SCALING*60.)); this->setAzi(45); this->setEle(45); @@ -181,8 +181,8 @@ BasicGpuDemo::~BasicGpuDemo() void BasicGpuDemo::initPhysics() { setTexturing(true); - setShadows(true); - + setShadows(false);//too slow with many objects + ///collision configuration contains default setup for memory, collision setup m_collisionConfiguration = 0; diff --git a/src/Bullet3OpenCL/RigidBody/b3GpuRigidBodyPipeline.cpp b/src/Bullet3OpenCL/RigidBody/b3GpuRigidBodyPipeline.cpp index 4f5f98812..dcdc0123f 100644 --- a/src/Bullet3OpenCL/RigidBody/b3GpuRigidBodyPipeline.cpp +++ b/src/Bullet3OpenCL/RigidBody/b3GpuRigidBodyPipeline.cpp @@ -19,7 +19,7 @@ #define B3_RIGIDBODY_UPDATEAABB_PATH "src/Bullet3OpenCL/RigidBody/kernels/updateAabbsKernel.cl" bool useDbvt = false; -bool useBullet2CpuSolver = false;//false; +bool useBullet2CpuSolver = true; bool dumpContactStats = false; #ifdef TEST_OTHER_GPU_SOLVER @@ -200,7 +200,8 @@ void b3GpuRigidBodyPipeline::stepSimulation(float deltaTime) b3OpenCLArray gpuContacts(m_data->m_context,m_data->m_queue,0,true); gpuContacts.setFromOpenCLBuffer(m_data->m_narrowphase->getContactsGpu(),m_data->m_narrowphase->getNumContactsGpu()); - if (useBullet2CpuSolver) + int numJoints = m_data->m_joints.size(); + if (useBullet2CpuSolver && numJoints) { b3AlignedObjectArray hostBodies; @@ -210,7 +211,6 @@ void b3GpuRigidBodyPipeline::stepSimulation(float deltaTime) b3AlignedObjectArray hostContacts; gpuContacts.copyToHost(hostContacts); { - int numJoints = m_data->m_joints.size(); b3TypedConstraint** joints = numJoints? &m_data->m_joints[0] : 0; b3Contact4* contacts = numContacts? &hostContacts[0]: 0; // m_data->m_solver->solveContacts(m_data->m_narrowphase->getNumBodiesGpu(),&hostBodies[0],&hostInertias[0],numContacts,contacts,numJoints, joints);