Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/src/external/bullet/BulletCollision/BroadphaseCollision/btDispatcher.h @ 9981

Last change on this file since 9981 was 8393, checked in by rgrieder, 14 years ago

Updated Bullet from v2.77 to v2.78.
(I'm not going to make a branch for that since the update from 2.74 to 2.77 hasn't been tested that much either).

You will HAVE to do a complete RECOMPILE! I tested with MSVC and MinGW and they both threw linker errors at me.

  • Property svn:eol-style set to native
File size: 3.5 KB
Line 
1/*
2Bullet Continuous Collision Detection and Physics Library
3Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
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
16#ifndef BT_DISPATCHER_H
17#define BT_DISPATCHER_H
18#include "LinearMath/btScalar.h"
19
20class btCollisionAlgorithm;
21struct btBroadphaseProxy;
22class btRigidBody;
23class   btCollisionObject;
24class btOverlappingPairCache;
25
26
27class btPersistentManifold;
28class btStackAlloc;
29class btPoolAllocator;
30
31struct btDispatcherInfo
32{
33        enum DispatchFunc
34        {
35                DISPATCH_DISCRETE = 1,
36                DISPATCH_CONTINUOUS
37        };
38        btDispatcherInfo()
39                :m_timeStep(btScalar(0.)),
40                m_stepCount(0),
41                m_dispatchFunc(DISPATCH_DISCRETE),
42                m_timeOfImpact(btScalar(1.)),
43                m_useContinuous(true),
44                m_debugDraw(0),
45                m_enableSatConvex(false),
46                m_enableSPU(true),
47                m_useEpa(true),
48                m_allowedCcdPenetration(btScalar(0.04)),
49                m_useConvexConservativeDistanceUtil(false),
50                m_convexConservativeDistanceThreshold(0.0f),
51                m_stackAllocator(0)
52        {
53
54        }
55        btScalar        m_timeStep;
56        int                     m_stepCount;
57        int                     m_dispatchFunc;
58        mutable btScalar        m_timeOfImpact;
59        bool            m_useContinuous;
60        class btIDebugDraw*     m_debugDraw;
61        bool            m_enableSatConvex;
62        bool            m_enableSPU;
63        bool            m_useEpa;
64        btScalar        m_allowedCcdPenetration;
65        bool            m_useConvexConservativeDistanceUtil;
66        btScalar        m_convexConservativeDistanceThreshold;
67        btStackAlloc*   m_stackAllocator;
68};
69
70///The btDispatcher interface class can be used in combination with broadphase to dispatch calculations for overlapping pairs.
71///For example for pairwise collision detection, calculating contact points stored in btPersistentManifold or user callbacks (game logic).
72class btDispatcher
73{
74
75
76public:
77        virtual ~btDispatcher() ;
78
79        virtual btCollisionAlgorithm* findAlgorithm(btCollisionObject* body0,btCollisionObject* body1,btPersistentManifold* sharedManifold=0) = 0;
80
81        virtual btPersistentManifold*   getNewManifold(void* body0,void* body1)=0;
82
83        virtual void releaseManifold(btPersistentManifold* manifold)=0;
84
85        virtual void clearManifold(btPersistentManifold* manifold)=0;
86
87        virtual bool    needsCollision(btCollisionObject* body0,btCollisionObject* body1) = 0;
88
89        virtual bool    needsResponse(btCollisionObject* body0,btCollisionObject* body1)=0;
90
91        virtual void    dispatchAllCollisionPairs(btOverlappingPairCache* pairCache,const btDispatcherInfo& dispatchInfo,btDispatcher* dispatcher)  =0;
92
93        virtual int getNumManifolds() const = 0;
94
95        virtual btPersistentManifold* getManifoldByIndexInternal(int index) = 0;
96
97        virtual btPersistentManifold**  getInternalManifoldPointer() = 0;
98
99        virtual btPoolAllocator*        getInternalManifoldPool() = 0;
100
101        virtual const btPoolAllocator*  getInternalManifoldPool() const = 0;
102
103        virtual void* allocateCollisionAlgorithm(int size)  = 0;
104
105        virtual void freeCollisionAlgorithm(void* ptr) = 0;
106
107};
108
109
110#endif //BT_DISPATCHER_H
Note: See TracBrowser for help on using the repository browser.