37         int numVerts = pVtxIn.
size();
    44         ds = planeNormalWS.
dot(firstVertex)+planeEqWS;
    46         for (ve = 0; ve < numVerts; ve++)
    50                 de = planeNormalWS.
dot(endVertex)+planeEqWS;
    74                 firstVertex = endVertex;
    87         hullA.
project(transA,sep_axis, Min0, Max0,witnesPtMinA,witnesPtMaxA);
    88         hullB.
project(transB, sep_axis, Min1, Max1,witnesPtMinB,witnesPtMaxB);
    90         if(Max0<Min1 || Max1<Min0)
   100                 witnessPointA = witnesPtMaxA;
   101                 witnessPointB = witnesPtMinB;
   106                 witnessPointA = witnesPtMinA;
   107                 witnessPointB = witnesPtMaxB;
   123 #ifdef TEST_INTERNAL_OBJECTS   131         p[0] = sv[0] < 0.0f ? -extents[0] : extents[0];
   132         p[1] = sv[1] < 0.0f ? -extents[1] : extents[1];
   133         p[2] = sv[2] < 0.0f ? -extents[2] : extents[2];
   155         InverseTransformPoint3x3(localAxis0, axis,trans0);
   157         InverseTransformPoint3x3(localAxis1, axis,trans1);
   160         BoxSupport(convex0.
m_extents, localAxis0, p0);
   162         BoxSupport(convex1.
m_extents, localAxis1, p1);
   164         const btScalar Radius0 = p0[0]*localAxis0.
x() + p0[1]*localAxis0.
y() + p0[2]*localAxis0.
z();
   165         const btScalar Radius1 = p1[0]*localAxis1.
x() + p1[1]*localAxis1.
y() + p1[2]*localAxis1.
z();
   170         const btScalar MinMaxRadius = MaxRadius + MinRadius;
   171         const btScalar d0 = MinMaxRadius + dp;
   172         const btScalar d1 = MinMaxRadius - dp;
   174         const btScalar depth = d0<d1 ? d0:d1;
   179 #endif //TEST_INTERNAL_OBJECTS   198         btScalar denom = 1.0f - dirA_dot_dirB * dirA_dot_dirB;
   200         if ( denom == 0.0f ) {
   203                 tA = ( dirA_dot_trans - dirB_dot_trans * dirA_dot_dirB ) / denom;
   206                 else if ( tA > hlenA )
   210         tB = tA * dirA_dot_dirB - dirB_dot_trans;
   214                 tA = tB * dirA_dot_dirB + dirA_dot_trans;
   218                 else if ( tA > hlenA )
   220         } 
else if ( tB > hlenB ) {
   222                 tA = tB * dirA_dot_dirB + dirA_dot_trans;
   226                 else if ( tA > hlenA )
   235         ptsVector = translation - offsetA + offsetB;
   255         for(
int i=0;i<numFacesA;i++)
   259                 if (DeltaC2.
dot(faceANormalWS)<0)
   263 #ifdef TEST_INTERNAL_OBJECTS   265                 if(
gUseInternalObject && !TestInternalObjects(transA,transB, DeltaC2, faceANormalWS, hullA, hullB, dmin))
   272                 if(!
TestSepAxis( hullA, hullB, transA,transB, faceANormalWS, d,wA,wB))
   284         for(
int i=0;i<numFacesB;i++)
   288                 if (DeltaC2.
dot(WorldNormal)<0)
   292 #ifdef TEST_INTERNAL_OBJECTS   294                 if(
gUseInternalObject && !TestInternalObjects(transA,transB,DeltaC2, WorldNormal, hullA, hullB, dmin))
   301                 if(!
TestSepAxis(hullA, hullB,transA,transB, WorldNormal,d,wA,wB))
   311         btVector3 edgeAstart,edgeAend,edgeBstart,edgeBend;
   316         btVector3 witnessPointA(0,0,0),witnessPointB(0,0,0);
   335                                 if (DeltaC2.
dot(Cross)<0)
   339 #ifdef TEST_INTERNAL_OBJECTS   341                                 if(
gUseInternalObject && !TestInternalObjects(transA,transB,DeltaC2, Cross, hullA, hullB, dmin))
   348                                 if(!
TestSepAxis( hullA, hullB, transA,transB, Cross, dist,wA,wB))
   357                                         worldEdgeA = WorldEdge0;
   358                                         worldEdgeB = WorldEdge1;
   367         if (edgeA>=0&&edgeB>=0)
   378                 btVector3 translation = witnessPointB-witnessPointA;
   396                         if (ptsVector.
dot(DeltaC2)<0.f)
   400                         btVector3 ptOnB = witnessPointB + offsetB;
   408         if((DeltaC2.
dot(sep))<0.0f)
   444         for(
int e0=0;e0<numVerticesA;e0++)
   454                 btScalar planeEqWS1 = -worldA1.
dot(planeNormalWS1);
   458                 int otherFace = polyA.m_connectedFaces[e0];
   465                 btVector3 planeNormalWS = planeNormalWS1;
   471                 clipFace(*pVtxIn, *pVtxOut,planeNormalWS,planeEqWS);
   489                 for (
int i=0;i<pVtxIn->
size();i++)
   502 #ifdef ONLY_REPORT_DEEPEST_POINT   508                                         printf(
"error in btPolyhedralContactClipping depth = %f\n", depth);
   509                                         printf(
"likely wrong separatingNormal passed in\n");
   517 #ifdef ONLY_REPORT_DEEPEST_POINT   518         if (curMaxDist<maxDist)
   522 #endif //ONLY_REPORT_DEEPEST_POINT   559                                         for(
int e0=0;e0<numVertices;e0++)
   568                 clipFaceAgainstHull(separatingNormal, hullA, transA,worldVertsB1, worldVertsB2,minDist, maxDist,resultOut);
 
btAlignedObjectArray< btVector3 > m_vertices
void push_back(const T &_Val)
void setValue(const btScalar &_x, const btScalar &_y, const btScalar &_z)
btScalar length2() const
Return the length of the vector squared. 
btScalar btSqrt(btScalar y)
const T & at(int n) const
#define SIMD_FORCE_INLINE
btAlignedObjectArray< btVector3 > m_uniqueEdges
btVector3 & normalize()
Normalize this vector x^2 + y^2 + z^2 = 1. 
btVector3 normalized() const
Return a normalized version of this vector. 
void project(const btTransform &trans, const btVector3 &dir, btScalar &minProj, btScalar &maxProj, btVector3 &witnesPtMin, btVector3 &witnesPtMax) const
btAlignedObjectArray< int > m_indices
const btScalar & x() const
Return the x value. 
btAlignedObjectArray< btFace > m_faces
btVector3 cross(const btVector3 &v) const
Return the cross product between this and another vector. 
btScalar dot(const btVector3 &v) const
Return the dot product. 
const btScalar & y() const
Return the y value. 
const btScalar & z() const
Return the z value. 
static btMatrix3x3 Cross(const btVector3 &v)
btVector3 can be used to represent 3D points and vectors. 
int size() const
return the number of elements in the array 
virtual void addContactPoint(const btVector3 &normalOnBInWorld, const btVector3 &pointInWorld, btScalar depth)=0
void resize(int newsize, const T &fillData=T())
The btMatrix3x3 class implements a 3x3 rotation matrix, to perform linear algebra in combination with...
btScalar btDot(const btVector3 &v1, const btVector3 &v2)
Return the dot product between two vectors. 
btVector3 lerp(const btVector3 &v, const btScalar &t) const
Return the linear interpolation between this and another vector. 
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
btScalar btFabs(btScalar x)