| 171 | } |
| 172 | |
| 173 | bool Bundle3D::load(std::string_view path) |
| 174 | { |
| 175 | if (path.empty()) |
| 176 | return false; |
| 177 | |
| 178 | if (_path == path) |
| 179 | return true; |
| 180 | |
| 181 | getModelRelativePath(path); |
| 182 | |
| 183 | bool ret = false; |
| 184 | std::string ext = FileUtils::getPathExtension(path); |
| 185 | if (ext == ".c3t") |
| 186 | { |
| 187 | _isBinary = false; |
| 188 | ret = loadJson(path); |
| 189 | } |
| 190 | else if (ext == ".c3b") |
| 191 | { |
| 192 | _isBinary = true; |
| 193 | ret = loadBinary(path); |
| 194 | } |
| 195 | else |
| 196 | { |
| 197 | AXLOGW("warning: {} is invalid file format", path.data()); |
| 198 | } |
| 199 | |
| 200 | ret ? (_path = path) : (_path = ""); |
| 201 | |
| 202 | return ret; |
| 203 | } |
| 204 | |
| 205 | bool Bundle3D::loadObj(MeshDatas& meshdatas, |
| 206 | MaterialDatas& materialdatas, |
no test coverage detected