MCPcopy Create free account
hub / github.com/RenderKit/embree / loadVec2fArray

Method loadVec2fArray

tutorials/common/scenegraph/xml_loader.cpp:493–509  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

491 }
492
493 std::vector<Vec2f> XMLLoader::loadVec2fArray(const Ref<XML>& xml)
494 {
495 if (!xml) return std::vector<Vec2f>();
496
497 if (xml->parm("ofs") != "") {
498 return loadBinary<std::vector<Vec2f>>(xml);
499 }
500 else
501 {
502 std::vector<Vec2f> data;
503 if (xml->body.size() % 2 != 0) THROW_RUNTIME_ERROR(xml->loc.str()+": wrong vector<float2> body");
504 data.resize(xml->body.size()/2);
505 for (size_t i=0; i<data.size(); i++)
506 data[i] = Vec2f(xml->body[2*i+0].Float(),xml->body[2*i+1].Float());
507 return data;
508 }
509 }
510
511 std::vector<Vec3f> XMLLoader::loadVec3fArray(const Ref<XML>& xml)
512 {

Callers

nothing calls this directly

Calls 5

parmMethod · 0.80
FloatMethod · 0.80
sizeMethod · 0.45
strMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected