ImportURDFSetup: add Wavefront/obj support

ImportURDFSetup: initialize mass/inertia to 1 by default (instead of 0)
This commit is contained in:
erwin coumans
2015-03-09 14:23:17 -07:00
parent 5e78feb4cb
commit ebd63d92c9
5 changed files with 60 additions and 7 deletions

View File

@@ -0,0 +1,17 @@
#include "LoadMeshFromObj.h"
#include"../Wavefront/tiny_obj_loader.h"
#include "OpenGLWindow/GLInstanceGraphicsShape.h"
#include <stdio.h> //fopen
#include "Bullet3Common/b3AlignedObjectArray.h"
#include <string>
#include <vector>
#include "Wavefront2GLInstanceGraphicsShape.h"
GLInstanceGraphicsShape* LoadMeshFromObj(const char* relativeFileName, const char* materialPrefixPath)
{
std::vector<tinyobj::shape_t> shapes;
std::string err = tinyobj::LoadObj(shapes, relativeFileName, materialPrefixPath);
GLInstanceGraphicsShape* gfxShape = btgCreateGraphicsShapeFromWavefrontObj(shapes);
return gfxShape;
}