Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btCollisionDispatcher.h @ 8369

Last change on this file since 8369 was 8351, checked in by rgrieder, 14 years ago

Merged kicklib2 branch back to trunk (includes former branches ois_update, mac_osx and kicklib).

Notes for updating

Linux:
You don't need an extra package for CEGUILua and Tolua, it's already shipped with CEGUI.
However you do need to make sure that the OgreRenderer is installed too with CEGUI 0.7 (may be a separate package).
Also, Orxonox now recognises if you install the CgProgramManager (a separate package available on newer Ubuntu on Debian systems).

Windows:
Download the new dependency packages versioned 6.0 and use these. If you have problems with that or if you don't like the in game console problem mentioned below, you can download the new 4.3 version of the packages (only available for Visual Studio 2005/2008).

Key new features:

  • *Support for Mac OS X*
  • Visual Studio 2010 support
  • Bullet library update to 2.77
  • OIS library update to 1.3
  • Support for CEGUI 0.7 —> Support for Arch Linux and even SuSE
  • Improved install target
  • Compiles now with GCC 4.6
  • Ogre Cg Shader plugin activated for Linux if available
  • And of course lots of bug fixes

There are also some regressions:

  • No support for CEGUI 0.5, Ogre 1.4 and boost 1.35 - 1.39 any more
  • In game console is not working in main menu for CEGUI 0.7
  • Tolua (just the C lib, not the application) and CEGUILua libraries are no longer in our repository. —> You will need to get these as well when compiling Orxonox
  • And of course lots of new bugs we don't yet know about
  • Property svn:eol-style set to native
File size: 4.8 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 COLLISION__DISPATCHER_H
17#define COLLISION__DISPATCHER_H
18
19#include "BulletCollision/BroadphaseCollision/btDispatcher.h"
20#include "BulletCollision/NarrowPhaseCollision/btPersistentManifold.h"
21
22#include "BulletCollision/CollisionDispatch/btManifoldResult.h"
23
24#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"
25#include "LinearMath/btAlignedObjectArray.h"
26
27class btIDebugDraw;
28class btOverlappingPairCache;
29class btPoolAllocator;
30class btCollisionConfiguration;
31
32#include "btCollisionCreateFunc.h"
33
34#define USE_DISPATCH_REGISTRY_ARRAY 1
35
36class btCollisionDispatcher;
37///user can override this nearcallback for collision filtering and more finegrained control over collision detection
38typedef void (*btNearCallback)(btBroadphasePair& collisionPair, btCollisionDispatcher& dispatcher, const btDispatcherInfo& dispatchInfo);
39
40
41///btCollisionDispatcher supports algorithms that handle ConvexConvex and ConvexConcave collision pairs.
42///Time of Impact, Closest Points and Penetration Depth.
43class btCollisionDispatcher : public btDispatcher
44{
45        int             m_dispatcherFlags;
46       
47        btAlignedObjectArray<btPersistentManifold*>     m_manifoldsPtr;
48
49        btManifoldResult        m_defaultManifoldResult;
50
51        btNearCallback          m_nearCallback;
52       
53        btPoolAllocator*        m_collisionAlgorithmPoolAllocator;
54
55        btPoolAllocator*        m_persistentManifoldPoolAllocator;
56
57        btCollisionAlgorithmCreateFunc* m_doubleDispatch[MAX_BROADPHASE_COLLISION_TYPES][MAX_BROADPHASE_COLLISION_TYPES];
58
59        btCollisionConfiguration*       m_collisionConfiguration;
60
61
62public:
63
64        enum DispatcherFlags
65        {
66                CD_STATIC_STATIC_REPORTED = 1,
67                CD_USE_RELATIVE_CONTACT_BREAKING_THRESHOLD = 2
68        };
69
70        int     getDispatcherFlags() const
71        {
72                return m_dispatcherFlags;
73        }
74
75        void    setDispatcherFlags(int flags)
76        {
77        (void) flags;
78                m_dispatcherFlags = 0;
79        }
80
81        ///registerCollisionCreateFunc allows registration of custom/alternative collision create functions
82        void    registerCollisionCreateFunc(int proxyType0,int proxyType1, btCollisionAlgorithmCreateFunc* createFunc);
83
84        int     getNumManifolds() const
85        { 
86                return int( m_manifoldsPtr.size());
87        }
88
89        btPersistentManifold**  getInternalManifoldPointer()
90        {
91                return &m_manifoldsPtr[0];
92        }
93
94         btPersistentManifold* getManifoldByIndexInternal(int index)
95        {
96                return m_manifoldsPtr[index];
97        }
98
99         const btPersistentManifold* getManifoldByIndexInternal(int index) const
100        {
101                return m_manifoldsPtr[index];
102        }
103
104        btCollisionDispatcher (btCollisionConfiguration* collisionConfiguration);
105
106        virtual ~btCollisionDispatcher();
107
108        virtual btPersistentManifold*   getNewManifold(void* b0,void* b1);
109       
110        virtual void releaseManifold(btPersistentManifold* manifold);
111
112
113        virtual void clearManifold(btPersistentManifold* manifold);
114
115                       
116        btCollisionAlgorithm* findAlgorithm(btCollisionObject* body0,btCollisionObject* body1,btPersistentManifold* sharedManifold = 0);
117               
118        virtual bool    needsCollision(btCollisionObject* body0,btCollisionObject* body1);
119       
120        virtual bool    needsResponse(btCollisionObject* body0,btCollisionObject* body1);
121       
122        virtual void    dispatchAllCollisionPairs(btOverlappingPairCache* pairCache,const btDispatcherInfo& dispatchInfo,btDispatcher* dispatcher) ;
123
124        void    setNearCallback(btNearCallback  nearCallback)
125        {
126                m_nearCallback = nearCallback; 
127        }
128
129        btNearCallback  getNearCallback() const
130        {
131                return m_nearCallback;
132        }
133
134        //by default, Bullet will use this near callback
135        static void  defaultNearCallback(btBroadphasePair& collisionPair, btCollisionDispatcher& dispatcher, const btDispatcherInfo& dispatchInfo);
136
137        virtual void* allocateCollisionAlgorithm(int size);
138
139        virtual void freeCollisionAlgorithm(void* ptr);
140
141        btCollisionConfiguration*       getCollisionConfiguration()
142        {
143                return m_collisionConfiguration;
144        }
145
146        const btCollisionConfiguration* getCollisionConfiguration() const
147        {
148                return m_collisionConfiguration;
149        }
150
151        void    setCollisionConfiguration(btCollisionConfiguration* config)
152        {
153                m_collisionConfiguration = config;
154        }
155
156};
157
158#endif //COLLISION__DISPATCHER_H
159
Note: See TracBrowser for help on using the repository browser.