add Obj and STL import demo, work on URDF import

This commit is contained in:
Erwin Coumans
2014-08-03 13:45:05 -07:00
parent 35fa146f13
commit ae98ffe218
18 changed files with 1196 additions and 71 deletions

View File

@@ -16,6 +16,8 @@
#include "../../Demos/CcdPhysicsDemo/CcdPhysicsSetup.h"
#include "../../Demos/ConstraintDemo/ConstraintPhysicsSetup.h"
#include "../ImportURDFDemo/ImportURDFSetup.h"
#include "../ImportObjDemo/ImportObjSetup.h"
#include "../ImportSTLDemo/ImportSTLSetup.h"
static BulletDemoInterface* MyCcdPhysicsDemoCreateFunc(SimpleOpenGL3App* app)
@@ -41,6 +43,17 @@ static BulletDemoInterface* MyImportUrdfCreateFunc(SimpleOpenGL3App* app)
CommonPhysicsSetup* physicsSetup = new ImportUrdfDemo();
return new BasicDemo(app, physicsSetup);
}
static BulletDemoInterface* MyImportObjCreateFunc(SimpleOpenGL3App* app)
{
CommonPhysicsSetup* physicsSetup = new ImportObjDemo(app);
return new BasicDemo(app, physicsSetup);
}
static BulletDemoInterface* MyImportSTLCreateFunc(SimpleOpenGL3App* app)
{
CommonPhysicsSetup* physicsSetup = new ImportSTLDemo(app);
return new BasicDemo(app, physicsSetup);
}
struct BulletDemoEntry
{
@@ -60,7 +73,11 @@ static BulletDemoEntry allDemos[]=
{ 1, "CcdDemo", MyCcdPhysicsDemoCreateFunc },
{ 1, "Kinematic", MyKinematicObjectCreateFunc },
{ 1, "Constraints", MyConstraintCreateFunc },
{0,"File Formats", 0},
//@todo(erwincoumans) { 1, "bullet", MyImportSTLCreateFunc},
{ 1, "Wavefront Obj", MyImportObjCreateFunc},
{ 1, "URDF", MyImportUrdfCreateFunc },
{ 1, "STL", MyImportSTLCreateFunc},
/* {1,"ChainDemo",ChainDemo::MyCreateFunc},
// {0, "Stress tests", 0 },

View File

@@ -331,8 +331,8 @@ int main(int argc, char* argv[])
assert(err==GL_NO_ERROR);
app->m_instancingRenderer->init();
DrawGridData dg;
// dg.upAxis = 2;
dg.upAxis = app->getUpAxis();
app->m_instancingRenderer->updateCamera(dg.upAxis);
app->drawGrid(dg);

View File

@@ -30,6 +30,10 @@
"../../Demos/ConstraintDemo/ConstraintPhysicsSetup.cpp",
"../../Demos/ConstraintDemo/ConstraintPhysicsSetup.h",
"../ImportURDFDemo/ImportURDFSetup.cpp",
"../ImportObjDemo/ImportObjSetup.cpp",
"../ImportSTLDemo/ImportSTLSetup.cpp",
"../Wavefront/tiny_obj_loader.cpp",
"../Wavefront/tiny_obj_loader.h",
"../../btgui/urdf/urdfdom/urdf_parser/src/pose.cpp",
"../../btgui/urdf/urdfdom/urdf_parser/src/model.cpp",
"../../btgui/urdf/urdfdom/urdf_parser/src/link.cpp",