Download

Hand IK (for VR) and forearm roll

I’m developing a multiplayer VR shooter so arm IK is part of the animation requirements. It works pretty well at this point, but I’m now trying to add in first person arms to replace the default robot hands I’ve been using. So, I detached the arms from the third person mesh and set them as first person mesh that is only visible to owner. The first person mesh uses the epic skeleton and is simply following a master pose from the third person mesh. In first person, however, it becomes very obvious that the lower arms aren’t rolling properly. You can see it in the video below. In the video I am setting the bone space roll of the lowerarm_r to the worldspace roll of the controller… obviously this is wrong, but it works at certain angles. Before I was doing this the lower arm would just be rolled based on the elbow, which also looked wrong.

Looking at my own arms, the solution seems pretty simple; I want the back of the hand to match the top of the forearm, pretty much all the time. In code, though, I’m getting pretty confused. How could I calculate the proper bone space roll for lowerarm_r from just the target hand rotation? I have to imagine that this issue has been solved before and I’m just missing something obvious.