Tesseract
Motion Planning Environment
Loading...
Searching...
No Matches
tesseract_convex_convex_algorithm.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_CONVEX_CONVEX_ALGORITHM_H
19#define TESSERACT_COLLISION_TESSERACT_CONVEX_CONVEX_ALGORITHM_H
20
23#include <BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.h>
24#include <BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h>
25#include <BulletCollision/NarrowPhaseCollision/btPersistentManifold.h>
26#include <BulletCollision/BroadphaseCollision/btBroadphaseProxy.h>
27#include <BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h>
28#include <BulletCollision/CollisionDispatch/btCollisionCreateFunc.h>
29#include <BulletCollision/CollisionDispatch/btCollisionDispatcher.h>
30#include <LinearMath/btTransformUtil.h> //for btConvexSeparatingDistanceUtil
31#include <BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.h>
33
35
36class btConvexPenetrationDepthSolver;
37
38// LCOV_EXCL_START
40{
45
46//#define USE_SEPDISTANCE_UTIL2 1
47
52
65class TesseractConvexConvexAlgorithm : public btActivatingCollisionAlgorithm
66{
67#ifdef USE_SEPDISTANCE_UTIL2
68 btConvexSeparatingDistanceUtil m_sepDistance;
69#endif
70 btConvexPenetrationDepthSolver* m_pdSolver;
71
72 btVertexArray worldVertsB1;
73 btVertexArray worldVertsB2;
74
75 bool m_ownManifold{ false };
76 btPersistentManifold* m_manifoldPtr;
77 bool m_lowLevelOfDetail{ false };
78
81
83
85
86public:
87 TesseractConvexConvexAlgorithm(btPersistentManifold* mf,
88 const btCollisionAlgorithmConstructionInfo& ci,
89 const btCollisionObjectWrapper* body0Wrap,
90 const btCollisionObjectWrapper* body1Wrap,
91 btConvexPenetrationDepthSolver* pdSolver,
92 int numPerturbationIterations,
93 int minimumPointsPerturbationThreshold);
94
100
101 void processCollision(const btCollisionObjectWrapper* body0Wrap,
102 const btCollisionObjectWrapper* body1Wrap,
103 const btDispatcherInfo& dispatchInfo,
104 btManifoldResult* resultOut) override;
105
106 btScalar calculateTimeOfImpact(btCollisionObject* body0,
107 btCollisionObject* body1,
108 const btDispatcherInfo& dispatchInfo,
109 btManifoldResult* resultOut) override;
110
111 void getAllContactManifolds(btManifoldArray& manifoldArray) override
112 {
114 if (m_manifoldPtr && m_ownManifold) // NOLINT
115 manifoldArray.push_back(m_manifoldPtr);
116 }
117
118 void setLowLevelOfDetail(bool useLowLevel);
119
120 const btPersistentManifold* getManifold() { return m_manifoldPtr; }
121
122 struct CreateFunc : public btCollisionAlgorithmCreateFunc
123 {
124 btConvexPenetrationDepthSolver* m_pdSolver;
127
128 CreateFunc(btConvexPenetrationDepthSolver* pdSolver);
129
130 btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci,
131 const btCollisionObjectWrapper* body0Wrap,
132 const btCollisionObjectWrapper* body1Wrap) override
133 {
134 void* mem = ci.m_dispatcher1->allocateCollisionAlgorithm(sizeof(TesseractConvexConvexAlgorithm));
135 return new (mem) TesseractConvexConvexAlgorithm(ci.m_manifold,
136 ci,
137 body0Wrap,
138 body1Wrap,
142 }
143 };
144};
145
146} // namespace tesseract_collision::tesseract_collision_bullet
147// LCOV_EXCL_STOP
148#endif // TESSERACT_COLLISION_TESSERACT_CONVEX_CONVEX_ALGORITHM_H
This is a modifed Convex to Convex collision algorithm.
Definition: tesseract_convex_convex_algorithm.h:66
const btPersistentManifold * getManifold()
Definition: tesseract_convex_convex_algorithm.h:120
void processCollision(const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut) override
Definition: tesseract_convex_convex_algorithm.cpp:283
void setLowLevelOfDetail(bool useLowLevel)
Definition: tesseract_convex_convex_algorithm.cpp:222
int m_numPerturbationIterations
Definition: tesseract_convex_convex_algorithm.h:79
bool m_lowLevelOfDetail
Definition: tesseract_convex_convex_algorithm.h:77
int m_minimumPointsPerturbationThreshold
Definition: tesseract_convex_convex_algorithm.h:80
TesseractConvexConvexAlgorithm(const TesseractConvexConvexAlgorithm &)=delete
btVertexArray worldVertsB1
Definition: tesseract_convex_convex_algorithm.h:72
btScalar calculateTimeOfImpact(btCollisionObject *body0, btCollisionObject *body1, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut) override
Definition: tesseract_convex_convex_algorithm.cpp:860
~TesseractConvexConvexAlgorithm() override
Definition: tesseract_convex_convex_algorithm.cpp:213
ContactTestData * m_cdata
Definition: tesseract_convex_convex_algorithm.h:82
btPersistentManifold * m_manifoldPtr
Definition: tesseract_convex_convex_algorithm.h:76
bool m_ownManifold
Definition: tesseract_convex_convex_algorithm.h:75
TesseractConvexConvexAlgorithm & operator=(const TesseractConvexConvexAlgorithm &)=delete
void getAllContactManifolds(btManifoldArray &manifoldArray) override
Definition: tesseract_convex_convex_algorithm.h:111
btConvexPenetrationDepthSolver * m_pdSolver
Definition: tesseract_convex_convex_algorithm.h:70
btVertexArray worldVertsB2
Definition: tesseract_convex_convex_algorithm.h:73
TesseractConvexConvexAlgorithm & operator=(TesseractConvexConvexAlgorithm &&)=delete
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
int m_minimumPointsPerturbationThreshold
Definition: tesseract_convex_convex_algorithm.h:126
btConvexPenetrationDepthSolver * m_pdSolver
Definition: tesseract_convex_convex_algorithm.h:124
btCollisionAlgorithm * CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo &ci, const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap) override
Definition: tesseract_convex_convex_algorithm.h:130
int m_numPerturbationIterations
Definition: tesseract_convex_convex_algorithm.h:125
Tesseracts Collision Common Types.