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

Method loadGridMesh

tutorials/common/scenegraph/xml_loader.cpp:1085–1102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1083 }
1084
1085 Ref<SceneGraph::Node> XMLLoader::loadGridMesh(const Ref<XML>& xml)
1086 {
1087 Ref<SceneGraph::MaterialNode> material = loadMaterial(xml->child("material"));
1088 Ref<SceneGraph::GridMeshNode> mesh = new SceneGraph::GridMeshNode(material,BBox1f(0,1),0);
1089
1090 if (Ref<XML> animation = xml->childOpt("animated_positions")) {
1091 for (size_t i=0; i<animation->size(); i++)
1092 mesh->positions.push_back(loadVec3faArray(animation->child(i)));
1093 } else {
1094 mesh->positions.push_back(loadVec3faArray(xml->childOpt("positions")));
1095 }
1096
1097 std::vector<Vec4i> grids = loadVec4iArray(xml->childOpt("grids"));
1098 for (size_t i=0; i<grids.size(); i++)
1099 mesh->grids.push_back(SceneGraph::GridMeshNode::Grid(grids[i].x,grids[i].y,grids[i].z,grids[i].w));
1100 mesh->verify();
1101 return mesh.dynamicCast<SceneGraph::Node>();
1102 }
1103
1104 RTCSubdivisionMode parseSubdivMode(const Ref<XML>& xml)
1105 {

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected