Gems/EMotionFX/Code/EMotionFX/Source/Node.cpp
Node* Node::FindRoot() const
    {
        size_t parentIndex = m_parentIndex;
        const Node* curNode = this;

        while (parentIndex != InvalidIndex)
        {
            curNode = m_skeleton->GetNode(parentIndex);
            parentIndex = curNode->GetParentIndex();
        }

        return const_cast<Node*>(curNode);
    }
// recursively find the root node (expensive call)
recursively find the root node (expensive call)
recursively find the root node ( expensive call )
Node* Node::FindRoot() const
    {
        size_t parentIndex = m_parentIndex;
        const Node* curNode = this;
        while (parentIndex != InvalidIndex)
        {
            curNode = m_skeleton->GetNode(parentIndex);
            parentIndex = curNode->GetParentIndex();
        }
        return const_cast<Node*>(curNode);
    }
Node * Node :: FindRoot ( ) const { size_t parentIndex = m_parentIndex ; const Node * curNode = this ; while ( parentIndex != InvalidIndex ) { curNode = m_skeleton -> GetNode ( parentIndex ) ; parentIndex = curNode -> GetParentIndex ( ) ; } return const_cast < Node * > ( curNode ) ; }
recursively find the root node (expensive call)
recursively find the root node ( expensive call )