Skip to main content
Up and Coming
January 4, 2015

Experimental changes in VR camera control

Happy New Year to everybody, btw!

Ok, the first cut is in GitHub:
https://github.com/Oculus-VR/UnrealEngine/tree/4.7-np

This is 4.7-preview with re-factored plugin and improved (I hope) camera control. I haven't added new Blueprint functions yet (like raw accel data or player's metrics, still in work). I am going to document all the changes (documentation is long due anyway)...

So, briefly. I've added PlayerController.bFollowHmd property, which is by default set to 'true' (for compatibility reasons). When it is set in 'true' then the behavior is the same as it was before: HMD drives PlayerController. You can either set it to 'false' or just don't bother, it will be set to false automatically, once you use PlayerCameraManager or CameraComponent approach.

The main approach you guys care the most (I think) is to enable HMD via CameraComponent. This class now has two additional boolean properties - bFollowHmdOrientation and bFollowHmdPosition. In addition, the scale of the CameraComponent now will be a scale of the position change / ipd. The bigger scale is set, the smaller world is perceived. Camera's origin is located in-between eyes, i.e. IPD will be applied at the camera's origin, half of IPD in positive Y-axis direction and another half in negative Y-axis direction (in camera coordinate system).

Besides CameraComponent, the PlayerCameraManager also has boolean properties bFollowHmdOrientation and bFollowHmdPosition. Thus, any camera attached to this PlayerCameraManager via SetViewTarget method will follow the HMD orientation and/or position.

In addition, the HeadMountedDisplay::GetOrientationAndPosition method now has two additional boolean parameters: bUseOrienationForPlayerCamera and bUsePositionForPlayerCamera (by default - both a set to 'false'). Set these to true, if you use this method to get HMD orientation/position to change the camera orientation / position manually. This is necessary to correctly calculate delta orientation/position for timewarp later on a render thread. However, there is no way to specify the proper scale to position in this case (should I add one more parameter to this method? With default value vector(1,1,1)? Probably, will think about this.)

So, if you, guys, have a look on these changes and try them I'd be grateful. I'll meet with Epic Games guys later this month and we will discuss these changes (however, Epic may suggest different approaches, different names for function/parameters, etc), so these changes are not final in any sense. Your opinion will be very important and will be considered in that discussion.
    This topic has been closed for replies.

    49 replies

    artyom17Author
    Up and Coming
    February 2, 2015
    "BlackFang" wrote:
    Any chance that the player profile could fill out information not entered using the information that is entered via a lookup table?


    I re-read this several times and still not sure what this means :) Could you elaborate a bit more?
    artyom17Author
    Up and Coming
    February 2, 2015
    "PatimPatam" wrote:
    "artyom17" wrote:
    "PatimPatam" wrote:
    Cool! I'm guessing this is used for the head-neck model when camera tracking is lost, but in my case it will be super useful to fine-tune the navigation method i developed which makes use of the HMD positional tracking:
    https://forums.oculus.com/viewtopic.php?f=32&t=18422

    This also can be used to calculate the position of the 'neck origin' from the camera position (which is "eyes position").

    Yep that's exactly what i wanted it for, i think controlling your avatar using your torso/neck-origin feels very intuitive, and also helps reducing simulation sickness.



    In the latest revision (in github) I've added a 'NeckPosition' vector that is returned by the GetOrientationAndPosition. This is already calculated position using current orientation, position and neck-to-eye vector. However, this is not supported by GearVR yet (due to lack of profiles at all; maybe I can calculate something using hardcoded values for now).
    Up and Coming
    February 2, 2015
    I meant using a mathematical model based on data like this http://www.exrx.net/Kinesiology/Segments.html in order to calculate eye to neck distances if only the user's height is entered. Not everyone keeps a meter stick handy, and I wouldn't want anyone to have a bad experience because they didn't input all the measurements. (Even though it would be their own fault. :P )

    Since Gear VR doesn't have access to profiles, you could hard-code the adult average for the time being.
    I complain a lot. Just think of me as a squeaky wheel lol. Youtube channel -> https://www.youtube.com/user/xblBlackFang/videos
    Up and Coming
    February 2, 2015
    Another Handy node would be the ability to query the HSW timer.
    Plus the ability the change some of the Distortion CAP's such as HQDistortion and Vignette.
    DK2. Phenom 2 x4 4.2GHz,Asrock Extreme 3 970,8GB DDR3 1600, R9 270x 1180/1400.
    Up and Coming
    February 2, 2015
    "artyom17" wrote:
    In the latest revision (in github) I've added a 'NeckPosition' vector that is returned by the GetOrientationAndPosition. This is already calculated position using current orientation, position and neck-to-eye vector. However, this is not supported by GearVR yet (due to lack of profiles at all; maybe I can calculate something using hardcoded values for now).

    Awesome, this will simplify a lot my current blueprints!
    Up and Coming
    February 5, 2015
    Ok, I downloaded and compiled this 4.7-np version. I can't get the Rift to work with it at all. The command "stereo on" isn't recognized even though the rift plugin is enabled.
    I complain a lot. Just think of me as a squeaky wheel lol. Youtube channel -> https://www.youtube.com/user/xblBlackFang/videos
    Up and Coming
    February 5, 2015
    "BlackFang" wrote:
    Ok, I downloaded and compiled this 4.7-np version. I can't get the Rift to work with it at all. The command "stereo on" isn't recognized even though the rift plugin is enabled.

    I haven't tested this myself, but i think artyom mentioned using "stereo hmd" instead.
    https://forums.oculus.com/viewtopic.php?f=60&t=19511#p239091
    https://forums.oculus.com/viewtopic.php?f=60&t=19628#p240208
    Up and Coming
    February 5, 2015
    I figured it out, I needed to update my Oculus Runtime. Now I just need to work through the steps to reduce the massive jitter in these later versions....
    I complain a lot. Just think of me as a squeaky wheel lol. Youtube channel -> https://www.youtube.com/user/xblBlackFang/videos
    Up and Coming
    February 8, 2015
    This version works much better than previous versions. The changes are very welcome. However, I still had to remove some lines that were clearing out the existing roll and pitch of my character when factoring character rotation into the camera rotation.
    I complain a lot. Just think of me as a squeaky wheel lol. Youtube channel -> https://www.youtube.com/user/xblBlackFang/videos
    Up and Coming
    February 8, 2015
    I assume this fork would be better to use for GearVR testing instead of using the 4.7 from Epic?

    It looks like setting a value under 100 for HMD SP XXX console command will cause the right eye to not render. I assume this is why the GET/SET Screen Percentage nodes have been added? Unfortunately, I haven't had much luck with those either. Both eyes are rendering fine but values I set to the Set Screen Percentage on Begin Play don't seem to have an impact. Get Screen Percentage and it always returns 0.0 after I set a different value. None of the values I have set seem to have any impact on frame rate so it appears that the GET results are accurate.

    Values tested have been 95, 50 and 0.5.
    Meerkat Gaming Dev Klepto - Burglary Simulator Oculus WIP Thread || Steam Greenlight Page TightropeVR - 2015 VRJam Finalist Steam Greenlight || [DK2 DEMO] || [GearVR pending UE4 update]