Hi.
So in my game, the player will be crawling through tight tunnels where he might need to twist and turn and push to get through.
Game is in first person and I need vision of the arms including the shoulder.
I am using an IK system to determine where the palm (hand bone) should go and the rest of the arm follows.
However, I can't control how the rest of the arm behaves, other than the hand bone. My elbows and other joints can clip through walls and I don't want that. It's not just that. I need some kind of reacting to collision if it happens where I don't want it.
When it works, it looks decent, I need to make edge cases look good too.
I have attached an image with 4 panels, showing 4 potential problems (there are many more possible instances though). On each panel is the character with the hands and a blue dot representing where I want the hand (palm) to land.
In the first panel, the hand want to go straight up, through a wall. The dot should actually be a bit more to the left, on the wall edge. Now, the hand should clip through the wall to get there but it shouldn't just stop on collision either. I want it to roll forward. Perhaps move it along the wall edge or change the target location and keep moving it to the left until the hand is cleared to pass.
In the second panel, the hand can reach the dot but will likely induce some clipping in the elbow or along the forearm. The best case scenario there would be to stop it from stretching once it hits the elbow.
In the third panel (I should actually have the player higher up so that it's actually possible to reach the blue dot physically) everything but the palm will surely clip through the wall. In this case, I'd want to raise the elbows as much as possible so that the whole arm is clear of the wall.
In the fourth panel, ideally I'd have the hand follow the slope along with the elbow but raising the entire arm just so the elbow could clear the slope would work too.
Charact. limit hit, more info in comment