Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btManifoldResult.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: 3.2 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
17#ifndef MANIFOLD_RESULT_H
18#define MANIFOLD_RESULT_H
19
20class btCollisionObject;
21#include "BulletCollision/NarrowPhaseCollision/btPersistentManifold.h"
22class btManifoldPoint;
23
24#include "BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h"
25
26#include "LinearMath/btTransform.h"
27
28typedef bool (*ContactAddedCallback)(btManifoldPoint& cp,       const btCollisionObject* colObj0,int partId0,int index0,const btCollisionObject* colObj1,int partId1,int index1);
29extern ContactAddedCallback             gContactAddedCallback;
30
31//#define DEBUG_PART_INDEX 1
32
33
34///btManifoldResult is a helper class to manage  contact results.
35class btManifoldResult : public btDiscreteCollisionDetectorInterface::Result
36{
37protected:
38
39        btPersistentManifold* m_manifoldPtr;
40
41        //we need this for compounds
42        btTransform     m_rootTransA;
43        btTransform     m_rootTransB;
44
45        btCollisionObject* m_body0;
46        btCollisionObject* m_body1;
47        int     m_partId0;
48        int m_partId1;
49        int m_index0;
50        int m_index1;
51       
52
53public:
54
55        btManifoldResult()
56#ifdef DEBUG_PART_INDEX
57                :
58        m_partId0(-1),
59        m_partId1(-1),
60        m_index0(-1),
61        m_index1(-1)
62#endif //DEBUG_PART_INDEX
63        {
64        }
65
66        btManifoldResult(btCollisionObject* body0,btCollisionObject* body1);
67
68        virtual ~btManifoldResult() {};
69
70        void    setPersistentManifold(btPersistentManifold* manifoldPtr)
71        {
72                m_manifoldPtr = manifoldPtr;
73        }
74
75        const btPersistentManifold*     getPersistentManifold() const
76        {
77                return m_manifoldPtr;
78        }
79        btPersistentManifold*   getPersistentManifold()
80        {
81                return m_manifoldPtr;
82        }
83
84        virtual void setShapeIdentifiersA(int partId0,int index0)
85        {
86                m_partId0=partId0;
87                m_index0=index0;
88        }
89
90        virtual void setShapeIdentifiersB(      int partId1,int index1)
91        {
92                m_partId1=partId1;
93                m_index1=index1;
94        }
95
96
97        virtual void addContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,btScalar depth);
98
99        SIMD_FORCE_INLINE       void refreshContactPoints()
100        {
101                btAssert(m_manifoldPtr);
102                if (!m_manifoldPtr->getNumContacts())
103                        return;
104
105                bool isSwapped = m_manifoldPtr->getBody0() != m_body0;
106
107                if (isSwapped)
108                {
109                        m_manifoldPtr->refreshContactPoints(m_rootTransB,m_rootTransA);
110                } else
111                {
112                        m_manifoldPtr->refreshContactPoints(m_rootTransA,m_rootTransB);
113                }
114        }
115
116        const btCollisionObject* getBody0Internal() const
117        {
118                return m_body0;
119        }
120
121        const btCollisionObject* getBody1Internal() const
122        {
123                return m_body1;
124        }
125       
126};
127
128#endif //MANIFOLD_RESULT_H
Note: See TracBrowser for help on using the repository browser.