Bullet Collision Detection & Physics Library
btGjkPairDetector.h
Go to the documentation of this file.
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 #ifndef BT_GJK_PAIR_DETECTOR_H
17 #define BT_GJK_PAIR_DETECTOR_H
18 
21 
22 class btConvexShape;
25 
28 {
38 
41 
42 public:
43  //some debugging to fix degeneracy problems
45  int m_curIter;
49 
50  btGjkPairDetector(const btConvexShape* objectA, const btConvexShape* objectB, btSimplexSolverInterface* simplexSolver, btConvexPenetrationDepthSolver* penetrationDepthSolver);
51  btGjkPairDetector(const btConvexShape* objectA, const btConvexShape* objectB, int shapeTypeA, int shapeTypeB, btScalar marginA, btScalar marginB, btSimplexSolverInterface* simplexSolver, btConvexPenetrationDepthSolver* penetrationDepthSolver);
52  virtual ~btGjkPairDetector(){};
53 
54  virtual void getClosestPoints(const ClosestPointInput& input, Result& output, class btIDebugDraw* debugDraw, bool swapResults = false);
55 
56  void getClosestPointsNonVirtual(const ClosestPointInput& input, Result& output, class btIDebugDraw* debugDraw);
57 
58  void setMinkowskiA(const btConvexShape* minkA)
59  {
60  m_minkowskiA = minkA;
61  }
62 
63  void setMinkowskiB(const btConvexShape* minkB)
64  {
65  m_minkowskiB = minkB;
66  }
67  void setCachedSeperatingAxis(const btVector3& seperatingAxis)
68  {
69  m_cachedSeparatingAxis = seperatingAxis;
70  }
71 
73  {
75  }
77  {
79  }
80 
82  {
83  m_penetrationDepthSolver = penetrationDepthSolver;
84  }
85 
87  void setIgnoreMargin(bool ignoreMargin)
88  {
89  m_ignoreMargin = ignoreMargin;
90  }
91 };
92 
93 #endif //BT_GJK_PAIR_DETECTOR_H
btGjkPairDetector::getClosestPointsNonVirtual
void getClosestPointsNonVirtual(const ClosestPointInput &input, Result &output, class btIDebugDraw *debugDraw)
Definition: btGjkPairDetector.cpp:688
btGjkPairDetector::m_simplexSolver
btSimplexSolverInterface * m_simplexSolver
Definition: btGjkPairDetector.h:31
btGjkPairDetector::m_cachedSeparatingDistance
btScalar m_cachedSeparatingDistance
Definition: btGjkPairDetector.h:40
btGjkPairDetector::m_minkowskiA
const btConvexShape * m_minkowskiA
Definition: btGjkPairDetector.h:32
btGjkPairDetector::m_shapeTypeA
int m_shapeTypeA
Definition: btGjkPairDetector.h:34
btGjkPairDetector::getCachedSeparatingDistance
btScalar getCachedSeparatingDistance() const
Definition: btGjkPairDetector.h:76
btScalar
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
Definition: btScalar.h:294
btGjkPairDetector::m_penetrationDepthSolver
btConvexPenetrationDepthSolver * m_penetrationDepthSolver
Definition: btGjkPairDetector.h:30
btGjkPairDetector::btGjkPairDetector
btGjkPairDetector(const btConvexShape *objectA, const btConvexShape *objectB, btSimplexSolverInterface *simplexSolver, btConvexPenetrationDepthSolver *penetrationDepthSolver)
Definition: btGjkPairDetector.cpp:40
btConvexPenetrationDepthSolver
ConvexPenetrationDepthSolver provides an interface for penetration depth calculation.
Definition: btConvexPenetrationDepthSolver.h:25
btGjkPairDetector::setMinkowskiA
void setMinkowskiA(const btConvexShape *minkA)
Definition: btGjkPairDetector.h:58
btGjkPairDetector::setMinkowskiB
void setMinkowskiB(const btConvexShape *minkB)
Definition: btGjkPairDetector.h:63
btCollisionMargin.h
btGjkPairDetector::m_catchDegeneracies
int m_catchDegeneracies
Definition: btGjkPairDetector.h:47
btDiscreteCollisionDetectorInterface
This interface is made to be used by an iterative approach to do TimeOfImpact calculations This inter...
Definition: btDiscreteCollisionDetectorInterface.h:27
btGjkPairDetector::getCachedSeparatingAxis
const btVector3 & getCachedSeparatingAxis() const
Definition: btGjkPairDetector.h:72
btGjkPairDetector::m_fixContactNormalDirection
int m_fixContactNormalDirection
Definition: btGjkPairDetector.h:48
btGjkPairDetector::m_ignoreMargin
bool m_ignoreMargin
Definition: btGjkPairDetector.h:39
btGjkPairDetector::m_degenerateSimplex
int m_degenerateSimplex
Definition: btGjkPairDetector.h:46
btGjkPairDetector::m_curIter
int m_curIter
Definition: btGjkPairDetector.h:45
btIDebugDraw
The btIDebugDraw interface class allows hooking up a debug renderer to visually debug simulations.
Definition: btIDebugDraw.h:26
btDiscreteCollisionDetectorInterface.h
btGjkPairDetector::setPenetrationDepthSolver
void setPenetrationDepthSolver(btConvexPenetrationDepthSolver *penetrationDepthSolver)
Definition: btGjkPairDetector.h:81
btGjkPairDetector
btGjkPairDetector uses GJK to implement the btDiscreteCollisionDetectorInterface
Definition: btGjkPairDetector.h:27
btVector3
btVector3 can be used to represent 3D points and vectors.
Definition: btVector3.h:80
btGjkPairDetector::m_lastUsedMethod
int m_lastUsedMethod
Definition: btGjkPairDetector.h:44
btGjkPairDetector::~btGjkPairDetector
virtual ~btGjkPairDetector()
Definition: btGjkPairDetector.h:52
btGjkPairDetector::m_minkowskiB
const btConvexShape * m_minkowskiB
Definition: btGjkPairDetector.h:33
output
#define output
btConvexShape
The btConvexShape is an abstract shape interface, implemented by all convex shapes such as btBoxShape...
Definition: btConvexShape.h:31
btGjkPairDetector::m_marginB
btScalar m_marginB
Definition: btGjkPairDetector.h:37
btGjkPairDetector::setCachedSeperatingAxis
void setCachedSeperatingAxis(const btVector3 &seperatingAxis)
Definition: btGjkPairDetector.h:67
btGjkPairDetector::getClosestPoints
virtual void getClosestPoints(const ClosestPointInput &input, Result &output, class btIDebugDraw *debugDraw, bool swapResults=false)
Definition: btGjkPairDetector.cpp:73
btGjkPairDetector::m_shapeTypeB
int m_shapeTypeB
Definition: btGjkPairDetector.h:35
btGjkPairDetector::setIgnoreMargin
void setIgnoreMargin(bool ignoreMargin)
don't use setIgnoreMargin, it's for Bullet's internal use
Definition: btGjkPairDetector.h:87
btGjkPairDetector::m_cachedSeparatingAxis
btVector3 m_cachedSeparatingAxis
Definition: btGjkPairDetector.h:29
btGjkPairDetector::m_marginA
btScalar m_marginA
Definition: btGjkPairDetector.h:36
btSimplexSolverInterface
#define btSimplexSolverInterface
Definition: btSimplexSolverInterface.h:24
btSimplexSolverInterface.h