Enable MPR by default

Add the contact point from MPR, in addition to SAT/clipping contacts. Added a new kernel to clear/reset the number of contacts in pairs (stored in the z component)
Always sample unit sphere directions, if there are more edge-edge combinations than unit sphere directions (162 by default)
Remember last running demo for Bullet 3 (and save it in a text file, Bullet
Enable the testFileFracture.bullet in the Bullet2FileDemo
This commit is contained in:
Erwin Coumans
2014-01-15 10:35:51 -08:00
parent ca86e135de
commit 472a4068fc
27 changed files with 573 additions and 65 deletions

View File

@@ -9,7 +9,6 @@
#include "../bullet2/RagdollDemo/RagdollDemo.h"
#include <stdio.h>
struct BulletDemoEntry
{
@@ -30,10 +29,10 @@ static BulletDemoEntry allDemos[]=
};
#include <stdio.h>
static const char* startFileName = "startDemo.txt";
static void saveCurrentDemoEntry(int currentEntry)
static void saveCurrentDemoEntry(int currentEntry,const char* startFileName)
{
FILE* f = fopen(startFileName,"w");
if (f)
@@ -43,7 +42,7 @@ static void saveCurrentDemoEntry(int currentEntry)
}
};
static int loadCurrentDemoEntry()
static int loadCurrentDemoEntry(const char* startFileName)
{
int currentEntry= 0;
FILE* f = fopen(startFileName,"r");

View File

@@ -7,7 +7,7 @@
#include "BulletDemoEntries.h"
#define DEMO_SELECTION_COMBOBOX 13
const char* startFileName = "bulletDemo.txt";
static SimpleOpenGL3App* app=0;
static GwenUserInterface* gui = 0;
static int sCurrentDemoIndex = 0;
@@ -120,7 +120,7 @@ void MyComboBoxCallback(int comboId, const char* item)
if (strcmp(item,allNames[i])==0)
{
selectDemo(i);
saveCurrentDemoEntry(sCurrentDemoIndex);
saveCurrentDemoEntry(sCurrentDemoIndex,startFileName);
break;
}
}
@@ -157,7 +157,7 @@ int main(int argc, char* argv[])
allNames.push_back(allDemos[i].m_name);
}
selectDemo(loadCurrentDemoEntry());
selectDemo(loadCurrentDemoEntry(startFileName));
gui->registerComboBox(DEMO_SELECTION_COMBOBOX,allNames.size(),&allNames[0],sCurrentDemoIndex);
//const char* names2[] = {"comboF", "comboG","comboH"};

View File

@@ -75,6 +75,31 @@ extern bool gUseCalculateOverlappingPairsHost;
extern bool gIntegrateOnCpu;
extern bool gConvertConstraintOnCpu;
static const char* sStartFileName = "bullet3StartDemo.txt";
static void saveCurrentDemoEntry(int currentEntry,const char* startFileName)
{
FILE* f = fopen(startFileName,"w");
if (f)
{
fprintf(f,"%d\n",currentEntry);
fclose(f);
}
};
static int loadCurrentDemoEntry(const char* startFileName)
{
int currentEntry= 0;
FILE* f = fopen(startFileName,"r");
if (f)
{
fscanf(f,"%d",&currentEntry);
fclose(f);
}
return currentEntry;
};
static void MyResizeCallback( float width, float height)
{
g_OpenGLWidth = width;
@@ -180,6 +205,7 @@ void MyComboBoxCallback(int comboId, const char* item)
gReset = true;
selectedDemo = i;
printf("selected demo %s!\n", item);
saveCurrentDemoEntry(i,sStartFileName);
}
}
}
@@ -611,6 +637,8 @@ int main(int argc, char* argv[])
return 0;
}
selectedDemo = loadCurrentDemoEntry(sStartFileName);
args.GetCmdLineArgument("selected_demo",selectedDemo);

View File

@@ -17,8 +17,8 @@ void Bullet2FileDemo::setupScene(const ConstructionInfo& ci)
{
b3Assert(ci.m_instancingRenderer);
const char* fileName="data/testFile.bullet";
//const char* fileName="data/testFileFracture.bullet";
//const char* fileName="data/testFile.bullet";
const char* fileName="data/testFileFracture.bullet";
FILE* f = 0;

View File

@@ -233,7 +233,7 @@ void ConcaveScene::setupScene(const ConstructionInfo& ci)
// b3Vector3 shift3(130,-150,-75);//0,230,80);//150,-100,-120);
// createConcaveMesh(ci,"leoTest1.obj",shift3,scaling);
createConcaveMesh(ci,"samurai_monastry.obj",shift1,scaling);
createConcaveMesh(ci,fileName,shift1,scaling);
} else
{