OSVR / OSVR-Unity

Package for authoring OSVR experiences with Unity.
Apache License 2.0
98 stars 38 forks source link

Error when trying to recenter the view #167

Closed demonixis closed 7 years ago

demonixis commented 8 years ago

Hi,

I got this error with the latest Unity SDK when I try to recenter the view.

My code

public override void Recenter()
{
    var clientKit = ClientKit.instance;

    if (displayController != null && clientKit != null)
    {
        if (displayController.UseRenderManager)
            displayController.RenderManager.SetRoomRotationUsingHead();
        else
            clientKit.context.SetRoomRotationUsingHead();
    }
}

The error

ApplicationException: OSVR::SetRoomRotationUsingHead() - native osvrClientSetRoomRotationUsingHead call failed.
OSVR.ClientKit.ClientContext.SetRoomRotationUsingHead () (at z:/j/workspace/Managed-OSVR/ClientKit/ClientKit.cs:584)
OSVR.Unity.OsvrRenderManager.SetRoomRotationUsingHead () (at Assets/Vendors/OSVRUnity/src/OsvrRenderManager.cs:205)
Demonixis.Toolbox.VR.OSVRManager.Recenter () (at Assets/Scripts/Core/VR/OSVRManager.cs:77)
Demonixis.Toolbox.VR.GameVRSettings+<RecenterEndOfFrame>c__Iterator2.MoveNext () (at Assets/Scripts/Core/VR/GameVRSettings.cs:95)
UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) (at C:/buildslave/unity/build/Runtime/Export/Coroutines.cs:17)

I can't switch to another scene when I have this error.

DuFF14 commented 8 years ago

Not able to reproduce this in the Palace Demo, but it happened once in the Unity VR Samples project in the editor. I was still able to swtich scenes afterwards and it didn't occur in subsequent Recenters. I re-opened the Unity project and could not reproduce a second time. Haven't reproduced in a build either. Does this happen every time for you? In editor and build?

demonixis commented 8 years ago

In the editor only for now, I don't know how to reproduce this bug, it's random

DuFF14 commented 7 years ago

Fixed. See https://github.com/OSVR/OSVR-Unity/issues/197