UDKOSC and Oculus Rift

From CCRMA Wiki
Revision as of 13:50, 11 June 2013 by Rob (Talk | contribs)

Jump to: navigation, search

Gamasutra article describing Oculus integration for Unreal Engine 4's Elemental:


Quick diff between 2013-02 and Rift 2013-03 directories:

diff -r ./2013-02/Development/ ./UDK-2013-03-Oculus/Development/ > ~/Desktop/diff_output.txt


Head bone HMD tracking example from https://developer.oculusvr.com/forums/viewtopic.php?f=44&t=936

always match the camera to the rotation of the eye socket
simulated event rotator GetViewRotation()
    local vector out_Loc;
    local rotator out_Rot;

    if (EyeSocket == )
        return Super.GetViewRotation();

    Mesh.GetSocketWorldLocationAndRotation(EyeSocket, out_Loc, out_Rot);

    return out_Rot;

//function to aim the head where the player looks
exec function LookAt(int p, int y, int r)
local SkelControlSingleBone HeadControl;
local Rotator APlace;

APlace.Pitch = p;
APlace.Yaw = y;
APlace.Roll = r;

HeadControl = SkelControlSingleBone(Mesh.FindSkelControl('HeadControl'));
HeadControl.bApplyRotation = true;
HeadControl.SetSkelControlStrength(1.0, 0.5);
HeadControl.BlendInTime = 5.0;
HeadControl.bAddRotation = true;
HeadControl.BoneRotation = APlace;

Installation basics:

1) Download the new UDK from the Oculus Developer site.
2) Go to the folder C:\UDK\UDK-2013-03\UDKGame\Config\ and edit the UDKEngine.ini, (back it up first of course)
3) In the [Engine.Stereo3D] section, change the bEnabled parameter = True
4) Optional: in the [Engine.Oculus] section, change the bEnableHud parameter = False, (as the hud is kind of messed up right now).
5) Run the UDKGame program that installed with the UDK, (should be an icon on your desktop).