| 45 | } |
| 46 | |
| 47 | IParticleNodePtr ParticlesManager::createParticleNode(const std::string& name) |
| 48 | { |
| 49 | std::string nameCleaned = name; |
| 50 | |
| 51 | // Cut off the ".prt" from the end of the particle name |
| 52 | if (string::ends_with(nameCleaned, ".prt")) |
| 53 | { |
| 54 | nameCleaned = nameCleaned.substr(0, nameCleaned.length() - 4); |
| 55 | } |
| 56 | |
| 57 | auto def = getDefByName(nameCleaned); |
| 58 | |
| 59 | if (!def) |
| 60 | { |
| 61 | return IParticleNodePtr(); |
| 62 | } |
| 63 | |
| 64 | return std::make_shared<ParticleNode>(std::make_shared<RenderableParticle>(def)); |
| 65 | } |
| 66 | |
| 67 | IRenderableParticlePtr ParticlesManager::getRenderableParticle(const std::string& name) |
| 68 | { |
no test coverage detected