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

Method loadPoints

tutorials/common/scenegraph/xml_loader.cpp:1287–1310  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1285 }
1286
1287 Ref<SceneGraph::Node> XMLLoader::loadPoints(const Ref<XML>& xml, RTCGeometryType type)
1288 {
1289 Ref<SceneGraph::MaterialNode> material = loadMaterial(xml->child("material"));
1290 Ref<SceneGraph::PointSetNode> mesh = new SceneGraph::PointSetNode(type,material,BBox1f(0,1),0);
1291
1292 if (Ref<XML> animation = xml->childOpt("animated_positions")) {
1293 for (size_t i=0; i<animation->size(); i++) {
1294 mesh->positions.push_back(loadVec3ffArray(animation->child(i)));
1295 }
1296 } else {
1297 mesh->positions.push_back(loadVec3ffArray(xml->childOpt("positions")));
1298 }
1299
1300 if (Ref<XML> animation = xml->childOpt("animated_normals")) {
1301 for (size_t i=0; i<animation->size(); i++) {
1302 mesh->normals.push_back(loadVec3faArray(animation->child(i)));
1303 }
1304 } else if (Ref<XML> normals = xml->childOpt("normals")) {
1305 mesh->normals.push_back(loadVec3faArray(normals));
1306 }
1307
1308 mesh->verify();
1309 return mesh.dynamicCast<SceneGraph::Node>();
1310 }
1311
1312 Ref<SceneGraph::Node> XMLLoader::loadFurBall(const Ref<XML>& xml)
1313 {

Callers

nothing calls this directly

Calls 5

childOptMethod · 0.80
childMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45
verifyMethod · 0.45

Tested by

no test coverage detected