| 276 | } |
| 277 | |
| 278 | osg::Vec2f Manager::getVector2(std::string_view setting, std::string_view category) |
| 279 | { |
| 280 | const std::string& value = getString(setting, category); |
| 281 | |
| 282 | std::vector<std::string> components; |
| 283 | Misc::StringUtils::split(value, components); |
| 284 | |
| 285 | if (components.size() == 2) |
| 286 | { |
| 287 | auto x = Misc::StringUtils::toNumeric<float>(components[0]); |
| 288 | auto y = Misc::StringUtils::toNumeric<float>(components[1]); |
| 289 | |
| 290 | if (x && y) |
| 291 | { |
| 292 | return { x.value(), y.value() }; |
| 293 | } |
| 294 | } |
| 295 | |
| 296 | throw std::runtime_error(std::string("Can't parse 2d vector: " + value)); |
| 297 | } |
| 298 | |
| 299 | osg::Vec3f Manager::getVector3(std::string_view setting, std::string_view category) |
| 300 | { |
nothing calls this directly
no test coverage detected