Add support for childshape index for btCompoundShape during ContactAddedCallback,
see example in Bullet/Demos/ConvexDecompositionDemo Removed some warnings
This commit is contained in:
@@ -33,8 +33,9 @@ struct btDiscreteCollisionDetectorInterface
|
||||
|
||||
virtual ~Result(){}
|
||||
|
||||
///setShapeIdentifiers provides experimental support for per-triangle material / custom material combiner
|
||||
virtual void setShapeIdentifiers(int partId0,int index0, int partId1,int index1)=0;
|
||||
///setShapeIdentifiersA/B provides experimental support for per-triangle material / custom material combiner
|
||||
virtual void setShapeIdentifiersA(int partId0,int index0)=0;
|
||||
virtual void setShapeIdentifiersB(int partId1,int index1)=0;
|
||||
virtual void addContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,btScalar depth)=0;
|
||||
};
|
||||
|
||||
|
||||
@@ -297,6 +297,9 @@ namespace gjkepa2_impl
|
||||
{
|
||||
case eStatus::Valid: m_distance=m_ray.length();break;
|
||||
case eStatus::Inside: m_distance=0;break;
|
||||
default:
|
||||
{
|
||||
}
|
||||
}
|
||||
return(m_status);
|
||||
}
|
||||
@@ -415,8 +418,8 @@ namespace gjkepa2_impl
|
||||
if(l>GJK_SIMPLEX3_EPS)
|
||||
{
|
||||
btScalar mindist=-1;
|
||||
btScalar subw[2];
|
||||
U subm;
|
||||
btScalar subw[2]={0.f,0.f};
|
||||
U subm(0);
|
||||
for(U i=0;i<3;++i)
|
||||
{
|
||||
if(btDot(*vt[i],btCross(dl[i],n))>0)
|
||||
@@ -462,8 +465,8 @@ namespace gjkepa2_impl
|
||||
if(ng&&(btFabs(vl)>GJK_SIMPLEX4_EPS))
|
||||
{
|
||||
btScalar mindist=-1;
|
||||
btScalar subw[3];
|
||||
U subm;
|
||||
btScalar subw[3]={0.f,0.f,0.f};
|
||||
U subm(0);
|
||||
for(U i=0;i<3;++i)
|
||||
{
|
||||
const U j=imd3[i];
|
||||
@@ -892,6 +895,9 @@ bool btGjkEpaSolver2::Penetration( const btConvexShape* shape0,
|
||||
case GJK::eStatus::Failed:
|
||||
results.status=sResults::GJK_Failed;
|
||||
break;
|
||||
default:
|
||||
{
|
||||
}
|
||||
}
|
||||
return(false);
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ static bool Penetration(const btConvexShape* shape0,const btTransform& wtrs0,
|
||||
const btVector3& guess,
|
||||
sResults& results,
|
||||
bool usemargins=true);
|
||||
|
||||
#ifndef __SPU__
|
||||
static btScalar SignedDistance( const btVector3& position,
|
||||
btScalar margin,
|
||||
const btConvexShape* shape,
|
||||
@@ -66,6 +66,8 @@ static bool SignedDistance( const btConvexShape* shape0,const btTransform& wtrs
|
||||
const btConvexShape* shape1,const btTransform& wtrs1,
|
||||
const btVector3& guess,
|
||||
sResults& results);
|
||||
#endif //__SPU__
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -32,7 +32,7 @@ bool btGjkEpaPenetrationDepthSolver::calcPenDepth( btSimplexSolverInterface& sim
|
||||
(void)v;
|
||||
(void)simplexSolver;
|
||||
|
||||
const btScalar radialmargin(btScalar(0.));
|
||||
// const btScalar radialmargin(btScalar(0.));
|
||||
|
||||
btVector3 guessVector(transformA.getOrigin()-transformB.getOrigin());
|
||||
btGjkEpaSolver2::sResults results;
|
||||
|
||||
@@ -91,10 +91,13 @@ bool btMinkowskiPenetrationDepthSolver::calcPenDepth(btSimplexSolverInterface& s
|
||||
btScalar m_depth;
|
||||
bool m_hasResult;
|
||||
|
||||
virtual void setShapeIdentifiers(int partId0,int index0, int partId1,int index1)
|
||||
virtual void setShapeIdentifiersA(int partId0,int index0)
|
||||
{
|
||||
(void)partId0;
|
||||
(void)index0;
|
||||
}
|
||||
virtual void setShapeIdentifiersB(int partId1,int index1)
|
||||
{
|
||||
(void)partId1;
|
||||
(void)index1;
|
||||
}
|
||||
|
||||
@@ -35,13 +35,16 @@ struct btPointCollector : public btDiscreteCollisionDetectorInterface::Result
|
||||
{
|
||||
}
|
||||
|
||||
virtual void setShapeIdentifiers(int partId0,int index0, int partId1,int index1)
|
||||
virtual void setShapeIdentifiersA(int partId0,int index0)
|
||||
{
|
||||
(void)partId0;
|
||||
(void)index0;
|
||||
|
||||
}
|
||||
virtual void setShapeIdentifiersB(int partId1,int index1)
|
||||
{
|
||||
(void)partId1;
|
||||
(void)index1;
|
||||
//??
|
||||
}
|
||||
|
||||
virtual void addContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,btScalar depth)
|
||||
|
||||
Reference in New Issue
Block a user