Classes | Public Member Functions | Private Attributes | List of all members
tesseract_collision::tesseract_collision_bullet::TesseractConvexConvexAlgorithm Class Reference

This is a modifed Convex to Convex collision algorithm. More...

#include <tesseract_convex_convex_algorithm.h>

Inheritance diagram for tesseract_collision::tesseract_collision_bullet::TesseractConvexConvexAlgorithm:
Inheritance graph
[legend]

Classes

struct  CreateFunc
 

Public Member Functions

btScalar calculateTimeOfImpact (btCollisionObject *body0, btCollisionObject *body1, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut) override
 
void getAllContactManifolds (btManifoldArray &manifoldArray) override
 
const btPersistentManifold * getManifold ()
 
TesseractConvexConvexAlgorithmoperator= (const TesseractConvexConvexAlgorithm &)=delete
 
TesseractConvexConvexAlgorithmoperator= (TesseractConvexConvexAlgorithm &&)=delete
 
void processCollision (const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut) override
 
void setLowLevelOfDetail (bool useLowLevel)
 
 TesseractConvexConvexAlgorithm (btPersistentManifold *mf, const btCollisionAlgorithmConstructionInfo &ci, const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, btConvexPenetrationDepthSolver *pdSolver, int numPerturbationIterations, int minimumPointsPerturbationThreshold)
 cache separating vector to speedup collision detection More...
 
 TesseractConvexConvexAlgorithm (const TesseractConvexConvexAlgorithm &)=delete
 
 TesseractConvexConvexAlgorithm (TesseractConvexConvexAlgorithm &&)=delete
 
 ~TesseractConvexConvexAlgorithm () override
 

Private Attributes

ContactTestDatam_cdata
 
bool m_lowLevelOfDetail { false }
 
btPersistentManifold * m_manifoldPtr
 
int m_minimumPointsPerturbationThreshold
 
int m_numPerturbationIterations
 
bool m_ownManifold { false }
 
btConvexPenetrationDepthSolver * m_pdSolver
 
btVertexArray worldVertsB1
 
btVertexArray worldVertsB2
 

Detailed Description

This is a modifed Convex to Convex collision algorithm.

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 This was modified to leverage the Tesseract contact request to enable and disable different parts of the algorithm. The algorithm first does a quick binary check if the two objects are in collision. If in collision it runs the penetration algorithm to get the nearest points and penetration depths. If not in collision it runs the an algorithm to get the nearest points and distance. The Tesseract contact request allow you to now decide if you need all three. Example, in the case of OMPL if you have a contact distance of zero you can get a performance increase, by disabling the penetration and distance calculation because they add no value.

Note: This will not be able to be removed.

Definition at line 65 of file tesseract_convex_convex_algorithm.h.

Constructor & Destructor Documentation

◆ TesseractConvexConvexAlgorithm() [1/3]

