| 79 | } |
| 80 | |
| 81 | Vec3F jsonToVec3F(Json const& v) { |
| 82 | if (v.type() != Json::Type::Array || v.size() != 3) |
| 83 | throw JsonException("Json not an array of size 3 in jsonToVec3D"); |
| 84 | |
| 85 | return Vec3F(v.getFloat(0), v.getFloat(1), v.getFloat(2)); |
| 86 | } |
| 87 | |
| 88 | Json jsonFromVec3F(Vec3F const& v) { |
| 89 | return JsonArray{v[0], v[1], v[2]}; |
no test coverage detected