MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / jsonToVec3F

Function jsonToVec3F

source/core/StarJsonExtra.cpp:81–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79}
80
81Vec3F 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
88Json jsonFromVec3F(Vec3F const& v) {
89 return JsonArray{v[0], v[1], v[2]};

Callers 2

jsonToMat3FFunction · 0.85
loadEffectConfigMethod · 0.85

Calls 3

getFloatMethod · 0.80
typeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected