Back to index

supertuxkart  0.5+dfsg1
btGjkEpa.h
Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004 
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose, 
00008 including commercial applications, and to alter it and redistribute it freely, 
00009 subject to the following restrictions:
00010 
00011 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.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015 
00016 /*
00017 GJK-EPA collision solver by Nathanael Presson
00018 Nov.2006
00019 */
00020 
00021 
00022 #ifndef _05E48D53_04E0_49ad_BB0A_D74FE62E7366_
00023 #define _05E48D53_04E0_49ad_BB0A_D74FE62E7366_
00024 #include "BulletCollision/CollisionShapes/btConvexShape.h"
00025 
00026 class btStackAlloc;
00027 
00029 struct btGjkEpaSolver
00030 {
00031 struct sResults
00032        {
00033        enum eStatus
00034               {
00035               Separated,           /* Shapes doesnt penetrate                                                                               */ 
00036               Penetrating,  /* Shapes are penetrating                                                                                */ 
00037               GJK_Failed,          /* GJK phase fail, no big issue, shapes are probably just 'touching'  */ 
00038               EPA_Failed,          /* EPA phase fail, bigger problem, need to save parameters, and debug */ 
00039               }             status;
00040        btVector3     witnesses[2];
00041        btVector3     normal;
00042        btScalar      depth;
00043        int    epa_iterations;
00044        int    gjk_iterations;
00045        };
00046 static bool   Collide(const btConvexShape* shape0,const btTransform& wtrs0,
00047                                    const btConvexShape* shape1,const btTransform& wtrs1,
00048                                    btScalar      radialmargin,
00049                                    btStackAlloc* stackAlloc,
00050                                    sResults&     results);
00051 };
00052 
00053 #endif