| 434 | } |
| 435 | |
| 436 | void DotSceneLoader::processNode(pugi::xml_node& XMLNode, SceneNode* pParent) |
| 437 | { |
| 438 | // Construct the node's name |
| 439 | String name = getAttrib(XMLNode, "name"); |
| 440 | |
| 441 | LogManager::getSingleton().logMessage("[DotSceneLoader] Processing Node: " + name, LML_TRIVIAL); |
| 442 | |
| 443 | // Create the scene node |
| 444 | SceneNode* pNode; |
| 445 | if (name.empty()) |
| 446 | { |
| 447 | // Let Ogre choose the name |
| 448 | if (pParent) |
| 449 | pNode = pParent->createChildSceneNode(); |
| 450 | else |
| 451 | pNode = mAttachNode->createChildSceneNode(); |
| 452 | } |
| 453 | else |
| 454 | { |
| 455 | // Provide the name |
| 456 | if (pParent) |
| 457 | pNode = pParent->createChildSceneNode(mItemPrefix + name); |
| 458 | else |
| 459 | pNode = mAttachNode->createChildSceneNode(mItemPrefix + name); |
| 460 | } |
| 461 | |
| 462 | // Process other attributes |
| 463 | |
| 464 | // Process position (?) |
| 465 | if (auto pElement = XMLNode.child("position")) |
| 466 | { |
| 467 | pNode->setPosition(parseVector3(pElement)); |
| 468 | } |
| 469 | |
| 470 | // Process rotation (?) |
| 471 | if (auto pElement = XMLNode.child("rotation")) |
| 472 | { |
| 473 | pNode->setOrientation(parseQuaternion(pElement)); |
| 474 | } |
| 475 | |
| 476 | // Process scale (?) |
| 477 | if (auto pElement = XMLNode.child("scale")) |
| 478 | { |
| 479 | pNode->setScale(parseVector3(pElement)); |
| 480 | } |
| 481 | |
| 482 | // Process lookTarget (?) |
| 483 | if (auto pElement = XMLNode.child("lookTarget")) |
| 484 | processLookTarget(pElement, pNode); |
| 485 | |
| 486 | // Process trackTarget (?) |
| 487 | if (auto pElement = XMLNode.child("trackTarget")) |
| 488 | processTrackTarget(pElement, pNode); |
| 489 | |
| 490 | // Process node (*) |
| 491 | for (auto pElement : XMLNode.children("node")) |
| 492 | { |
| 493 | processNode(pElement, pNode); |
nothing calls this directly
no test coverage detected