SpuGatheringCollisionDispatcher.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2007 Erwin Coumans  http://bulletphysics.com
00004 
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose, 
00008 including commercial applications, and to alter it and redistribute it freely, 
00009 subject to the following restrictions:
00010 
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015 #ifndef BT_SPU_GATHERING_COLLISION__DISPATCHER_H
00016 #define BT_SPU_GATHERING_COLLISION__DISPATCHER_H
00017 
00018 #include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
00019 
00020 
00024 //#define SPU_BATCHSIZE_BROADPHASE_PAIRS 8
00025 //#define SPU_BATCHSIZE_BROADPHASE_PAIRS 16
00026 //#define SPU_BATCHSIZE_BROADPHASE_PAIRS 64
00027 #define SPU_BATCHSIZE_BROADPHASE_PAIRS 128
00028 //#define SPU_BATCHSIZE_BROADPHASE_PAIRS 256
00029 //#define SPU_BATCHSIZE_BROADPHASE_PAIRS 512
00030 //#define SPU_BATCHSIZE_BROADPHASE_PAIRS 1024
00031 
00032 
00033 
00034 class SpuCollisionTaskProcess;
00035 
00038 class SpuGatheringCollisionDispatcher : public btCollisionDispatcher
00039 {
00040         
00041         SpuCollisionTaskProcess*        m_spuCollisionTaskProcess;
00042         
00043 protected:
00044 
00045         class   btThreadSupportInterface*       m_threadInterface;
00046 
00047         unsigned int    m_maxNumOutstandingTasks;
00048         
00049 
00050 public:
00051 
00052         //can be used by SPU collision algorithms       
00053         SpuCollisionTaskProcess*        getSpuCollisionTaskProcess()
00054         {
00055                         return m_spuCollisionTaskProcess;
00056         }
00057         
00058         SpuGatheringCollisionDispatcher (class  btThreadSupportInterface*       threadInterface, unsigned int   maxNumOutstandingTasks,btCollisionConfiguration* collisionConfiguration);
00059         
00060         virtual ~SpuGatheringCollisionDispatcher();
00061 
00062         bool    supportsDispatchPairOnSpu(int proxyType0,int proxyType1);
00063 
00064         virtual void    dispatchAllCollisionPairs(btOverlappingPairCache* pairCache,const btDispatcherInfo& dispatchInfo,btDispatcher* dispatcher) ;
00065 
00066 };
00067 
00068 
00069 
00070 #endif //BT_SPU_GATHERING_COLLISION__DISPATCHER_H
00071 
00072