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