mirror of
https://github.com/bulletphysics/bullet3
synced 2024-12-15 14:10:11 +00:00
18 lines
638 B
C++
18 lines
638 B
C++
#include "LoadMeshFromObj.h"
|
|
#include"../../ThirdPartyLibs/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;
|
|
}
|