| 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 | { |