Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/src/external/bullet/BulletCollision/NarrowPhaseCollision/btGjkEpa2.h @ 11458

Last change on this file since 11458 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: 2.5 KB
Line 
1/*
2Bullet Continuous Collision Detection and Physics Library
3Copyright (c) 2003-2008 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
7use of this software.
8Permission is granted to anyone to use this software for any purpose,
9including commercial applications, and to alter it and redistribute it
10freely,
11subject to the following restrictions:
12
131. The origin of this software must not be misrepresented; you must not
14claim that you wrote the original software. If you use this software in a
15product, an acknowledgment in the product documentation would be appreciated
16but is not required.
172. Altered source versions must be plainly marked as such, and must not be
18misrepresented as being the original software.
193. This notice may not be removed or altered from any source distribution.
20*/
21
22/*
23GJK-EPA collision solver by Nathanael Presson, 2008
24*/
25#ifndef BT_GJK_EPA2_H
26#define BT_GJK_EPA2_H
27
28#include "BulletCollision/CollisionShapes/btConvexShape.h"
29
30///btGjkEpaSolver contributed under zlib by Nathanael Presson
31struct  btGjkEpaSolver2
32{
33struct  sResults
34        {
35        enum eStatus
36                {
37                Separated,              /* Shapes doesnt penetrate                                                                                              */ 
38                Penetrating,    /* Shapes are penetrating                                                                                               */ 
39                GJK_Failed,             /* GJK phase fail, no big issue, shapes are probably just 'touching'    */ 
40                EPA_Failed              /* EPA phase fail, bigger problem, need to save parameters, and debug   */ 
41                }               status;
42        btVector3       witnesses[2];
43        btVector3       normal;
44        btScalar        distance;
45        };
46
47static int              StackSizeRequirement();
48
49static bool             Distance(       const btConvexShape* shape0,const btTransform& wtrs0,
50                                                        const btConvexShape* shape1,const btTransform& wtrs1,
51                                                        const btVector3& guess,
52                                                        sResults& results);
53
54static bool             Penetration(const btConvexShape* shape0,const btTransform& wtrs0,
55                                                        const btConvexShape* shape1,const btTransform& wtrs1,
56                                                        const btVector3& guess,
57                                                        sResults& results,
58                                                        bool usemargins=true);
59#ifndef __SPU__
60static btScalar SignedDistance( const btVector3& position,
61                                                                btScalar margin,
62                                                                const btConvexShape* shape,
63                                                                const btTransform& wtrs,
64                                                                sResults& results);
65                                                       
66static bool             SignedDistance( const btConvexShape* shape0,const btTransform& wtrs0,
67                                                                const btConvexShape* shape1,const btTransform& wtrs1,
68                                                                const btVector3& guess,
69                                                                sResults& results);
70#endif //__SPU__
71
72};
73
74#endif //BT_GJK_EPA2_H
75
Note: See TracBrowser for help on using the repository browser.