bool Bone::findChain( Bone* endBone, std::vector<Bone*>& chain ) { zhAssert( endBone != NULL ); if( this == endBone ) { chain.insert( chain.begin(), this ); return true; } Bone::ChildConstIterator child_i = getChildConstIterator(); while( child_i.hasMore() ) { Bone* child = child_i.next(); if( child->findChain( endBone, chain ) ) { chain.insert( chain.begin(), this ); return true; } } return false; }