Camera Translation via HMD

Hello,

I am in the very early stages of setting up a camera to work with an HMD. I am having a problem where the camera position is not following the position of the HMD when I move my head around. In the camera component on my character, the bLockToHmd flag is set to true. The camera’s rotation follows the movement of the HMD, but the position does not.

The project was created based on the Top Down game template. In the character class that comes with the project, there is a “TopDownCameraComponent” that is attached to a “CameraBoom” on the character. I thought perhaps that the CameraBoom was somehow holding the camera in place, so I removed that component from the class as it is not needed for our game. However, this did not fix the problem.

I have stepped through the debugger and as far as I can tell the CameraCache.POV in the PlayerCameraManager is storing reasonable values for the camera location. For example, if I raise the HMD up in the air the Z value of the camera position responds in kind. I thought that perhaps this value was getting changed later on, but I have followed it as far as SetupBasePassView() (DeferredShadingRendered.cpp) in the rendering thread, and even in that function the View.ViewLocation values seem reasonable, so I am currently at a loss as to what is going on.

It seems like this should be a really easy thing to fix and that I am missing something simple, but I don’t see any obvious flags that need to be set to get this working.

Any ideas as to what is going on?

I think I figured out what is going on. I had wanted to give the impression that the player was a giant in the world so I had scaled the IPD up by a factor of about 40. While this did give the desired result in terms of relative size, it had an undesired effect on the camera translation. The camera was moving, but because the distance between the eyes was so much bigger than the distance the camera moved, it appeared that the camera was not moving at all. It was as if you are moving your head millimeters. The solution was to leave the IPD at its default value and instead modify the WorldToMeters property in the WorldSettings. This properly scales everything related to VR stereo rendering.