33#define CATCH_DEGENERATE_TETRAHEDRON 1
141 nearest = from + t * v;
247 for (i = 0; i < numverts; i++)
276 for (i = 0; i < numverts; i++)
278#ifdef BT_USE_EQUAL_VERTEX_THRESHOLD
335 if (d3 >=
btScalar(0.0) && d4 <= d3)
360 if (d6 >=
btScalar(0.0) && d5 <= d6)
385 btScalar w = (d4 - d3) / ((d4 - d3) + (d5 - d6));
418#ifdef CATCH_DEGENERATE_TETRAHEDRON
419#ifdef BT_USE_DOUBLE_PRECISION
434 return signp * signd <
btScalar(0.);
454 if (pointOutsideABC < 0 || pointOutsideACD < 0 || pointOutsideADB < 0 || pointOutsideBDC < 0)
460 if (!pointOutsideABC && !pointOutsideACD && !pointOutsideADB && !pointOutsideBDC)
474 if (sqDist < bestSqDist)
499 if (sqDist < bestSqDist)
524 if (sqDist < bestSqDist)
548 if (sqDist < bestSqDist)
btScalar dot(const btQuaternion &q1, const btQuaternion &q2)
Calculate the dot product between two quaternions.
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
btVector3 can be used to represent 3D points and vectors.
btScalar dot(const btVector3 &v) const
Return the dot product.
void setValue(const btScalar &_x, const btScalar &_y, const btScalar &_z)
btScalar length2() const
Return the length of the vector squared.
void reduceVertices(const btUsageBitfield &usedVerts)
btVector3 m_simplexPointsP[VORONOI_SIMPLEX_MAX_VERTS]
btVector3 m_simplexVectorW[VORONOI_SIMPLEX_MAX_VERTS]
btSubSimplexClosestResult m_cachedBC
int getSimplex(btVector3 *pBuf, btVector3 *qBuf, btVector3 *yBuf) const
void addVertex(const btVector3 &w, const btVector3 &p, const btVector3 &q)
bool closestPtPointTetrahedron(const btVector3 &p, const btVector3 &a, const btVector3 &b, const btVector3 &c, const btVector3 &d, btSubSimplexClosestResult &finalResult)
bool m_cachedValidClosest
bool inSimplex(const btVector3 &w)
bool emptySimplex() const
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.
void compute_points(btVector3 &p1, btVector3 &p2)
bool updateClosestVectorAndPoints()
bool closestPtPointTriangle(const btVector3 &p, const btVector3 &a, const btVector3 &b, const btVector3 &c, btSubSimplexClosestResult &result)
bool closest(btVector3 &v)
btScalar m_equalVertexThreshold
void removeVertex(int index)
void backup_closest(btVector3 &v)
btVector3 m_simplexPointsQ[VORONOI_SIMPLEX_MAX_VERTS]
void setBarycentricCoordinates(btScalar a=btScalar(0.), btScalar b=btScalar(0.), btScalar c=btScalar(0.), btScalar d=btScalar(0.))
btUsageBitfield m_usedVertices
btScalar m_barycentricCoords[4]
btVector3 m_closestPointOnSimplex
unsigned short usedVertexC
unsigned short usedVertexB
unsigned short usedVertexA
unsigned short usedVertexD