| 20 | {} |
| 21 | |
| 22 | scene::INodePtr ModelCache::getModelNode(const std::string& modelPath) |
| 23 | { |
| 24 | // Get the extension of this model |
| 25 | auto extension = os::getExtension(modelPath); |
| 26 | |
| 27 | if (extension == "prt") |
| 28 | { |
| 29 | // This is a particle, pass the call to the Particles Manager |
| 30 | return GlobalParticlesManager().createParticleNode(modelPath); |
| 31 | } |
| 32 | |
| 33 | // Get a suitable model loader |
| 34 | auto modelLoader = GlobalModelFormatManager().getImporter(extension); |
| 35 | |
| 36 | // Try to construct a model node using the suitable loader |
| 37 | auto node = modelLoader->loadModel(modelPath); |
| 38 | |
| 39 | // In case the model load failed, let's return a NullModel |
| 40 | return node ? node : loadNullModel(modelPath); |
| 41 | } |
| 42 | |
| 43 | IModelPtr ModelCache::getModel(const std::string& modelPath) |
| 44 | { |
no test coverage detected