| 185 | } |
| 186 | |
| 187 | void Scene::LoadModelAsync( |
| 188 | uint32_t index, |
| 189 | const std::filesystem::path& fileName, |
| 190 | ThreadPool* threadPool) |
| 191 | { |
| 192 | if (threadPool) |
| 193 | { |
| 194 | threadPool->AddTask([this, index, threadPool, fileName]() |
| 195 | { |
| 196 | SceneImportResult result; |
| 197 | m_GltfImporter->Load(fileName, *m_TextureCache, g_LoadingStats, threadPool, result); |
| 198 | ++g_LoadingStats.ObjectsLoaded; |
| 199 | m_Models[index] = result; |
| 200 | }); |
| 201 | } |
| 202 | else |
| 203 | { |
| 204 | SceneImportResult result; |
| 205 | m_GltfImporter->Load(fileName, *m_TextureCache, g_LoadingStats, threadPool, result); |
| 206 | ++g_LoadingStats.ObjectsLoaded; |
| 207 | m_Models[index] = result; |
| 208 | } |
| 209 | } |
| 210 | |
| 211 | void Scene::LoadModels( |
| 212 | const Json::Value& modelList, |