public Vector3f setIKTarget(Bone bone, Vector3f worldPos, int chainLength) {
        Vector3f target = worldPos.subtract(targetModel.getWorldTranslation());
        ikTargets.put(bone.getName(), target);
        ikChainDepth.put(bone.getName(), chainLength);
        int i = 0;
        while (i < chainLength+2 && bone.getParent() != null) {
            if (!bone.hasUserControl()) {
                bone.setUserControl(true);
            }
            bone = bone.getParent();
            i++;
        }


//        setIKMode();
        return target;
    }
Add a target for inverse kinematics.

@param bone which bone the IK applies to (not null)
@param worldPos the world coordinates of the goal (not null)
@param chainLength number of bones in the chain
@return a new instance (not null, already added to ikTargets)
jme3-jbullet/src/main/java/com/jme3/bullet/control/KinematicRagdollControl.java