[Gear VR] Engine Changes Requested (for Mobile VR Jam)

For those that are wondering what a Virtual Head Model is here is something you could try. Look straight ahead and place a finger at the bridge of your nose, between your eyes. Now move your hand slightly away from your face and while keeping it at that position, roll your head so that your ear touches your shoulder (and don’t move your hand with your head). Notice how your eyes haven’t simply rotated about your hand but have physically moved away from it? It is this physical position change that we’re modeling when all we’re doing is rotating our head. You can try the same thing but this time looking to the right. Your eyes move in an arc away from your hand.

Nearly all FPS-based cameras in games rotate about their center. So a roll or yaw change with a FPS camera would be the equivalent of your head rotating about that finger you had between your eyes, rather than rotating about the base of your neck/skull. In a monitor-based FPS that’s not an issue. But in VR, rotating about a point that doesn’t match where your head actually rotates can cause discomfort. It can appear that the world is moving with your head, rather than your head moving in the world. A virtual head model simulates this correct motion.

Of course, the best solution to all this is to just have position tracking built into the HMD, like with the DK2. Everything with a VHM is just an approximation, and doesn’t conform to the specific user’s head (without allowing for custom values).

@jstarrdewar:
The offset from UE4’s camera makes sense as the view matrix is indeed being offset when in VR with this change. The correct thing to do would be to first move the origin of the camera and then apply the virtual head model’s offsets. This would place the virtual eye at the same location as UE4’s camera when the user is looking straight ahead. Of course, this is a quick hack to implement a VHM so it may not be perfect.

If someone wanted to try and correct for this, in glancing at the code I suspect you could subtract the FVector(0.12f, 0.0f, 0.17f) from the ViewLocation, after converting the vector to UE4 units of course. Unfortunately, I don’t have time to try this out, and my own Jam project doesn’t rely on an exact camera position. But if someone else figures this out it would be great if they could share it.