public static List<Integer> getBoneIndices(Bone bone, Skeleton skeleton, Set<String> boneList) {
        List<Integer> list = new LinkedList<>();
        if (boneList.isEmpty()) {
            list.add(skeleton.getBoneIndex(bone));
        } else {
            list.add(skeleton.getBoneIndex(bone));
            for (Bone childBone : bone.getChildren()) {
                if (!boneList.contains(childBone.getName())) {
                    list.addAll(getBoneIndices(childBone, skeleton, boneList));
                }
            }
        }
        return list;
    }
Enumerate the bone indices of the specified bone and all its descendents.

@param bone the input bone (not null)
@param skeleton the skeleton containing the bone (not null)
@param boneList a set of bone names (not null, unaffected)

@return a new list (not null)
jme3-jbullet/src/main/java/com/jme3/bullet/control/ragdoll/RagdollUtils.java