| 70 | } |
| 71 | |
| 72 | scene::INodePtr ModelCache::getModelNodeForStaticResource(const std::string& resourcePath) |
| 73 | { |
| 74 | // Get the extension of this model |
| 75 | auto extension = os::getExtension(resourcePath); |
| 76 | |
| 77 | // Find a suitable model loader |
| 78 | auto modelLoader = GlobalModelFormatManager().getImporter(extension); |
| 79 | |
| 80 | auto fullPath = module::GlobalModuleRegistry().getApplicationContext().getRuntimeDataPath(); |
| 81 | fullPath += "resources/" + resourcePath; |
| 82 | |
| 83 | auto node = modelLoader->loadModel(fullPath); |
| 84 | |
| 85 | return node ? node : loadNullModel(resourcePath); |
| 86 | } |
| 87 | |
| 88 | scene::INodePtr ModelCache::loadNullModel(const std::string& modelPath) |
| 89 | { |
no test coverage detected