+Added btDbvtBroadphase, this very fast/efficient broadphase is based on Dynamic AABB tree (btDbvt).
+SoftBody improvements by Nathanael Presson: +Add tetrahedralization +Add support for tearing/slicing cloth and deformable volumes. Uncomment the line in Bullet/src/BulletSoftBody/btSoftBodyHelpers.h: //#define BT_SOFTBODY_USE_STL 1
This commit is contained in:
@@ -22,6 +22,7 @@ subject to the following restrictions:
|
||||
#include "RenderingHelpers.h"
|
||||
#include "GLFontRenderer.h"
|
||||
#include "btBulletCollisionCommon.h"
|
||||
#include "BulletSoftBody/btDbvtBroadphase.h"
|
||||
|
||||
int numParts =2;
|
||||
|
||||
@@ -99,7 +100,10 @@ BulletSAPCompleteBoxPruningTest::BulletSAPCompleteBoxPruningTest(int numBoxes,in
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
case 7:
|
||||
m_broadphase = new btDbvtBroadphase();
|
||||
methodname = "btDbvtBroadphase";
|
||||
break;
|
||||
default:
|
||||
{
|
||||
m_broadphase = new btAxisSweep3(aabbMin,aabbMax,numBoxes,new btNullPairCache());
|
||||
@@ -179,7 +183,7 @@ bool BulletSAPCompleteBoxPruningTest::UpdateBoxes(int numBoxes)
|
||||
{
|
||||
static bool once=true;
|
||||
|
||||
for(udword i=0;i<numBoxes;i++)
|
||||
for(udword i=0;i<(udword)numBoxes;i++)
|
||||
{
|
||||
mBoxTime[i] += mSpeed;
|
||||
|
||||
@@ -195,18 +199,19 @@ bool BulletSAPCompleteBoxPruningTest::UpdateBoxes(int numBoxes)
|
||||
return true;
|
||||
}
|
||||
extern int doTree;
|
||||
extern int percentUpdate;
|
||||
|
||||
void BulletSAPCompleteBoxPruningTest::PerformTest()
|
||||
{
|
||||
int numUpdatedBoxes = (mNbBoxes*10)/100;
|
||||
int numUpdatedBoxes = (mNbBoxes*percentUpdate)/100;
|
||||
if (m_firstTime)
|
||||
{
|
||||
numUpdatedBoxes = mNbBoxes;
|
||||
m_firstTime = false;
|
||||
}
|
||||
|
||||
mProfiler.Start();
|
||||
UpdateBoxes(numUpdatedBoxes);
|
||||
|
||||
|
||||
mPairs.ResetPairs();
|
||||
|
||||
@@ -240,7 +245,7 @@ void BulletSAPCompleteBoxPruningTest::PerformTest()
|
||||
btOverlappingPairCache* pairCache = m_broadphase->getOverlappingPairCache();
|
||||
const btBroadphasePair* pairPtr = pairCache->getOverlappingPairArrayPtr();
|
||||
|
||||
for(udword i=0;i<pairCache->getNumOverlappingPairs();i++)
|
||||
for(udword i=0;i<(udword)pairCache->getNumOverlappingPairs();i++)
|
||||
{
|
||||
// Flags[pairPtr[i].m_pProxy0->getUid()-1] = true;
|
||||
// Flags[pairPtr[i].m_pProxy1->getUid()-1] = true;
|
||||
|
||||
@@ -32,8 +32,9 @@ subject to the following restrictions:
|
||||
//#define NUM_SAP_BOXES 8192
|
||||
//#define NUM_SAP_BOXES 4096
|
||||
|
||||
#define NUM_SAP_BOXES 4096
|
||||
#define NUM_SAP_BOXES 8192
|
||||
|
||||
int percentUpdate = 10;
|
||||
|
||||
//Broadphase comparison
|
||||
//Static case (updating 10% of objects to same position ( -> no swaps)
|
||||
@@ -73,8 +74,8 @@ enum TestIndex
|
||||
MAX_NB_TESTS
|
||||
};
|
||||
|
||||
static int gTest = TEST_BULLET_MULTISAP_8192;
|
||||
static int gSelectedTest = TEST_BULLET_MULTISAP_8192;
|
||||
static int gTest = TEST_DBVT_8192;//TEST_BULLET_MULTISAP_8192;
|
||||
static int gSelectedTest = TEST_DBVT_8192;//TEST_BULLET_MULTISAP_8192;
|
||||
static CollisionTest* gCollisionTests[MAX_NB_TESTS];
|
||||
|
||||
static GLFontRenderer gFnt;
|
||||
@@ -300,6 +301,7 @@ int main(int argc, char** argv)
|
||||
};
|
||||
TwType testType = TwDefineEnum("CollisionTest", testEV, MAX_NB_TESTS);
|
||||
TwAddVarRW(gMainBar, "CollisionTests", testType, &gSelectedTest, "");
|
||||
TwAddVarRW(gMainBar, "% of updates",TW_TYPE_INT32,&percentUpdate,"min=0 max=100");
|
||||
}
|
||||
|
||||
// Create tests
|
||||
@@ -315,7 +317,7 @@ int main(int argc, char** argv)
|
||||
// gCollisionTests[TEST_BULLET_SAP_SORTEDPAIRS_8192] = new BulletSAPCompleteBoxPruningTest(NUM_SAP_BOXES,3);
|
||||
gCollisionTests[TEST_BULLET_MULTISAP_8192] = new BulletSAPCompleteBoxPruningTest(NUM_SAP_BOXES,6);
|
||||
// gCollisionTests[TEST_BIPARTITE_BOX_PRUNING] = new BipartiteBoxPruningTest;
|
||||
gCollisionTests[TEST_DBVT_8192] = new DbvtTest(NUM_SAP_BOXES);
|
||||
gCollisionTests[TEST_DBVT_8192] = new BulletSAPCompleteBoxPruningTest(NUM_SAP_BOXES,7);
|
||||
|
||||
for(int i=0;i<MAX_NB_TESTS;i++)
|
||||
gCollisionTests[i]->Init();
|
||||
@@ -418,4 +420,4 @@ void BuildBulletTree()
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user