Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/physics/src/bullet/BulletMultiThreaded/SpuGatheringCollisionDispatcher.h @ 1967

Last change on this file since 1967 was 1966, checked in by rgrieder, 16 years ago

Let's go for multithreaded physics!

  • Property svn:eol-style set to native
File size: 2.4 KB
Line 
1/*
2Bullet Continuous Collision Detection and Physics Library
3Copyright (c) 2003-2007 Erwin Coumans  http://bulletphysics.com
4
5This software is provided 'as-is', without any express or implied warranty.
6In no event will the authors be held liable for any damages arising from the use of this software.
7Permission is granted to anyone to use this software for any purpose,
8including commercial applications, and to alter it and redistribute it freely,
9subject to the following restrictions:
10
111. 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.
122. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
133. This notice may not be removed or altered from any source distribution.
14*/
15#ifndef SPU_GATHERING_COLLISION__DISPATCHER_H
16#define SPU_GATHERING_COLLISION__DISPATCHER_H
17
18#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
19
20
21///Tuning value to optimized SPU utilization
22///Too small value means Task overhead is large compared to computation (too fine granularity)
23///Too big value might render some SPUs are idle, while a few other SPUs are doing all work.
24#define SPU_BATCHSIZE_BROADPHASE_PAIRS 16
25//#define SPU_BATCHSIZE_BROADPHASE_PAIRS 256
26
27
28class SpuCollisionTaskProcess;
29
30///SpuGatheringCollisionDispatcher can use SPU to gather and calculate collision detection
31///Time of Impact, Closest Points and Penetration Depth.
32class SpuGatheringCollisionDispatcher : public btCollisionDispatcher
33{
34       
35        SpuCollisionTaskProcess*        m_spuCollisionTaskProcess;
36       
37protected:
38
39        class   btThreadSupportInterface*       m_threadInterface;
40
41        unsigned int    m_maxNumOutstandingTasks;
42       
43
44public:
45
46        //can be used by SPU collision algorithms       
47        SpuCollisionTaskProcess*        getSpuCollisionTaskProcess()
48        {
49                        return m_spuCollisionTaskProcess;
50        }
51       
52        SpuGatheringCollisionDispatcher (class  btThreadSupportInterface*       threadInterface, unsigned int   maxNumOutstandingTasks,btCollisionConfiguration* collisionConfiguration);
53       
54        virtual ~SpuGatheringCollisionDispatcher();
55
56        bool    supportsDispatchPairOnSpu(int proxyType0,int proxyType1);
57
58        virtual void    dispatchAllCollisionPairs(btOverlappingPairCache* pairCache,const btDispatcherInfo& dispatchInfo,btDispatcher* dispatcher) ;
59
60};
61
62
63
64#endif //SPU_GATHERING_COLLISION__DISPATCHER_H
Note: See TracBrowser for help on using the repository browser.