GJK does a fantastic job of finding the shortest distance from any kind of shape to any other kind of shape.
However I'd like to go one step further to obtain the shortest distance from a "small shape" to any point on the outline of a "large shape" which completely "encloses" the small shape. It needs only to work for convex shapes (don't care about concave).
GJK produces a result distance of 0 when one of the shapes is intersecting the other. I'd like for the case of one shape completely encompassing another to also provide a distance value.
I drew this to illustrate:

The first case is what I want: the orange line is the shortest distance from body B to body A's boundary.
The second case is where there is intersection and I am not interested in this case (but will need to be able to detect it of course)
and the third case is already solved to a completely satisfactory degree by GJK.
Since this is mostly for debug purposes right now, neither performance nor accuracy is a significant concern. I was thinking of just doing a limited number of raycasts from my inner shape, but even the raycast functionality does not really address the issue of casting from within a shape! This means that to implement a raycast based solution to this would be probably almost as difficult as implementing a completely accurate solution by extending GJK somehow or at least using some of its central concepts.
So my question is, what might be the easiest or most straightforward way to obtain this "containment distance" value that I'm looking for? I realize it might be simple to obtain a "separation" distance in the second case as illustrated above but it actually provides no information as to how far completely "submerged" the smaller shape is.
However I'd like to go one step further to obtain the shortest distance from a "small shape" to any point on the outline of a "large shape" which completely "encloses" the small shape. It needs only to work for convex shapes (don't care about concave).
GJK produces a result distance of 0 when one of the shapes is intersecting the other. I'd like for the case of one shape completely encompassing another to also provide a distance value.
I drew this to illustrate:

The first case is what I want: the orange line is the shortest distance from body B to body A's boundary.
The second case is where there is intersection and I am not interested in this case (but will need to be able to detect it of course)
and the third case is already solved to a completely satisfactory degree by GJK.
Since this is mostly for debug purposes right now, neither performance nor accuracy is a significant concern. I was thinking of just doing a limited number of raycasts from my inner shape, but even the raycast functionality does not really address the issue of casting from within a shape! This means that to implement a raycast based solution to this would be probably almost as difficult as implementing a completely accurate solution by extending GJK somehow or at least using some of its central concepts.
So my question is, what might be the easiest or most straightforward way to obtain this "containment distance" value that I'm looking for? I realize it might be simple to obtain a "separation" distance in the second case as illustrated above but it actually provides no information as to how far completely "submerged" the smaller shape is.