private static List<Joint> preOrderJoints(Armature skeleton) {
        int numBones = skeleton.getJointCount();
        List<Joint> result = new ArrayList<>(numBones);
        Joint[] rootBones = skeleton.getRoots();
        for (Joint rootBone : rootBones) {
            addPreOrderJoints(rootBone, result);
        }

        assert result.size() == numBones : result.size();
        return result;
    }
Enumerate all bones in a pre-order, depth-first traversal of the
skeleton, such that child bones never precede their ancestors.

@param skeleton the skeleton to traverse (not null, unaffected)
@return a new list of bones
jme3-jbullet/src/main/java/com/jme3/bullet/animation/RagUtils.java