| 272 | } |
| 273 | |
| 274 | CoronaLoader::CoronaLoader(const FileName& fileName, const AffineSpace3fa& space) |
| 275 | { |
| 276 | path = fileName.path(); |
| 277 | Ref<XML> xml = parseXML(fileName,"/.-",false); |
| 278 | if (xml->name == "scene") |
| 279 | { |
| 280 | Ref<SceneGraph::GroupNode> group = new SceneGraph::GroupNode; |
| 281 | for (size_t i=0; i<xml->children.size(); i++) { |
| 282 | group->add(loadNode(xml->children[i])); |
| 283 | } |
| 284 | root = group.cast<SceneGraph::Node>(); |
| 285 | } |
| 286 | else |
| 287 | THROW_RUNTIME_ERROR(xml->loc.str()+": invalid scene tag"); |
| 288 | |
| 289 | if (space == AffineSpace3fa(one)) |
| 290 | return; |
| 291 | |
| 292 | root = new SceneGraph::TransformNode(space,root); |
| 293 | } |
| 294 | |
| 295 | /*! read from disk */ |
| 296 | Ref<SceneGraph::Node> SceneGraph::loadCorona(const FileName& fileName, const AffineSpace3fa& space) { |