Back to index

supertuxkart  0.5+dfsg1
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes
btSphereTriangleCollisionAlgorithm Class Reference

btSphereSphereCollisionAlgorithm provides sphere-sphere collision detection. Other features are frame-coherency (persistent data) and collision response. Also provides the most basic sample for custom/user btCollisionAlgorithm More...

#include <btSphereTriangleCollisionAlgorithm.h>

Inheritance diagram for btSphereTriangleCollisionAlgorithm:
Inheritance graph
[legend]
Collaboration diagram for btSphereTriangleCollisionAlgorithm:
Collaboration graph
[legend]

List of all members.

Classes

struct  CreateFunc

Public Member Functions

 btSphereTriangleCollisionAlgorithm (btPersistentManifold *mf, const btCollisionAlgorithmConstructionInfo &ci, btCollisionObject *body0, btCollisionObject *body1, bool swapped)
 btSphereTriangleCollisionAlgorithm (const btCollisionAlgorithmConstructionInfo &ci)
virtual void processCollision (btCollisionObject *body0, btCollisionObject *body1, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut)
virtual btScalar calculateTimeOfImpact (btCollisionObject *body0, btCollisionObject *body1, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut)
virtual ~btSphereTriangleCollisionAlgorithm ()

Protected Member Functions

int getDispatcherId ()

Protected Attributes

btDispatcherm_dispatcher

Private Attributes

bool m_ownManifold
btPersistentManifold * m_manifoldPtr
bool m_swapped

Detailed Description

btSphereSphereCollisionAlgorithm provides sphere-sphere collision detection. Other features are frame-coherency (persistent data) and collision response. Also provides the most basic sample for custom/user btCollisionAlgorithm

Definition at line 28 of file btSphereTriangleCollisionAlgorithm.h.


Constructor & Destructor Documentation

btSphereTriangleCollisionAlgorithm::btSphereTriangleCollisionAlgorithm ( btPersistentManifold *  mf,
const btCollisionAlgorithmConstructionInfo ci,
btCollisionObject *  body0,
btCollisionObject *  body1,
bool  swapped 
)

Definition at line 24 of file btSphereTriangleCollisionAlgorithm.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 37 of file btSphereTriangleCollisionAlgorithm.h.

Definition at line 37 of file btSphereTriangleCollisionAlgorithm.cpp.

Here is the call graph for this function:


Member Function Documentation

btScalar btSphereTriangleCollisionAlgorithm::calculateTimeOfImpact ( btCollisionObject *  body0,
btCollisionObject *  body1,
const btDispatcherInfo dispatchInfo,
btManifoldResult resultOut 
) [virtual]

Implements btCollisionAlgorithm.

Definition at line 73 of file btSphereTriangleCollisionAlgorithm.cpp.

{
       (void)resultOut;
       (void)dispatchInfo;
       (void)col0;
       (void)col1;

       //not yet
       return btScalar(1.);
}
int btCollisionAlgorithm::getDispatcherId ( ) [protected, inherited]
void btSphereTriangleCollisionAlgorithm::processCollision ( btCollisionObject *  body0,
btCollisionObject *  body1,
const btDispatcherInfo dispatchInfo,
btManifoldResult resultOut 
) [virtual]

report a contact. internally this will be kept persistent, and contact reduction is done

Implements btCollisionAlgorithm.

Definition at line 46 of file btSphereTriangleCollisionAlgorithm.cpp.

{
       if (!m_manifoldPtr)
              return;

       btCollisionObject* sphereObj = m_swapped? col1 : col0;
       btCollisionObject* triObj = m_swapped? col0 : col1;

       btSphereShape* sphere = (btSphereShape*)sphereObj->getCollisionShape();
       btTriangleShape* triangle = (btTriangleShape*)triObj->getCollisionShape();
       
       resultOut->setPersistentManifold(m_manifoldPtr);
       SphereTriangleDetector detector(sphere,triangle);
       
       btDiscreteCollisionDetectorInterface::ClosestPointInput input;
       input.m_maximumDistanceSquared = btScalar(1e30);//todo: tighter bounds
       input.m_transformA = col0->getWorldTransform();
       input.m_transformB = col1->getWorldTransform();

       detector.getClosestPoints(input,*resultOut,dispatchInfo.m_debugDraw);

       if (m_ownManifold)
              resultOut->refreshContactPoints();
       
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 57 of file btCollisionAlgorithm.h.

btPersistentManifold* btSphereTriangleCollisionAlgorithm::m_manifoldPtr [private]

Definition at line 31 of file btSphereTriangleCollisionAlgorithm.h.

Definition at line 30 of file btSphereTriangleCollisionAlgorithm.h.

Definition at line 32 of file btSphereTriangleCollisionAlgorithm.h.


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