Skip to main content
Up and Coming
February 27, 2013

Unity 3d SDK feedback

Decided to start a thread to post feedback on and discuss the Unity3d SDK. So far so good and it's very easy to import and use :)

I've made one small tweak to the default camera script that I found very useful so maybe it's something you'd want to include in the SDK by default? It's a simple swap between absolute headset rotation and being offset by the parent object. This way you can put the OVRCameraController into another container and still look around relative to that container, for example when inside the cockpit of a spaceship.

OVRCamera.cs

New property:

// Set to true if you want the camera rotation offset by parent rotation, useful when putting the user inside a vehicle
public bool OffsetByParent = false;


And a change inside the SetCameraOrientation method:

// Update camera rotation
if (this.OffsetByParent == true)
{
gameObject.camera.transform.rotation = gameObject.transform.parent.transform.rotation * q;
}
else
{
gameObject.camera.transform.rotation = q;
}
    This topic has been closed for replies.

    13 replies

    Inspiring
    March 25, 2013
    Yeah, we have looked into it and it is indeed a problem. We hope to have this fixed at some point in the future, so it works more like you would expect.

    The work-around is to check to see if the sensor is available (using "IsSensorPresent()"). It's not the best solution, but should work until we find a better method.
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
    New Participant
    April 5, 2013
    I am not sure if this is the correct place to post this, so please correct me if I am wrong, but I would like to speak out some
    desired future developments of the Unity SDK to Oculus.

    Thank you for making it possible to save Rift presets, but could you please save it in an external file instead of preferences? This would allow us to distribute the settings with out builds and potentially edit in text editor.

    Also would it be possible to decouple the camera position from rotation? Right now OVRCamera both offsets the eyes from the center and also rotates for head tracking. Furthermore, is there a reason why this is done in OnPreCull and OnPreRender, instead of simply modifying the camera transform's position?
    Inspiring
    January 24, 2018
    Delete
    This is my forum signature. There are many others like it, but this is mine.