Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/physics/src/bullet/BulletCollision/NarrowPhaseCollision/btGjkEpa.h @ 1963

Last change on this file since 1963 was 1963, checked in by rgrieder, 15 years ago

Added Bullet physics engine.

  • Property svn:eol-style set to native
File size: 1.9 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/*
17GJK-EPA collision solver by Nathanael Presson
18Nov.2006
19*/
20
21
22#ifndef _05E48D53_04E0_49ad_BB0A_D74FE62E7366_
23#define _05E48D53_04E0_49ad_BB0A_D74FE62E7366_
24#include "BulletCollision/CollisionShapes/btConvexShape.h"
25
26class btStackAlloc;
27
28///btGjkEpaSolver contributed under zlib by Nathanael Presson
29struct  btGjkEpaSolver
30{
31struct  sResults
32        {
33        enum eStatus
34                {
35                Separated,              /* Shapes doesnt penetrate                                                                                              */ 
36                Penetrating,    /* Shapes are penetrating                                                                                               */ 
37                GJK_Failed,             /* GJK phase fail, no big issue, shapes are probably just 'touching'    */ 
38                EPA_Failed              /* EPA phase fail, bigger problem, need to save parameters, and debug   */ 
39                }               status;
40        btVector3       witnesses[2];
41        btVector3       normal;
42        btScalar        depth;
43        int     epa_iterations;
44        int     gjk_iterations;
45        };
46static bool     Collide(const btConvexShape* shape0,const btTransform& wtrs0,
47                                        const btConvexShape* shape1,const btTransform& wtrs1,
48                                        btScalar        radialmargin,
49                                        btStackAlloc* stackAlloc,
50                                        sResults&       results);
51};
52
53#endif
Note: See TracBrowser for help on using the repository browser.