Bullet Collision Detection & Physics Library
btConvexConcaveCollisionAlgorithm.h
Go to the documentation of this file.
1/*
2Bullet Continuous Collision Detection and Physics Library
3Copyright (c) 2003-2006 Erwin Coumans https://bulletphysics.org
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 you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
122. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
133. This notice may not be removed or altered from any source distribution.
14*/
15
16#ifndef BT_CONVEX_CONCAVE_COLLISION_ALGORITHM_H
17#define BT_CONVEX_CONCAVE_COLLISION_ALGORITHM_H
18
24class btDispatcher;
27
31{
34
37
42
43public:
45
47
49
50 btConvexTriangleCallback(btDispatcher * dispatcher, const btCollisionObjectWrapper* body0Wrap, const btCollisionObjectWrapper* body1Wrap, bool isSwapped);
51
52 void setTimeStepAndCounters(btScalar collisionMarginTriangle, const btDispatcherInfo& dispatchInfo, const btCollisionObjectWrapper* convexBodyWrap, const btCollisionObjectWrapper* triBodyWrap, btManifoldResult* resultOut);
53
55 {
56 m_convexBodyWrap = 0;
57 m_triBodyWrap = 0;
58 }
60
61 virtual void processTriangle(btVector3 * triangle, int partId, int triangleIndex);
62
63 void clearCache();
64
66 {
67 return m_aabbMin;
68 }
70 {
71 return m_aabbMax;
72 }
73};
74
78{
80
82
83public:
85
87
89
90 virtual void processCollision(const btCollisionObjectWrapper* body0Wrap, const btCollisionObjectWrapper* body1Wrap, const btDispatcherInfo& dispatchInfo, btManifoldResult* resultOut);
91
93
94 virtual void getAllContactManifolds(btManifoldArray & manifoldArray);
95
96 void clearCache();
97
99 {
101 {
103 return new (mem) btConvexConcaveCollisionAlgorithm(ci, body0Wrap, body1Wrap, false);
104 }
105 };
106
108 {
110 {
112 return new (mem) btConvexConcaveCollisionAlgorithm(ci, body0Wrap, body1Wrap, true);
113 }
114 };
115};
116
117#endif //BT_CONVEX_CONCAVE_COLLISION_ALGORITHM_H
virtual btScalar calculateTimeOfImpact(btCollisionObject *body0, btCollisionObject *body1, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut)
virtual void getAllContactManifolds(btManifoldArray &manifoldArray)
virtual void processCollision(const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut)
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
Definition: btScalar.h:314
#define ATTRIBUTE_ALIGNED16(a)
Definition: btScalar.h:99
#define SIMD_FORCE_INLINE
Definition: btScalar.h:98
This class is not enabled yet (work-in-progress) to more aggressively activate objects.
btCollisionAlgorithm is an collision interface that is compatible with the Broadphase and btDispatche...
btCollisionObject can be used to manage collision detection objects.
btConvexConcaveCollisionAlgorithm supports collision between convex shapes and (concave) trianges mes...
For each triangle in the concave mesh that overlaps with the AABB of a convex (m_convexProxy),...
const btDispatcherInfo * m_dispatchInfoPtr
const btCollisionObjectWrapper * m_convexBodyWrap
const btCollisionObjectWrapper * m_triBodyWrap
The btDispatcher interface class can be used in combination with broadphase to dispatch calculations ...
Definition: btDispatcher.h:77
virtual void * allocateCollisionAlgorithm(int size)=0
btManifoldResult is a helper class to manage contact results.
btPersistentManifold is a contact point cache, it stays persistent as long as objects are overlapping...
The btTriangleCallback provides a callback for each overlapping triangle when calling processAllTrian...
btVector3 can be used to represent 3D points and vectors.
Definition: btVector3.h:82
Used by the btCollisionDispatcher to register and create instances for btCollisionAlgorithm.
virtual btCollisionAlgorithm * CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo &ci, const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap)
virtual btCollisionAlgorithm * CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo &ci, const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap)