Back to index

supertuxkart  0.5+dfsg1
Public Member Functions | Public Attributes
btTriangleConvexcastCallback Class Reference

#include <btRaycastCallback.h>

Inheritance diagram for btTriangleConvexcastCallback:
Inheritance graph
Collaboration diagram for btTriangleConvexcastCallback:
Collaboration graph

List of all members.

Public Member Functions

 btTriangleConvexcastCallback (const btConvexShape *convexShape, const btTransform &convexShapeFrom, const btTransform &convexShapeTo, const btTransform &triangleToWorld)
virtual void processTriangle (btVector3 *triangle, int partId, int triangleIndex)
virtual btScalar reportHit (const btVector3 &hitNormalLocal, const btVector3 &hitPointLocal, btScalar hitFraction, int partId, int triangleIndex)=0

Public Attributes

const btConvexShape * m_convexShape
btTransform m_convexShapeFrom
btTransform m_convexShapeTo
btTransform m_triangleToWorld
btScalar m_hitFraction

Detailed Description

Definition at line 42 of file btRaycastCallback.h.

Constructor & Destructor Documentation

btTriangleConvexcastCallback::btTriangleConvexcastCallback ( const btConvexShape *  convexShape,
const btTransform convexShapeFrom,
const btTransform convexShapeTo,
const btTransform triangleToWorld 

Definition at line 108 of file btRaycastCallback.cpp.

       m_convexShape = convexShape;
       m_convexShapeFrom = convexShapeFrom;
       m_convexShapeTo = convexShapeTo;
       m_triangleToWorld = triangleToWorld;
       m_hitFraction = 1.0;

Member Function Documentation

void btTriangleConvexcastCallback::processTriangle ( btVector3 triangle,
int  partId,
int  triangleIndex 
) [virtual]

Implements btTriangleCallback.

Definition at line 118 of file btRaycastCallback.cpp.

       btTriangleShape triangleShape (triangle[0], triangle[1], triangle[2]);

       btVoronoiSimplexSolver      simplexSolver;

//if you reenable USE_SUBSIMPLEX_CONVEX_CAST see commented out code below
       btSubsimplexConvexCast convexCaster(m_convexShape, &triangleShape, &simplexSolver);
       //btGjkConvexCast    convexCaster(m_convexShape,&triangleShape,&simplexSolver);
       btContinuousConvexCollision convexCaster(m_convexShape,&triangleShape,&simplexSolver,NULL);
       btConvexCast::CastResult castResult;
       castResult.m_fraction = btScalar(1.);
       if (convexCaster.calcTimeOfImpact(m_convexShapeFrom,m_convexShapeTo,m_triangleToWorld, m_triangleToWorld, castResult))
              //add hit
              if (castResult.m_normal.length2() > btScalar(0.0001))
                     if (castResult.m_fraction < m_hitFraction)
/* btContinuousConvexCast's normal is already in world space */
                            //rotate normal into worldspace
                            castResult.m_normal = m_convexShapeFrom.getBasis() * castResult.m_normal;

                            reportHit (castResult.m_normal,

Here is the call graph for this function:

virtual btScalar btTriangleConvexcastCallback::reportHit ( const btVector3 hitNormalLocal,
const btVector3 hitPointLocal,
btScalar  hitFraction,
int  partId,
int  triangleIndex 
) [pure virtual]

Here is the caller graph for this function:

Member Data Documentation

Definition at line 45 of file btRaycastCallback.h.

Definition at line 46 of file btRaycastCallback.h.

Definition at line 47 of file btRaycastCallback.h.

Definition at line 49 of file btRaycastCallback.h.

Definition at line 48 of file btRaycastCallback.h.

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