| 11 | |
| 12 | |
| 13 | bool MeshImport::importMesh(const std::string& filename, TriangleMesh& mesh, |
| 14 | const Vector3r& translation, const Matrix3r& rotation, const Vector3r& scale) |
| 15 | { |
| 16 | if (!FileSystem::fileExists(filename)) |
| 17 | { |
| 18 | LOG_ERR << "File not found: " << filename; |
| 19 | return false; |
| 20 | } |
| 21 | string ext = FileSystem::getFileExt(filename); |
| 22 | transform(ext.begin(), ext.end(), ext.begin(), ::toupper); |
| 23 | |
| 24 | if (ext == "PLY") |
| 25 | return importMesh_PLY(filename, mesh, translation, rotation, scale); |
| 26 | else if (ext == "OBJ") |
| 27 | return importMesh_OBJ(filename, mesh, translation, rotation, scale); |
| 28 | else |
| 29 | { |
| 30 | LOG_ERR << "File " << filename << " has an unknown file type."; |
| 31 | return false; |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | bool MeshImport::importMesh_PLY(const std::string& filename, TriangleMesh& mesh, |
| 36 | const Vector3r& translation, const Matrix3r& rotation, const Vector3r& scale) |