Enable graphical benchmark by default in cmake

Toggle between point to point and generic 6dof constraint for mouse picking in the demos

Use a 'equal vertex thresdhold' in the btVoronoiSimplexSolver of  0.0001f by default.
This can be disabled (or configured) using defaultCollisionConfiguration->getSimplexSolver()->setEqualVertexThreshold(0.f);
See http://code.google.com/p/bullet/issues/detail?id=305
This commit is contained in:
erwin.coumans
2010-02-24 01:28:23 +00:00
parent 1425feec26
commit e156967762
6 changed files with 136 additions and 62 deletions

View File

@@ -289,7 +289,11 @@ bool btVoronoiSimplexSolver::inSimplex(const btVector3& w)
//w is in the current (reduced) simplex
for (i=0;i<numverts;i++)
{
#ifdef BT_USE_EQUAL_VERTEX_THRESHOLD
if ( m_simplexVectorW[i].distance2(w) <= m_equalVertexThreshold)
#else
if (m_simplexVectorW[i] == w)
#endif
found = true;
}

View File

@@ -24,6 +24,11 @@ subject to the following restrictions:
#define VORONOI_SIMPLEX_MAX_VERTS 5
///disable next define, or use defaultCollisionConfiguration->getSimplexSolver()->setEqualVertexThreshold(0.f) to disable/configure
#define BT_USE_EQUAL_VERTEX_THRESHOLD
#define VORONOI_DEFAULT_EQUAL_VERTEX_THRESHOLD 0.0001f
struct btUsageBitfield{
btUsageBitfield()
{
@@ -106,8 +111,11 @@ public:
btVector3 m_cachedP2;
btVector3 m_cachedV;
btVector3 m_lastW;
btScalar m_equalVertexThreshold;
bool m_cachedValidClosest;
btSubSimplexClosestResult m_cachedBC;
bool m_needsUpdate;
@@ -122,10 +130,23 @@ public:
public:
btVoronoiSimplexSolver()
: m_equalVertexThreshold(VORONOI_DEFAULT_EQUAL_VERTEX_THRESHOLD)
{
}
void reset();
void addVertex(const btVector3& w, const btVector3& p, const btVector3& q);
void setEqualVertexThreshold(btScalar threshold)
{
m_equalVertexThreshold = threshold;
}
btScalar getEqualVertexThreshold() const
{
return m_equalVertexThreshold;
}
bool closest(btVector3& v);