MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / getModelNode

Method getModelNode

radiantcore/model/ModelCache.cpp:22–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20{}
21
22scene::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
43IModelPtr ModelCache::getModel(const std::string& modelPath)
44{

Callers 5

updateMaterialsListMethod · 0.45
getOriginForFloorTraceFunction · 0.45
attachModelNodeMethod · 0.45

Calls 4

getExtensionFunction · 0.85
createParticleNodeMethod · 0.80
getImporterMethod · 0.80
loadModelMethod · 0.45

Tested by

no test coverage detected