| 710 | } |
| 711 | |
| 712 | std::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 | |
| 739 | std::string LoadObj(std::vector<shape_t>& shapes, |
| 740 | std::vector<material_t>& materials, // [output] |
no test coverage detected