| 539 | } |
| 540 | |
| 541 | void DotSceneLoader::processLookTarget(pugi::xml_node& XMLNode, SceneNode* pParent) |
| 542 | { |
| 543 | //! @todo Is this correct? Cause I don't have a clue actually |
| 544 | |
| 545 | // Process attributes |
| 546 | String nodeName = getAttrib(XMLNode, "nodeName"); |
| 547 | |
| 548 | LogManager::getSingleton().logMessage("[DotSceneLoader] Processing Look Target, nodeName: " + nodeName, LML_TRIVIAL); |
| 549 | |
| 550 | Node::TransformSpace relativeTo = Node::TS_PARENT; |
| 551 | String sValue = getAttrib(XMLNode, "relativeTo"); |
| 552 | if (sValue == "local") |
| 553 | relativeTo = Node::TS_LOCAL; |
| 554 | else if (sValue == "parent") |
| 555 | relativeTo = Node::TS_PARENT; |
| 556 | else if (sValue == "world") |
| 557 | relativeTo = Node::TS_WORLD; |
| 558 | |
| 559 | // Process position (?) |
| 560 | Vector3 position; |
| 561 | if (auto pElement = XMLNode.child("position")) |
| 562 | position = parseVector3(pElement); |
| 563 | |
| 564 | // Process localDirection (?) |
| 565 | Vector3 localDirection = Vector3::NEGATIVE_UNIT_Z; |
| 566 | if (auto pElement = XMLNode.child("localDirection")) |
| 567 | localDirection = parseVector3(pElement); |
| 568 | |
| 569 | // Setup the look target |
| 570 | try |
| 571 | { |
| 572 | if (!nodeName.empty()) |
| 573 | { |
| 574 | SceneNode* pLookNode = mSceneMgr->getSceneNode(nodeName); |
| 575 | position = pLookNode->_getDerivedPosition(); |
| 576 | } |
| 577 | |
| 578 | pParent->lookAt(position, relativeTo, localDirection); |
| 579 | } |
| 580 | catch (const Exception& e) |
| 581 | { |
| 582 | LogManager::getSingleton().logError("DotSceneLoader - " + e.getDescription()); |
| 583 | } |
| 584 | } |
| 585 | |
| 586 | void DotSceneLoader::processTrackTarget(pugi::xml_node& XMLNode, SceneNode* pParent) |
| 587 | { |
nothing calls this directly
no test coverage detected