tesseract_compound_compound_collision_algorithm.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
12 you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not
13 required.
14 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original
15 software.
16 3. 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 
37 class btCollisionObject;
38 class 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 
63  void removeChildAlgorithms();
64 
65 public:
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); // NOLINT
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); // NOLINT
108  }
109  };
110 };
111 } // namespace tesseract_collision::tesseract_collision_bullet
112 // LCOV_EXCL_STOP
113 #endif // TESSERACT_COLLISION_TESSERACT_COMPOUND_COMPOUND_COLLISION_ALGORITHM_H
tesseract_collision::tesseract_collision_bullet
Definition: bullet_cast_bvh_manager.h:48
tesseract_collision::tesseract_collision_bullet::TesseractCompoundCompoundCollisionAlgorithm::CreateFunc::CreateCollisionAlgorithm
btCollisionAlgorithm * CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo &ci, const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap) override
Definition: tesseract_compound_compound_collision_algorithm.h:91
tesseract_compound_collision_algorithm.h
tesseract_collision::tesseract_collision_bullet::TesseractCompoundCompoundCollisionAlgorithm::CreateFunc
Definition: tesseract_compound_compound_collision_algorithm.h:89
tesseract_collision::tesseract_collision_bullet::TesseractCompoundCompoundCollisionAlgorithm::m_childCollisionAlgorithmCache
class btHashedSimplePairCache * m_childCollisionAlgorithmCache
Definition: tesseract_compound_compound_collision_algorithm.h:57
tesseract_collision::tesseract_collision_bullet::TesseractCompoundCompoundCollisionAlgorithm::TesseractCompoundCompoundCollisionAlgorithm
TesseractCompoundCompoundCollisionAlgorithm(const btCollisionAlgorithmConstructionInfo &ci, const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, bool isSwapped)
Definition: tesseract_compound_compound_collision_algorithm.cpp:46
tesseract_collision::tesseract_collision_bullet::TesseractCompoundCompoundCollisionAlgorithm
Supports collision between two btCompoundCollisionShape shapes.
Definition: tesseract_compound_compound_collision_algorithm.h:55
TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
#define TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
tesseract_collision::tesseract_collision_bullet::TesseractCompoundCompoundCollisionAlgorithm::m_compoundShapeRevision1
int m_compoundShapeRevision1
Definition: tesseract_compound_compound_collision_algorithm.h:61
tesseract_collision::tesseract_collision_bullet::TesseractCompoundCompoundCollisionAlgorithm::getAllContactManifolds
void getAllContactManifolds(btManifoldArray &manifoldArray) override
Definition: tesseract_compound_compound_collision_algorithm.cpp:76
tesseract_collision::tesseract_collision_bullet::TesseractCompoundCompoundCollisionAlgorithm::operator=
TesseractCompoundCompoundCollisionAlgorithm & operator=(const TesseractCompoundCompoundCollisionAlgorithm &)=default
tesseract_collision::tesseract_collision_bullet::TesseractCompoundCompoundCollisionAlgorithm::m_removePairs
btSimplePairArray m_removePairs
Definition: tesseract_compound_compound_collision_algorithm.h:58
tesseract_collision::tesseract_collision_bullet::TesseractCompoundCollisionAlgorithm::manifoldArray
btManifoldArray manifoldArray
Definition: tesseract_compound_collision_algorithm.h:55
tesseract_collision::tesseract_collision_bullet::TesseractCompoundCompoundCollisionAlgorithm::calculateTimeOfImpact
btScalar calculateTimeOfImpact(btCollisionObject *body0, btCollisionObject *body1, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut) override
Definition: tesseract_compound_compound_collision_algorithm.cpp:456
tesseract_collision::tesseract_collision_bullet::TesseractCompoundCompoundCollisionAlgorithm::SwappedCreateFunc
Definition: tesseract_compound_compound_collision_algorithm.h:100
tesseract_collision::tesseract_collision_bullet::TesseractCompoundCompoundCollisionAlgorithm::SwappedCreateFunc::CreateCollisionAlgorithm
btCollisionAlgorithm * CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo &ci, const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap) override
Definition: tesseract_compound_compound_collision_algorithm.h:102
TESSERACT_COMMON_IGNORE_WARNINGS_POP
Definition: create_convex_hull.cpp:37
tesseract_collision::tesseract_collision_bullet::TesseractCompoundCompoundCollisionAlgorithm::processCollision
void processCollision(const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut) override
Definition: tesseract_compound_compound_collision_algorithm.cpp:321
tesseract_collision::tesseract_collision_bullet::TesseractCompoundCompoundCollisionAlgorithm::removeChildAlgorithms
void removeChildAlgorithms()
Definition: tesseract_compound_compound_collision_algorithm.cpp:88
tesseract_collision::tesseract_collision_bullet::TesseractCompoundCompoundCollisionAlgorithm::m_compoundShapeRevision0
int m_compoundShapeRevision0
Definition: tesseract_compound_compound_collision_algorithm.h:60
macros.h
tesseract_collision::tesseract_collision_bullet::TesseractCompoundCompoundCollisionAlgorithm::~TesseractCompoundCompoundCollisionAlgorithm
~TesseractCompoundCompoundCollisionAlgorithm() override
Definition: tesseract_compound_compound_collision_algorithm.cpp:69
tesseract_collision::tesseract_collision_bullet::TesseractCompoundCollisionAlgorithm
Supports collision between CompoundCollisionShapes and other collision shapes.
Definition: tesseract_compound_collision_algorithm.h:52


tesseract_collision
Author(s): Levi Armstrong
autogenerated on Sun May 18 2025 03:01:52