MCPcopy Create free account
hub / github.com/axmolengine/axmol / LoadObj

Function LoadObj

core/3d/ObjLoader.cpp:712–737  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

710}
711
712std::string LoadObj(std::vector<shape_t>& shapes,
713 std::vector<material_t>& materials, // [output]
714 const char* filename,
715 const char* mtl_basepath)
716{
717
718 shapes.clear();
719
720 std::stringstream err;
721
722 std::istringstream ifs(ax::FileUtils::getInstance()->getStringFromFile(filename));
723 if (!ifs)
724 {
725 err << "Cannot open file [" << filename << "]" << std::endl;
726 return err.str();
727 }
728
729 std::string basePath;
730 if (mtl_basepath)
731 {
732 basePath = mtl_basepath;
733 }
734 MaterialFileReader matFileReader(basePath);
735
736 return LoadObj(shapes, materials, ifs, matFileReader);
737}
738
739std::string LoadObj(std::vector<shape_t>& shapes,
740 std::vector<material_t>& materials, // [output]

Callers 1

loadObjMethod · 0.85

Calls 15

getInstanceFunction · 0.85
isSpaceFunction · 0.85
parseFloat3Function · 0.85
parseFloat2Function · 0.85
isNewLineFunction · 0.85
parseTripleFunction · 0.85
nextWordFunction · 0.85
exportFaceGroupToShapeFunction · 0.85
parseStringFunction · 0.85
getStringFromFileMethod · 0.80
clearMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected