objParser.h 666 B

1234567891011121314151617181920212223
  1. #ifndef OBJPARSER_H
  2. #define OBJPARSER_H
  3. #include <fstream>
  4. #include <sstream>
  5. #include "mesh.h"
  6. //Just a namespace for functions related to loading data from wavefront OBJ files
  7. namespace OBJ{
  8. //Assumes that the path given is valid
  9. Mesh& buildMeshFromFile(Mesh &mesh, std::string path);
  10. //Checks if the path actually contains a valid file
  11. bool fileExists(std::string &path);
  12. //Get vertices, normals and all index data into the mesh object
  13. void loadFileData(Mesh &mesh, std::ifstream &file);
  14. //Simple string splitting method using a single char delimeter
  15. std::vector<std::string> splitStr(std::string &str, char delim);
  16. }
  17. #endif