move some files to shared folders

use b3Aabb for compound vs compound on host (for testing, towards BVH)
This commit is contained in:
erwin coumans
2013-08-14 17:48:12 -07:00
parent 678f634699
commit b32ae0c75c
36 changed files with 1633 additions and 835 deletions

View File

@@ -698,7 +698,7 @@ const struct b3Collidable* b3GpuNarrowPhase::getCollidablesCpu() const
}
cl_mem b3GpuNarrowPhase::getAabbBufferGpu()
cl_mem b3GpuNarrowPhase::getAabbLocalSpaceBufferGpu()
{
return m_data->m_localShapeAABBGPU->getBufferCL();
}
@@ -726,8 +726,11 @@ const b3Contact4* b3GpuNarrowPhase::getContactsCPU() const
return &m_data->m_pBufContactOutCPU->at(0);
}
void b3GpuNarrowPhase::computeContacts(cl_mem broadphasePairs, int numBroadphasePairs, cl_mem aabbsWS, int numObjects)
void b3GpuNarrowPhase::computeContacts(cl_mem broadphasePairs, int numBroadphasePairs, cl_mem aabbsWorldSpace, int numObjects)
{
cl_mem aabbsLocalSpace = m_data->m_localShapeAABBGPU->getBufferCL();
int nContactOut = 0;
//swap buffer
@@ -744,8 +747,11 @@ void b3GpuNarrowPhase::computeContacts(cl_mem broadphasePairs, int numBroadphase
b3OpenCLArray<b3YetAnotherAabb> clAabbArray(this->m_context,this->m_queue);
clAabbArray.setFromOpenCLBuffer(aabbsWS,numObjects);
b3OpenCLArray<b3Aabb> clAabbArrayWorldSpace(this->m_context,this->m_queue);
clAabbArrayWorldSpace.setFromOpenCLBuffer(aabbsWorldSpace,numObjects);
b3OpenCLArray<b3Aabb> clAabbArrayLocalSpace(this->m_context,this->m_queue);
clAabbArrayLocalSpace.setFromOpenCLBuffer(aabbsLocalSpace,numObjects);
m_data->m_gpuSatCollision->computeConvexConvexContactsGPUSAT(
&broadphasePairsGPU, numBroadphasePairs,
@@ -762,7 +768,8 @@ void b3GpuNarrowPhase::computeContacts(cl_mem broadphasePairs, int numBroadphase
*m_data->m_convexIndicesGPU,
*m_data->m_collidablesGPU,
*m_data->m_gpuChildShapes,
clAabbArray,
clAabbArrayWorldSpace,
clAabbArrayLocalSpace,
*m_data->m_worldVertsB1GPU,
*m_data->m_clippingFacesOutGPU,
*m_data->m_worldNormalsAGPU,

View File

@@ -1,7 +1,7 @@
#ifndef B3_GPU_NARROWPHASE_H
#define B3_GPU_NARROWPHASE_H
#include "Bullet3OpenCL/NarrowphaseCollision/b3Collidable.h"
#include "Bullet3Collision/NarrowPhaseCollision/shared/b3Collidable.h"
#include "Bullet3OpenCL/Initialize/b3OpenCLInclude.h"
#include "Bullet3Common/b3AlignedObjectArray.h"
#include "Bullet3Common/b3Vector3.h"
@@ -56,7 +56,7 @@ public:
void setObjectVelocityCpu(float* linVel, float* angVel, int bodyIndex);
virtual void computeContacts(cl_mem broadphasePairs, int numBroadphasePairs, cl_mem aabbs, int numObjects);
virtual void computeContacts(cl_mem broadphasePairs, int numBroadphasePairs, cl_mem aabbsWorldSpace, int numObjects);
cl_mem getBodiesGpu();
@@ -78,7 +78,7 @@ public:
cl_mem getContactsGpu();
int getNumContactsGpu() const;
cl_mem getAabbBufferGpu();
cl_mem getAabbLocalSpaceBufferGpu();
int getNumRigidBodies() const;

View File

@@ -5,7 +5,8 @@
#include "Bullet3OpenCL/ParallelPrimitives/b3OpenCLArray.h"
#include "Bullet3OpenCL/NarrowphaseCollision/b3ConvexPolyhedronCL.h"
#include "b3Config.h"
#include "Bullet3OpenCL/NarrowphaseCollision/b3Collidable.h"
#include "Bullet3Collision/NarrowPhaseCollision/shared/b3Collidable.h"
#include "Bullet3OpenCL/Initialize/b3OpenCLInclude.h"
#include "Bullet3Common/b3AlignedObjectArray.h"
#include "Bullet3Common/b3Vector3.h"
@@ -16,8 +17,8 @@
#include "Bullet3OpenCL/NarrowphaseCollision/b3QuantizedBvh.h"
#include "Bullet3OpenCL/NarrowphaseCollision/b3BvhInfo.h"
#include "Bullet3Common/b3Int4.h"
#include "Bullet3Common/b3Int2.h"
#include "Bullet3Common/shared/b3Int4.h"
#include "Bullet3Common/shared/b3Int2.h"
class b3ConvexUtility;

View File

@@ -450,7 +450,7 @@ void b3GpuRigidBodyPipeline::setupGpuAabbsFull()
launcher.setBuffer(bodies);
cl_mem collidables = m_data->m_narrowphase->getCollidablesGpu();
launcher.setBuffer(collidables);
cl_mem localAabbs = m_data->m_narrowphase->getAabbBufferGpu();
cl_mem localAabbs = m_data->m_narrowphase->getAabbLocalSpaceBufferGpu();
launcher.setBuffer(localAabbs);
cl_mem worldAabbs =0;

View File

@@ -20,7 +20,8 @@ subject to the following restrictions:
#include "Bullet3Common/b3AlignedObjectArray.h"
#include "Bullet3OpenCL/ParallelPrimitives/b3OpenCLArray.h"
#include "Bullet3OpenCL/NarrowphaseCollision/b3Collidable.h"
#include "Bullet3Collision/NarrowPhaseCollision/shared/b3Collidable.h"
#include "Bullet3OpenCL/BroadphaseCollision/b3SapAabb.h"
#include "Bullet3Dynamics/ConstraintSolver/b3TypedConstraint.h"

View File

@@ -22,9 +22,13 @@ static const char* batchingKernelsCL= \
"{\n"
" int bla;\n"
"};\n"
"#ifdef __cplusplus\n"
"#else\n"
"#define b3AtomicInc atomic_inc\n"
"#endif\n"
"#endif\n"
"#ifdef __cplusplus\n"
"#else//bla\n"
"#else\n"
" typedef float4 b3Float4;\n"
"#endif \n"
"#endif //B3_FLOAT4_H\n"

View File

@@ -22,9 +22,13 @@ static const char* batchingKernelsNewCL= \
"{\n"
" int bla;\n"
"};\n"
"#ifdef __cplusplus\n"
"#else\n"
"#define b3AtomicInc atomic_inc\n"
"#endif\n"
"#endif\n"
"#ifdef __cplusplus\n"
"#else//bla\n"
"#else\n"
" typedef float4 b3Float4;\n"
"#endif \n"
"#endif //B3_FLOAT4_H\n"

View File

@@ -22,9 +22,13 @@ static const char* solverSetupCL= \
"{\n"
" int bla;\n"
"};\n"
"#ifdef __cplusplus\n"
"#else\n"
"#define b3AtomicInc atomic_inc\n"
"#endif\n"
"#endif\n"
"#ifdef __cplusplus\n"
"#else//bla\n"
"#else\n"
" typedef float4 b3Float4;\n"
"#endif \n"
"#endif //B3_FLOAT4_H\n"

View File

@@ -22,9 +22,13 @@ static const char* solverSetup2CL= \
"{\n"
" int bla;\n"
"};\n"
"#ifdef __cplusplus\n"
"#else\n"
"#define b3AtomicInc atomic_inc\n"
"#endif\n"
"#endif\n"
"#ifdef __cplusplus\n"
"#else//bla\n"
"#else\n"
" typedef float4 b3Float4;\n"
"#endif \n"
"#endif //B3_FLOAT4_H\n"

View File

@@ -22,9 +22,13 @@ static const char* solverUtilsCL= \
"{\n"
" int bla;\n"
"};\n"
"#ifdef __cplusplus\n"
"#else\n"
"#define b3AtomicInc atomic_inc\n"
"#endif\n"
"#endif\n"
"#ifdef __cplusplus\n"
"#else//bla\n"
"#else\n"
" typedef float4 b3Float4;\n"
"#endif \n"
"#endif //B3_FLOAT4_H\n"