tesseract_collision::tesseract_collision_bullet::TesseractConvexConvexAlgorithm::TesseractConvexConvexAlgorithm ( 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 188 of file tesseract_convex_convex_algorithm.cpp.

◆ ~TesseractConvexConvexAlgorithm()

tesseract_collision::tesseract_collision_bullet::TesseractConvexConvexAlgorithm::~TesseractConvexConvexAlgorithm ( )
override

Definition at line 213 of file tesseract_convex_convex_algorithm.cpp.

◆ TesseractConvexConvexAlgorithm() [2/3]

tesseract_collision::tesseract_collision_bullet::TesseractConvexConvexAlgorithm::TesseractConvexConvexAlgorithm ( const TesseractConvexConvexAlgorithm )
delete

◆ TesseractConvexConvexAlgorithm() [3/3]

tesseract_collision::tesseract_collision_bullet::TesseractConvexConvexAlgorithm::TesseractConvexConvexAlgorithm ( TesseractConvexConvexAlgorithm &&  )
delete

Member Function Documentation

◆ calculateTimeOfImpact()

btScalar tesseract_collision::tesseract_collision_bullet::TesseractConvexConvexAlgorithm::calculateTimeOfImpact ( btCollisionObject *  body0,
btCollisionObject *  body1,
const btDispatcherInfo &  dispatchInfo,
btManifoldResult *  resultOut 
)
override

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

Definition at line 853 of file tesseract_convex_convex_algorithm.cpp.

◆ getAllContactManifolds()

void tesseract_collision::tesseract_collision_bullet::TesseractConvexConvexAlgorithm::getAllContactManifolds ( btManifoldArray &  manifoldArray)
inlineoverride

should we use m_ownManifold to avoid adding duplicates?

Definition at line 111 of file tesseract_convex_convex_algorithm.h.

◆ getManifold()

const btPersistentManifold* tesseract_collision::tesseract_collision_bullet::TesseractConvexConvexAlgorithm::getManifold ( )
inline

Definition at line 120 of file tesseract_convex_convex_algorithm.h.

◆ operator=() [1/2]

TesseractConvexConvexAlgorithm& tesseract_collision::tesseract_collision_bullet::TesseractConvexConvexAlgorithm::operator= ( const TesseractConvexConvexAlgorithm )
delete

◆ operator=() [2/2]

TesseractConvexConvexAlgorithm& tesseract_collision::tesseract_collision_bullet::TesseractConvexConvexAlgorithm::operator= ( TesseractConvexConvexAlgorithm &&  )
delete

◆ processCollision()

void tesseract_collision::tesseract_collision_bullet::TesseractConvexConvexAlgorithm::processCollision ( const btCollisionObjectWrapper *  body0Wrap,
const btCollisionObjectWrapper *  body1Wrap,
const btDispatcherInfo &  dispatchInfo,
btManifoldResult *  resultOut 
)
override

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

Definition at line 283 of file tesseract_convex_convex_algorithm.cpp.

◆ setLowLevelOfDetail()

void tesseract_collision::tesseract_collision_bullet::TesseractConvexConvexAlgorithm::setLowLevelOfDetail ( bool  useLowLevel)

Definition at line 222 of file tesseract_convex_convex_algorithm.cpp.

Member Data Documentation

◆ m_cdata

ContactTestData* tesseract_collision::tesseract_collision_bullet::TesseractConvexConvexAlgorithm::m_cdata
private

Definition at line 82 of file tesseract_convex_convex_algorithm.h.

◆ m_lowLevelOfDetail

bool tesseract_collision::tesseract_collision_bullet::TesseractConvexConvexAlgorithm::m_lowLevelOfDetail { false }
private

Definition at line 77 of file tesseract_convex_convex_algorithm.h.

◆ m_manifoldPtr

btPersistentManifold* tesseract_collision::tesseract_collision_bullet::TesseractConvexConvexAlgorithm::m_manifoldPtr
private

Definition at line 76 of file tesseract_convex_convex_algorithm.h.

◆ m_minimumPointsPerturbationThreshold

int tesseract_collision::tesseract_collision_bullet::TesseractConvexConvexAlgorithm::m_minimumPointsPerturbationThreshold
private

Definition at line 80 of file tesseract_convex_convex_algorithm.h.

◆ m_numPerturbationIterations

int tesseract_collision::tesseract_collision_bullet::TesseractConvexConvexAlgorithm::m_numPerturbationIterations
private

Definition at line 79 of file tesseract_convex_convex_algorithm.h.

◆ m_ownManifold

bool tesseract_collision::tesseract_collision_bullet::TesseractConvexConvexAlgorithm::m_ownManifold { false }
private

Definition at line 75 of file tesseract_convex_convex_algorithm.h.

◆ m_pdSolver

btConvexPenetrationDepthSolver* tesseract_collision::tesseract_collision_bullet::TesseractConvexConvexAlgorithm::m_pdSolver
private

Definition at line 70 of file tesseract_convex_convex_algorithm.h.

◆ worldVertsB1

btVertexArray tesseract_collision::tesseract_collision_bullet::TesseractConvexConvexAlgorithm::worldVertsB1
private

Definition at line 72 of file tesseract_convex_convex_algorithm.h.

◆ worldVertsB2

btVertexArray tesseract_collision::tesseract_collision_bullet::TesseractConvexConvexAlgorithm::worldVertsB2
private

Definition at line 73 of file tesseract_convex_convex_algorithm.h.


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


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