Back to index

supertuxkart  0.5+dfsg1
Public Member Functions | Public Attributes
btBoxBoxDetector Struct Reference

btBoxBoxDetector wraps the ODE box-box collision detector re-distributed under the Zlib license with permission from Russell L. Smith More...

#include <btBoxBoxDetector.h>

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

List of all members.

Public Member Functions

 btBoxBoxDetector (btBoxShape *box1, btBoxShape *box2)
 ODE box-box collision detection is adapted to work with Bullet.
virtual ~btBoxBoxDetector ()
virtual void getClosestPoints (const ClosestPointInput &input, Result &output, class btIDebugDraw *debugDraw)

Public Attributes

btBoxShapem_box1
btBoxShapem_box2

Detailed Description

btBoxBoxDetector wraps the ODE box-box collision detector re-distributed under the Zlib license with permission from Russell L. Smith

Definition at line 29 of file btBoxBoxDetector.h.


Constructor & Destructor Documentation

ODE box-box collision detection is adapted to work with Bullet.

Definition at line 28 of file btBoxBoxDetector.cpp.

: m_box1(box1),
m_box2(box2)
{

}
virtual btBoxBoxDetector::~btBoxBoxDetector ( ) [inline, virtual]

Definition at line 38 of file btBoxBoxDetector.h.

{};

Member Function Documentation

void btBoxBoxDetector::getClosestPoints ( const ClosestPointInput input,
Result output,
class btIDebugDraw debugDraw 
) [virtual]

Implements btDiscreteCollisionDetectorInterface.

Definition at line 629 of file btBoxBoxDetector.cpp.

{
       
       const btTransform& transformA = input.m_transformA;
       const btTransform& transformB = input.m_transformB;
       
       int skip = 0;
       dContactGeom *contact = 0;

       dMatrix3 R1;
       dMatrix3 R2;

       for (int j=0;j<3;j++)
       {
              R1[0+4*j] = transformA.getBasis()[j].x();
              R2[0+4*j] = transformB.getBasis()[j].x();

              R1[1+4*j] = transformA.getBasis()[j].y();
              R2[1+4*j] = transformB.getBasis()[j].y();


              R1[2+4*j] = transformA.getBasis()[j].z();
              R2[2+4*j] = transformB.getBasis()[j].z();

       }

       

       btVector3 normal;
       btScalar depth;
       int return_code;
       int maxc = 4;


       dBoxBox2 (transformA.getOrigin(), 
       R1,
       2.f*m_box1->getHalfExtentsWithMargin(),
       transformB.getOrigin(),
       R2, 
       2.f*m_box2->getHalfExtentsWithMargin(),
       normal, &depth, &return_code,
       maxc, contact, skip,
       output
       );

}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 31 of file btBoxBoxDetector.h.

Definition at line 32 of file btBoxBoxDetector.h.


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