2017-08-01 14:30:58 +02:00
|
|
|
|
|
|
|
#ifndef B3_GPU_BROADPHASE_INTERFACE_H
|
|
|
|
#define B3_GPU_BROADPHASE_INTERFACE_H
|
|
|
|
|
|
|
|
#include "Bullet3OpenCL/Initialize/b3OpenCLInclude.h"
|
|
|
|
#include "Bullet3Common/b3Vector3.h"
|
|
|
|
#include "b3SapAabb.h"
|
|
|
|
#include "Bullet3Common/shared/b3Int2.h"
|
|
|
|
#include "Bullet3Common/shared/b3Int4.h"
|
|
|
|
#include "Bullet3OpenCL/ParallelPrimitives/b3OpenCLArray.h"
|
|
|
|
|
|
|
|
class b3GpuBroadphaseInterface
|
|
|
|
{
|
|
|
|
public:
|
2019-01-03 14:26:51 +01:00
|
|
|
typedef class b3GpuBroadphaseInterface*(CreateFunc)(cl_context ctx, cl_device_id device, cl_command_queue q);
|
2017-08-01 14:30:58 +02:00
|
|
|
|
|
|
|
virtual ~b3GpuBroadphaseInterface()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2019-01-03 14:26:51 +01:00
|
|
|
virtual void createProxy(const b3Vector3& aabbMin, const b3Vector3& aabbMax, int userPtr, int collisionFilterGroup, int collisionFilterMask) = 0;
|
|
|
|
virtual void createLargeProxy(const b3Vector3& aabbMin, const b3Vector3& aabbMax, int userPtr, int collisionFilterGroup, int collisionFilterMask) = 0;
|
2017-08-01 14:30:58 +02:00
|
|
|
|
2019-01-03 14:26:51 +01:00
|
|
|
virtual void calculateOverlappingPairs(int maxPairs) = 0;
|
|
|
|
virtual void calculateOverlappingPairsHost(int maxPairs) = 0;
|
2017-08-01 14:30:58 +02:00
|
|
|
|
|
|
|
//call writeAabbsToGpu after done making all changes (createProxy etc)
|
2019-01-03 14:26:51 +01:00
|
|
|
virtual void writeAabbsToGpu() = 0;
|
|
|
|
|
|
|
|
virtual cl_mem getAabbBufferWS() = 0;
|
|
|
|
virtual int getNumOverlap() = 0;
|
|
|
|
virtual cl_mem getOverlappingPairBuffer() = 0;
|
2017-08-01 14:30:58 +02:00
|
|
|
|
2019-01-03 14:26:51 +01:00
|
|
|
virtual b3OpenCLArray<b3SapAabb>& getAllAabbsGPU() = 0;
|
|
|
|
virtual b3AlignedObjectArray<b3SapAabb>& getAllAabbsCPU() = 0;
|
2017-08-01 14:30:58 +02:00
|
|
|
|
|
|
|
virtual b3OpenCLArray<b3Int4>& getOverlappingPairsGPU() = 0;
|
|
|
|
virtual b3OpenCLArray<int>& getSmallAabbIndicesGPU() = 0;
|
|
|
|
virtual b3OpenCLArray<int>& getLargeAabbIndicesGPU() = 0;
|
|
|
|
};
|
|
|
|
|
2019-01-03 14:26:51 +01:00
|
|
|
#endif //B3_GPU_BROADPHASE_INTERFACE_H
|