34 #define CATCH_DEGENERATE_TETRAHEDRON 1
146 nearest = from + t*v;
256 for (i=0;i<numverts;i++)
290 for (i=0;i<numverts;i++)
292 #ifdef BT_USE_EQUAL_VERTEX_THRESHOLD
352 if (d3 >=
btScalar(0.0) && d4 <= d3)
376 if (d6 >=
btScalar(0.0) && d5 <= d6)
399 btScalar w = (d4 - d3) / ((d4 - d3) + (d5 - d6));
437 #ifdef CATCH_DEGENERATE_TETRAHEDRON
438 #ifdef BT_USE_DOUBLE_PRECISION
453 return signp * signd <
btScalar(0.);
474 if (pointOutsideABC < 0 || pointOutsideACD < 0 || pointOutsideADB < 0 || pointOutsideBDC < 0)
480 if (!pointOutsideABC && !pointOutsideACD && !pointOutsideADB && !pointOutsideBDC)
495 if (sqDist < bestSqDist) {
522 if (sqDist < bestSqDist)
550 if (sqDist < bestSqDist)
577 if (sqDist < bestSqDist)
unsigned short usedVertexA
btVector3 m_closestPointOnSimplex
void setValue(const btScalar &_x, const btScalar &_y, const btScalar &_z)
unsigned short usedVertexD
void reduceVertices(const btUsageBitfield &usedVerts)
unsigned short usedVertexB
bool updateClosestVectorAndPoints()
btVector3 m_simplexPointsQ[VORONOI_SIMPLEX_MAX_VERTS]
btScalar dot(const btVector3 &v) const
Return the dot product.
bool inSimplex(const btVector3 &w)
btScalar m_equalVertexThreshold
bool m_cachedValidClosest
void setBarycentricCoordinates(btScalar a=btScalar(0.), btScalar b=btScalar(0.), btScalar c=btScalar(0.), btScalar d=btScalar(0.))
int getSimplex(btVector3 *pBuf, btVector3 *qBuf, btVector3 *yBuf) const
void addVertex(const btVector3 &w, const btVector3 &p, const btVector3 &q)
btVector3 can be used to represent 3D points and vectors.
btScalar length2() const
Return the length of the vector squared.
void removeVertex(int index)
bool closestPtPointTriangle(const btVector3 &p, const btVector3 &a, const btVector3 &b, const btVector3 &c, btSubSimplexClosestResult &result)
btSubSimplexClosestResult m_cachedBC
int pointOutsideOfPlane(const btVector3 &p, const btVector3 &a, const btVector3 &b, const btVector3 &c, const btVector3 &d)
Test if point p and d lie on opposite sides of plane through abc.
bool emptySimplex() const
static float4 cross(const float4 &a, const float4 &b)
btScalar m_barycentricCoords[4]
unsigned short usedVertexC
void compute_points(btVector3 &p1, btVector3 &p2)
btUsageBitfield m_usedVertices
btScalar dot(const btQuaternion &q1, const btQuaternion &q2)
Calculate the dot product between two quaternions.
void backup_closest(btVector3 &v)
btVector3 m_simplexVectorW[VORONOI_SIMPLEX_MAX_VERTS]
btVector3 m_simplexPointsP[VORONOI_SIMPLEX_MAX_VERTS]
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
bool closest(btVector3 &v)
bool closestPtPointTetrahedron(const btVector3 &p, const btVector3 &a, const btVector3 &b, const btVector3 &c, const btVector3 &d, btSubSimplexClosestResult &finalResult)