Tesseract
Motion Planning Environment
Loading...
Searching...
No Matches
tesseract_gjk_pair_detector.h
Go to the documentation of this file.
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
12you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not
13required.
142. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original
15software.
163. This notice may not be removed or altered from any source distribution.
17*/
18#ifndef TESSERACT_COLLISION_TESSERACT_GJK_PAIR_DETECTOR_H
19#define TESSERACT_COLLISION_TESSERACT_GJK_PAIR_DETECTOR_H
20
23#include <BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h>
24#include <BulletCollision/CollisionShapes/btCollisionMargin.h>
26
27class btConvexShape;
29#include <BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h>
31
32class btConvexPenetrationDepthSolver;
33
35
37{
50class TesseractGjkPairDetector : public btDiscreteCollisionDetectorInterface
51{
53 btConvexPenetrationDepthSolver* m_penetrationDepthSolver;
54 btSimplexSolverInterface* m_simplexSolver;
55 const btConvexShape* m_minkowskiA;
56 const btConvexShape* m_minkowskiB;
59 btScalar m_marginA;
60 btScalar m_marginB;
61
64
66
67public:
68 // some debugging to fix degeneracy problems
70 int m_curIter{ 0 };
74
75 TesseractGjkPairDetector(const btConvexShape* objectA,
76 const btConvexShape* objectB,
77 btSimplexSolverInterface* simplexSolver,
78 btConvexPenetrationDepthSolver* penetrationDepthSolver,
79 const ContactTestData* cdata);
80
81 TesseractGjkPairDetector(const btConvexShape* objectA,
82 const btConvexShape* objectB,
83 int shapeTypeA,
84 int shapeTypeB,
85 btScalar marginA,
86 btScalar marginB,
87 btSimplexSolverInterface* simplexSolver,
88 btConvexPenetrationDepthSolver* penetrationDepthSolver,
89 const ContactTestData* cdata);
90
91 void getClosestPoints(const ClosestPointInput& input,
92 Result& output,
93 class btIDebugDraw* debugDraw,
94 bool swapResults = false) override;
95
96 void getClosestPointsNonVirtual(const ClosestPointInput& input, Result& output, class btIDebugDraw* debugDraw);
97
98 void setMinkowskiA(const btConvexShape* minkA) { m_minkowskiA = minkA; }
99
100 void setMinkowskiB(const btConvexShape* minkB) { m_minkowskiB = minkB; }
101 void setCachedSeparatingAxis(const btVector3& separatingAxis) { m_cachedSeparatingAxis = separatingAxis; }
102
103 const btVector3& getCachedSeparatingAxis() const { return m_cachedSeparatingAxis; } // LCOV_EXCL_LINE
105
106 void setPenetrationDepthSolver(btConvexPenetrationDepthSolver* penetrationDepthSolver)
107 {
108 m_penetrationDepthSolver = penetrationDepthSolver;
109 }
110
112 void setIgnoreMargin(bool ignoreMargin) { m_ignoreMargin = ignoreMargin; }
113};
114} // namespace tesseract_collision::tesseract_collision_bullet
115#endif // TESSERACT_COLLISION_TESSERACT_GJK_PAIR_DETECTOR_H
This is a modifed Convex to Convex collision algorithm.
Definition: tesseract_gjk_pair_detector.h:51
int m_lastUsedMethod
Definition: tesseract_gjk_pair_detector.h:69
void setIgnoreMargin(bool ignoreMargin)
don't use setIgnoreMargin, it's for Bullet's internal use
Definition: tesseract_gjk_pair_detector.h:112
int m_shapeTypeB
Definition: tesseract_gjk_pair_detector.h:58
int m_fixContactNormalDirection
Definition: tesseract_gjk_pair_detector.h:73
void setCachedSeparatingAxis(const btVector3 &separatingAxis)
Definition: tesseract_gjk_pair_detector.h:101
const btConvexShape * m_minkowskiB
Definition: tesseract_gjk_pair_detector.h:56
const ContactTestData * m_cdata
Definition: tesseract_gjk_pair_detector.h:65
int m_catchDegeneracies
Definition: tesseract_gjk_pair_detector.h:72
void setMinkowskiA(const btConvexShape *minkA)
Definition: tesseract_gjk_pair_detector.h:98
int m_shapeTypeA
Definition: tesseract_gjk_pair_detector.h:57
btScalar m_marginB
Definition: tesseract_gjk_pair_detector.h:60
btScalar m_cachedSeparatingDistance
Definition: tesseract_gjk_pair_detector.h:63
void getClosestPoints(const ClosestPointInput &input, Result &output, class btIDebugDraw *debugDraw, bool swapResults=false) override
Definition: tesseract_gjk_pair_detector.cpp:93
void setMinkowskiB(const btConvexShape *minkB)
Definition: tesseract_gjk_pair_detector.h:100
int m_degenerateSimplex
Definition: tesseract_gjk_pair_detector.h:71
btScalar getCachedSeparatingDistance() const
Definition: tesseract_gjk_pair_detector.h:104
const btConvexShape * m_minkowskiA
Definition: tesseract_gjk_pair_detector.h:55
btSimplexSolverInterface * m_simplexSolver
Definition: tesseract_gjk_pair_detector.h:54
void setPenetrationDepthSolver(btConvexPenetrationDepthSolver *penetrationDepthSolver)
Definition: tesseract_gjk_pair_detector.h:106
bool m_ignoreMargin
Definition: tesseract_gjk_pair_detector.h:62
btScalar m_marginA
Definition: tesseract_gjk_pair_detector.h:59
btConvexPenetrationDepthSolver * m_penetrationDepthSolver
Definition: tesseract_gjk_pair_detector.h:53
const btVector3 & getCachedSeparatingAxis() const
Definition: tesseract_gjk_pair_detector.h:103
int m_curIter
Definition: tesseract_gjk_pair_detector.h:70
void getClosestPointsNonVirtual(const ClosestPointInput &input, Result &output, class btIDebugDraw *debugDraw)
Definition: tesseract_gjk_pair_detector.cpp:669
btVector3 m_cachedSeparatingAxis
Definition: tesseract_gjk_pair_detector.h:52
Common Tesseract Macros.
#define TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
Definition: macros.h:71
Definition: create_convex_hull.cpp:36
Definition: bullet_cast_bvh_manager.h:49
This data is intended only to be used internal to the collision checkers as a container and should no...
Definition: types.h:319
Tesseracts Collision Common Types.