Bullet Collision Detection & Physics Library: btConvexConvexAlgorithm Class Reference

Bullet Collision Detection & Physics Library

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

Classes | Public Member Functions | Private Attributes | List of all members
btConvexConvexAlgorithm Class Reference

Enabling USE_SEPDISTANCE_UTIL2 requires 100% reliable distance computation. More...

`#include <btConvexConvexAlgorithm.h>`

Inheritance diagram for btConvexConvexAlgorithm:
[legend]
Collaboration diagram for btConvexConvexAlgorithm:
[legend]

## Classes
struct | CreateFunc

## Public Member Functions
| btConvexConvexAlgorithm (btPersistentManifold *mf, const btCollisionAlgorithmConstructionInfo &ci, const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, btConvexPenetrationDepthSolver *pdSolver, int numPerturbationIterations, int minimumPointsPerturbationThreshold)
| cache separating vector to speedup collision detection
virtual | ~btConvexConvexAlgorithm ()
virtual void | processCollision (const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut)
virtual btScalar | calculateTimeOfImpact (btCollisionObject *body0, btCollisionObject *body1, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut)
virtual void | getAllContactManifolds (btManifoldArray &manifoldArray)
void | setLowLevelOfDetail (bool useLowLevel)
const btPersistentManifold * | getManifold ()
Public Member Functions inherited from btActivatingCollisionAlgorithm
virtual | ~btActivatingCollisionAlgorithm ()
Public Member Functions inherited from btCollisionAlgorithm
| btCollisionAlgorithm ()
| btCollisionAlgorithm (const btCollisionAlgorithmConstructionInfo &ci)
virtual | ~btCollisionAlgorithm ()
virtual void | processCollision (const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut)=0
virtual btScalar | calculateTimeOfImpact (btCollisionObject *body0, btCollisionObject *body1, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut)=0
virtual void | getAllContactManifolds (btManifoldArray &manifoldArray)=0

## Private Attributes
btConvexPenetrationDepthSolver * | m_pdSolver
btVertexArray | worldVertsB1
btVertexArray | worldVertsB2
bool | m_ownManifold
btPersistentManifold * | m_manifoldPtr
bool | m_lowLevelOfDetail
int | m_numPerturbationIterations
int | m_minimumPointsPerturbationThreshold

## Additional Inherited Members
Protected Member Functions inherited from btActivatingCollisionAlgorithm
| btActivatingCollisionAlgorithm (const btCollisionAlgorithmConstructionInfo &ci)
| btActivatingCollisionAlgorithm (const btCollisionAlgorithmConstructionInfo &ci, const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap)
Protected Attributes inherited from btCollisionAlgorithm
btDispatcher * | m_dispatcher

## Detailed Description

Enabling USE_SEPDISTANCE_UTIL2 requires 100% reliable distance computation.

However, when using large size ratios GJK can be imprecise so the distance is not conservative. In that case, enabling this USE_SEPDISTANCE_UTIL2 would result in failing/missing collisions. Either improve GJK for large size ratios (testing a 100 units versus a 0.1 unit object) or only enable the util for certain pairs that have a small size ratio The convexConvexAlgorithm collision algorithm implements time of impact, convex closest points and penetration depth calculations between two convex objects. Multiple contact points are calculated by perturbing the orientation of the smallest object orthogonal to the separating normal. This idea was described by Gino van den Bergen in this forum topic http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=4&t=288&p=888#p888

Definition at line 41 of file btConvexConvexAlgorithm.h.

## Constructor & Destructor Documentation

## ◆ btConvexConvexAlgorithm()

btConvexConvexAlgorithm::btConvexConvexAlgorithm | ( | btPersistentManifold * | mf,
|  | const btCollisionAlgorithmConstructionInfo & | ci,
|  | const btCollisionObjectWrapper * | body0Wrap,
|  | const btCollisionObjectWrapper * | body1Wrap,
|  | btConvexPenetrationDepthSolver * | pdSolver,
|  | int | numPerturbationIterations,
|  | int | minimumPointsPerturbationThreshold
| ) |  |

cache separating vector to speedup collision detection

