Blender  V3.3
Public Member Functions | Public Attributes | List of all members
btGjkPairDetector Class Reference

btGjkPairDetector uses GJK to implement the btDiscreteCollisionDetectorInterface More...

#include <btGjkPairDetector.h>

Inheritance diagram for btGjkPairDetector:
btDiscreteCollisionDetectorInterface

Public Member Functions

 btGjkPairDetector (const btConvexShape *objectA, const btConvexShape *objectB, btSimplexSolverInterface *simplexSolver, btConvexPenetrationDepthSolver *penetrationDepthSolver)
 
 btGjkPairDetector (const btConvexShape *objectA, const btConvexShape *objectB, int shapeTypeA, int shapeTypeB, btScalar marginA, btScalar marginB, btSimplexSolverInterface *simplexSolver, btConvexPenetrationDepthSolver *penetrationDepthSolver)
 
virtual ~btGjkPairDetector ()
 
virtual void getClosestPoints (const ClosestPointInput &input, Result &output, class btIDebugDraw *debugDraw, bool swapResults=false)
 
void getClosestPointsNonVirtual (const ClosestPointInput &input, Result &output, class btIDebugDraw *debugDraw)
 
void setMinkowskiA (const btConvexShape *minkA)
 
void setMinkowskiB (const btConvexShape *minkB)
 
void setCachedSeparatingAxis (const btVector3 &separatingAxis)
 
const btVector3getCachedSeparatingAxis () const
 
btScalar getCachedSeparatingDistance () const
 
void setPenetrationDepthSolver (btConvexPenetrationDepthSolver *penetrationDepthSolver)
 
void setIgnoreMargin (bool ignoreMargin)
 don't use setIgnoreMargin, it's for Bullet's internal use More...
 
- Public Member Functions inherited from btDiscreteCollisionDetectorInterface
virtual ~btDiscreteCollisionDetectorInterface ()
 

Public Attributes

int m_lastUsedMethod
 
int m_curIter
 
int m_degenerateSimplex
 
int m_catchDegeneracies
 
int m_fixContactNormalDirection
 

Detailed Description

btGjkPairDetector uses GJK to implement the btDiscreteCollisionDetectorInterface

Definition at line 27 of file btGjkPairDetector.h.

Constructor & Destructor Documentation

◆ btGjkPairDetector() [1/2]

btGjkPairDetector::btGjkPairDetector ( const btConvexShape objectA,
const btConvexShape objectB,
btSimplexSolverInterface simplexSolver,
btConvexPenetrationDepthSolver penetrationDepthSolver 
)

Definition at line 40 of file btGjkPairDetector.cpp.

◆ btGjkPairDetector() [2/2]

btGjkPairDetector::btGjkPairDetector ( const btConvexShape objectA,
const btConvexShape objectB,
int  shapeTypeA,
int  shapeTypeB,
btScalar  marginA,
btScalar  marginB,
btSimplexSolverInterface simplexSolver,
btConvexPenetrationDepthSolver penetrationDepthSolver 
)

Definition at line 56 of file btGjkPairDetector.cpp.

◆ ~btGjkPairDetector()

virtual btGjkPairDetector::~btGjkPairDetector ( )
inlinevirtual

Definition at line 52 of file btGjkPairDetector.h.

Member Function Documentation

◆ getCachedSeparatingAxis()

const btVector3& btGjkPairDetector::getCachedSeparatingAxis ( ) const
inline

Definition at line 72 of file btGjkPairDetector.h.

Referenced by btConvexConvexAlgorithm::processCollision().

◆ getCachedSeparatingDistance()

btScalar btGjkPairDetector::getCachedSeparatingDistance ( ) const
inline

Definition at line 76 of file btGjkPairDetector.h.

Referenced by btConvexConvexAlgorithm::processCollision().

◆ getClosestPoints()

void btGjkPairDetector::getClosestPoints ( const ClosestPointInput input,
Result output,
class btIDebugDraw debugDraw,
bool  swapResults = false 
)
virtual

◆ getClosestPointsNonVirtual()

void btGjkPairDetector::getClosestPointsNonVirtual ( const ClosestPointInput input,
Result output,
class btIDebugDraw debugDraw 
)

this is another degenerate case, where the initial GJK calculation reports a degenerate case EPA reports no penetration, and the second GJK (using the supporting vector without margin) reports a valid positive distance. Use the results of the second GJK instead of failing. thanks to Jacob.Langford for the reproduction case http://code.google.com/p/bullet/issues/detail?id=250

todo: need to track down this EPA penetration solver degeneracy the penetration solver reports penetration but the contact normal connecting the contact points is pointing in the opposite direction until then, detect the issue and revert the normal

Definition at line 688 of file btGjkPairDetector.cpp.

References BT_LARGE_FLOAT, btAssert, btComputeSupport(), btDoSimplex(), btFuzzyZero(), btSimplexAdd(), btSimplexInit(), btSqrt(), btTransform, btVec3Dot(), btVector3, debugDraw(), blender::math::distance(), distance2(), blender::math::dot(), gGjkEpaPenetrationTolerance, input, blender::math::length(), output, REL_ERROR2, SIMD_EPSILON, btSupportVector::v, btSupportVector::v1, btSupportVector::v2, and w().

Referenced by getClosestPoints().

◆ setCachedSeparatingAxis()

void btGjkPairDetector::setCachedSeparatingAxis ( const btVector3 separatingAxis)
inline

Definition at line 67 of file btGjkPairDetector.h.

Referenced by btMinkowskiPenetrationDepthSolver::calcPenDepth().

◆ setIgnoreMargin()

void btGjkPairDetector::setIgnoreMargin ( bool  ignoreMargin)
inline

don't use setIgnoreMargin, it's for Bullet's internal use

Definition at line 87 of file btGjkPairDetector.h.

Referenced by btConvexConvexAlgorithm::processCollision().

◆ setMinkowskiA()

void btGjkPairDetector::setMinkowskiA ( const btConvexShape minkA)
inline

◆ setMinkowskiB()

void btGjkPairDetector::setMinkowskiB ( const btConvexShape minkB)
inline

◆ setPenetrationDepthSolver()

void btGjkPairDetector::setPenetrationDepthSolver ( btConvexPenetrationDepthSolver penetrationDepthSolver)
inline

Definition at line 81 of file btGjkPairDetector.h.

Member Data Documentation

◆ m_catchDegeneracies

int btGjkPairDetector::m_catchDegeneracies

Definition at line 47 of file btGjkPairDetector.h.

◆ m_curIter

int btGjkPairDetector::m_curIter

Definition at line 45 of file btGjkPairDetector.h.

◆ m_degenerateSimplex

int btGjkPairDetector::m_degenerateSimplex

Definition at line 46 of file btGjkPairDetector.h.

◆ m_fixContactNormalDirection

int btGjkPairDetector::m_fixContactNormalDirection

Definition at line 48 of file btGjkPairDetector.h.

◆ m_lastUsedMethod

int btGjkPairDetector::m_lastUsedMethod

Definition at line 44 of file btGjkPairDetector.h.


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