static void meshToLocal(Joint parentBone, Transform transform) {
        Vector3f location = transform.getTranslation();
        Quaternion orientation = transform.getRotation();
        Vector3f scale = transform.getScale();

        Transform pmx = parentBone.getModelTransform();
        Vector3f pmTranslate = pmx.getTranslation();
        Quaternion pmRotInv = pmx.getRotation().inverse();
        Vector3f pmScale = pmx.getScale();

        location.subtractLocal(pmTranslate);
        location.divideLocal(pmScale);
        pmRotInv.mult(location, location);
        scale.divideLocal(pmScale);
        pmRotInv.mult(orientation, orientation);
    }
Convert a transform from the mesh coordinate system to the local
coordinate system of the specified bone.

@param parentBone (not null)
@param transform the transform to convert (not null, modified)
jme3-jbullet/src/main/java/com/jme3/bullet/animation/RagUtils.java