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

Method loadVec3fArray

tutorials/common/scenegraph/xml_loader.cpp:511–527  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

509 }
510
511 std::vector<Vec3f> XMLLoader::loadVec3fArray(const Ref<XML>& xml)
512 {
513 if (!xml) return std::vector<Vec3f>();
514
515 if (xml->parm("ofs") != "") {
516 return loadBinary<std::vector<Vec3f>>(xml);
517 }
518 else
519 {
520 std::vector<Vec3f> data;
521 if (xml->body.size() % 3 != 0) THROW_RUNTIME_ERROR(xml->loc.str()+": wrong vector<float3> body");
522 data.resize(xml->body.size()/3);
523 for (size_t i=0; i<data.size(); i++)
524 data[i] = Vec3f(xml->body[3*i+0].Float(),xml->body[3*i+1].Float(),xml->body[3*i+2].Float());
525 return data;
526 }
527 }
528
529 avector<Vec3fa> XMLLoader::loadVec3faArray(const Ref<XML>& xml)
530 {

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