[1963] | 1 | /* |
---|
| 2 | Bullet Continuous Collision Detection and Physics Library |
---|
| 3 | Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ |
---|
| 4 | |
---|
| 5 | This software is provided 'as-is', without any express or implied warranty. |
---|
| 6 | In no event will the authors be held liable for any damages arising from the use of this software. |
---|
| 7 | Permission is granted to anyone to use this software for any purpose, |
---|
| 8 | including commercial applications, and to alter it and redistribute it freely, |
---|
| 9 | subject to the following restrictions: |
---|
| 10 | |
---|
| 11 | 1. 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. |
---|
| 12 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. |
---|
| 13 | 3. This notice may not be removed or altered from any source distribution. |
---|
| 14 | */ |
---|
| 15 | |
---|
| 16 | /* |
---|
| 17 | GJK-EPA collision solver by Nathanael Presson |
---|
| 18 | Nov.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 | |
---|
| 26 | class btStackAlloc; |
---|
| 27 | |
---|
| 28 | ///btGjkEpaSolver contributed under zlib by Nathanael Presson |
---|
| 29 | struct btGjkEpaSolver |
---|
| 30 | { |
---|
| 31 | struct 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 | }; |
---|
| 46 | static 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 |
---|