Definition at line 184 of file btConvexConvexAlgorithm.cpp.

## ◆ ~btConvexConvexAlgorithm()

btConvexConvexAlgorithm::~btConvexConvexAlgorithm | ( |  | ) |
| virtual

Definition at line 201 of file btConvexConvexAlgorithm.cpp.

## Member Function Documentation

## ◆ calculateTimeOfImpact()

btScalar btConvexConvexAlgorithm::calculateTimeOfImpact | ( | btCollisionObject * | body0,
|  | btCollisionObject * | body1,
|  | const btDispatcherInfo & | dispatchInfo,
|  | btManifoldResult * | resultOut
| ) |  |
| virtual

Rather then checking ALL pairs, only calculate TOI when motion exceeds threshold

Linear motion for one of objects needs to exceed m_ccdSquareMotionThreshold col0->m_worldTransform,

Convex0 against sphere for Convex1

Simplification, one object is simplified as a sphere

Sphere (for convex0) against Convex1

Simplification, one object is simplified as a sphere

Implements btCollisionAlgorithm.

Definition at line 792 of file btConvexConvexAlgorithm.cpp.

## ◆ getAllContactManifolds()

virtual void btConvexConvexAlgorithm::getAllContactManifolds | ( | btManifoldArray & | manifoldArray | ) |
| inlinevirtual

should we use m_ownManifold to avoid adding duplicates?

Implements btCollisionAlgorithm.

Definition at line 69 of file btConvexConvexAlgorithm.h.

## ◆ getManifold()

const btPersistentManifold * btConvexConvexAlgorithm::getManifold | ( |  | ) |
| inline

Definition at line 78 of file btConvexConvexAlgorithm.h.

## ◆ processCollision()

void btConvexConvexAlgorithm::processCollision | ( | const btCollisionObjectWrapper * | body0Wrap,
|  | const btCollisionObjectWrapper * | body1Wrap,
|  | const btDispatcherInfo & | dispatchInfo,
|  | btManifoldResult * | resultOut
| ) |  |
| virtual

btBoxShape is an exception: its vertices are created WITH margin so don't subtract it

Implements btCollisionAlgorithm.

Definition at line 273 of file btConvexConvexAlgorithm.cpp.

## ◆ setLowLevelOfDetail()

void btConvexConvexAlgorithm::setLowLevelOfDetail | ( | bool | useLowLevel | ) |

Definition at line 210 of file btConvexConvexAlgorithm.cpp.

## Member Data Documentation

## ◆ m_lowLevelOfDetail

bool btConvexConvexAlgorithm::m_lowLevelOfDetail
| private

Definition at line 53 of file btConvexConvexAlgorithm.h.

## ◆ m_manifoldPtr

btPersistentManifold* btConvexConvexAlgorithm::m_manifoldPtr
| private

Definition at line 52 of file btConvexConvexAlgorithm.h.

## ◆ m_minimumPointsPerturbationThreshold

int btConvexConvexAlgorithm::m_minimumPointsPerturbationThreshold
| private

Definition at line 56 of file btConvexConvexAlgorithm.h.

## ◆ m_numPerturbationIterations

int btConvexConvexAlgorithm::m_numPerturbationIterations
| private

Definition at line 55 of file btConvexConvexAlgorithm.h.

## ◆ m_ownManifold

bool btConvexConvexAlgorithm::m_ownManifold
| private

Definition at line 51 of file btConvexConvexAlgorithm.h.

## ◆ m_pdSolver

btConvexPenetrationDepthSolver* btConvexConvexAlgorithm::m_pdSolver
| private

Definition at line 46 of file btConvexConvexAlgorithm.h.

## ◆ worldVertsB1

btVertexArray btConvexConvexAlgorithm::worldVertsB1
| private

Definition at line 48 of file btConvexConvexAlgorithm.h.

## ◆ worldVertsB2

btVertexArray btConvexConvexAlgorithm::worldVertsB2
| private

Definition at line 49 of file btConvexConvexAlgorithm.h.

The documentation for this class was generated from the following files:

- btConvexConvexAlgorithm.h
- btConvexConvexAlgorithm.cpp