#ifndef _CONVEX_HULL_CONTACT_H #define _CONVEX_HULL_CONTACT_H #include "Bullet3OpenCL/ParallelPrimitives/b3OpenCLArray.h" #include "Bullet3Collision/NarrowPhaseCollision/shared/b3RigidBodyData.h" #include "Bullet3Common/b3AlignedObjectArray.h" #include "Bullet3Collision/NarrowPhaseCollision/shared/b3ConvexPolyhedronData.h" #include "Bullet3Collision/NarrowPhaseCollision/shared/b3Collidable.h" #include "Bullet3Collision/NarrowPhaseCollision/b3Contact4.h" #include "Bullet3Common/shared/b3Int2.h" #include "Bullet3Common/shared/b3Int4.h" #include "b3OptimizedBvh.h" #include "b3BvhInfo.h" #include "Bullet3Collision/BroadPhaseCollision/shared/b3Aabb.h" //#include "../../dynamics/basic_demo/Stubs/ChNarrowPhase.h" struct GpuSatCollision { cl_context m_context; cl_device_id m_device; cl_command_queue m_queue; cl_kernel m_findSeparatingAxisKernel; cl_kernel m_mprPenetrationKernel; cl_kernel m_findSeparatingAxisUnitSphereKernel; cl_kernel m_findSeparatingAxisVertexFaceKernel; cl_kernel m_findSeparatingAxisEdgeEdgeKernel; cl_kernel m_findConcaveSeparatingAxisKernel; cl_kernel m_findConcaveSeparatingAxisVertexFaceKernel; cl_kernel m_findConcaveSeparatingAxisEdgeEdgeKernel; cl_kernel m_findCompoundPairsKernel; cl_kernel m_processCompoundPairsKernel; cl_kernel m_clipHullHullKernel; cl_kernel m_clipCompoundsHullHullKernel; cl_kernel m_clipFacesAndFindContacts; cl_kernel m_findClippingFacesKernel; cl_kernel m_clipHullHullConcaveConvexKernel; // cl_kernel m_extractManifoldAndAddContactKernel; cl_kernel m_newContactReductionKernel; cl_kernel m_bvhTraversalKernel; cl_kernel m_primitiveContactsKernel; cl_kernel m_findConcaveSphereContactsKernel; cl_kernel m_processCompoundPairsPrimitivesKernel; b3OpenCLArray m_unitSphereDirections; b3OpenCLArray m_totalContactsOut; b3OpenCLArray m_sepNormals; b3OpenCLArray m_dmins; b3OpenCLArray m_hasSeparatingNormals; b3OpenCLArray m_concaveSepNormals; b3OpenCLArray m_concaveHasSeparatingNormals; b3OpenCLArray m_numConcavePairsOut; b3OpenCLArray m_gpuCompoundPairs; b3OpenCLArray m_gpuCompoundSepNormals; b3OpenCLArray m_gpuHasCompoundSepNormals; b3OpenCLArray m_numCompoundPairsOut; GpuSatCollision(cl_context ctx, cl_device_id device, cl_command_queue q); virtual ~GpuSatCollision(); void computeConvexConvexContactsGPUSAT(b3OpenCLArray* pairs, int nPairs, const b3OpenCLArray* bodyBuf, b3OpenCLArray* contactOut, int& nContacts, const b3OpenCLArray* oldContacts, int maxContactCapacity, int compoundPairCapacity, const b3OpenCLArray& hostConvexData, const b3OpenCLArray& vertices, const b3OpenCLArray& uniqueEdges, const b3OpenCLArray& faces, const b3OpenCLArray& indices, const b3OpenCLArray& gpuCollidables, const b3OpenCLArray& gpuChildShapes, const b3OpenCLArray& clAabbsWorldSpace, const b3OpenCLArray& clAabbsLocalSpace, b3OpenCLArray& worldVertsB1GPU, b3OpenCLArray& clippingFacesOutGPU, b3OpenCLArray& worldNormalsAGPU, b3OpenCLArray& worldVertsA1GPU, b3OpenCLArray& worldVertsB2GPU, b3AlignedObjectArray& bvhData, b3OpenCLArray* treeNodesGPU, b3OpenCLArray* subTreesGPU, b3OpenCLArray* bvhInfo, int numObjects, int maxTriConvexPairCapacity, b3OpenCLArray& triangleConvexPairs, int& numTriConvexPairsOut); }; #endif //_CONVEX_HULL_CONTACT_H