Tesseract
Motion Planning Environment
Loading...
Searching...
No Matches
tesseract_compound_compound_collision_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*/
19#ifndef TESSERACT_COLLISION_TESSERACT_COMPOUND_COMPOUND_COLLISION_ALGORITHM_H
20#define TESSERACT_COLLISION_TESSERACT_COMPOUND_COMPOUND_COLLISION_ALGORITHM_H
21
24#include <BulletCollision/BroadphaseCollision/btDispatcher.h>
25#include <BulletCollision/BroadphaseCollision/btBroadphaseInterface.h>
26#include <BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.h>
27#include <BulletCollision/NarrowPhaseCollision/btPersistentManifold.h>
28#include <BulletCollision/BroadphaseCollision/btBroadphaseProxy.h>
29#include <BulletCollision/CollisionDispatch/btCollisionCreateFunc.h>
30#include <LinearMath/btAlignedObjectArray.h>
31#include <BulletCollision/BroadphaseCollision/btDbvt.h>
32#include <BulletCollision/CollisionDispatch/btHashedSimplePairCache.h>
34
36
37class btCollisionObject;
38class btCollisionShape;
39
40// LCOV_EXCL_START
42{
56{
57 class btHashedSimplePairCache* m_childCollisionAlgorithmCache;
58 btSimplePairArray m_removePairs;
59
60 int m_compoundShapeRevision0; // to keep track of changes, so that childAlgorithm array can be updated
62
64
65public:
66 TesseractCompoundCompoundCollisionAlgorithm(const btCollisionAlgorithmConstructionInfo& ci,
67 const btCollisionObjectWrapper* body0Wrap,
68 const btCollisionObjectWrapper* body1Wrap,
69 bool isSwapped);
70
76
77 void processCollision(const btCollisionObjectWrapper* body0Wrap,
78 const btCollisionObjectWrapper* body1Wrap,
79 const btDispatcherInfo& dispatchInfo,
80 btManifoldResult* resultOut) override;
81
82 btScalar calculateTimeOfImpact(btCollisionObject* body0,
83 btCollisionObject* body1,
84 const btDispatcherInfo& dispatchInfo,
85 btManifoldResult* resultOut) override;
86
87 void getAllContactManifolds(btManifoldArray& manifoldArray) override;
88
89 struct CreateFunc : public btCollisionAlgorithmCreateFunc
90 {
91 btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci,
92 const btCollisionObjectWrapper* body0Wrap,
93 const btCollisionObjectWrapper* body1Wrap) override
94 {
95 void* mem = ci.m_dispatcher1->allocateCollisionAlgorithm(sizeof(TesseractCompoundCompoundCollisionAlgorithm));
96 return new (mem) TesseractCompoundCompoundCollisionAlgorithm(ci, body0Wrap, body1Wrap, false);
97 }
98 };
99
100 struct SwappedCreateFunc : public btCollisionAlgorithmCreateFunc
101 {
102 btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci,
103 const btCollisionObjectWrapper* body0Wrap,
104 const btCollisionObjectWrapper* body1Wrap) override
105 {
106 void* mem = ci.m_dispatcher1->allocateCollisionAlgorithm(sizeof(TesseractCompoundCompoundCollisionAlgorithm));
107 return new (mem) TesseractCompoundCompoundCollisionAlgorithm(ci, body0Wrap, body1Wrap, true);
108 }
109 };
110};
111} // namespace tesseract_collision::tesseract_collision_bullet
112// LCOV_EXCL_STOP
113#endif // TESSERACT_COLLISION_TESSERACT_COMPOUND_COMPOUND_COLLISION_ALGORITHM_H
Supports collision between CompoundCollisionShapes and other collision shapes.
Definition: tesseract_compound_collision_algorithm.h:53
btManifoldArray manifoldArray
Definition: tesseract_compound_collision_algorithm.h:55
Supports collision between two btCompoundCollisionShape shapes.
Definition: tesseract_compound_compound_collision_algorithm.h:56
btSimplePairArray m_removePairs
Definition: tesseract_compound_compound_collision_algorithm.h:58
int m_compoundShapeRevision1
Definition: tesseract_compound_compound_collision_algorithm.h:61
TesseractCompoundCompoundCollisionAlgorithm(TesseractCompoundCompoundCollisionAlgorithm &&)=default
~TesseractCompoundCompoundCollisionAlgorithm() override
Definition: tesseract_compound_compound_collision_algorithm.cpp:67
void processCollision(const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut) override
Definition: tesseract_compound_compound_collision_algorithm.cpp:319
TesseractCompoundCompoundCollisionAlgorithm & operator=(const TesseractCompoundCompoundCollisionAlgorithm &)=default
int m_compoundShapeRevision0
Definition: tesseract_compound_compound_collision_algorithm.h:60
TesseractCompoundCompoundCollisionAlgorithm(const TesseractCompoundCompoundCollisionAlgorithm &)=default
class btHashedSimplePairCache * m_childCollisionAlgorithmCache
Definition: tesseract_compound_compound_collision_algorithm.h:57
TesseractCompoundCompoundCollisionAlgorithm & operator=(TesseractCompoundCompoundCollisionAlgorithm &&)=default
void removeChildAlgorithms()
Definition: tesseract_compound_compound_collision_algorithm.cpp:86
void getAllContactManifolds(btManifoldArray &manifoldArray) override
Definition: tesseract_compound_compound_collision_algorithm.cpp:74
btScalar calculateTimeOfImpact(btCollisionObject *body0, btCollisionObject *body1, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut) override
Definition: tesseract_compound_compound_collision_algorithm.cpp:453
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
btCollisionAlgorithm * CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo &ci, const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap) override
Definition: tesseract_compound_compound_collision_algorithm.h:91
btCollisionAlgorithm * CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo &ci, const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap) override
Definition: tesseract_compound_compound_collision_algorithm.h:102