コード例 #1
0
ファイル: OVRDisplay.cs プロジェクト: bean710/Yonder
    /// <summary>
    /// Recenters the head pose.
    /// </summary>
    public void RecenterPose()
    {
#if USING_XR_SDK
        XRInputSubsystem currentInputSubsystem = OVRManager.GetCurrentInputSubsystem();
        if (currentInputSubsystem != null)
        {
            currentInputSubsystem.TryRecenter();
        }
#elif !REQUIRES_XR_SDK
#pragma warning disable 618
        InputTracking.Recenter();
#pragma warning restore 618
#endif

        // The current poses are cached for the current frame and won't be updated immediately
        // after UnityEngine.VR.InputTracking.Recenter(). So we need to wait until next frame
        // to trigger the RecenteredPose delegate. The application could expect the correct pose
        // when the RecenteredPose delegate get called.
        recenterRequested           = true;
        recenterRequestedFrameCount = Time.frameCount;

#if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN
        OVRMixedReality.RecenterPose();
#endif
    }
コード例 #2
0
    /// <summary>
    /// Recenters the head pose.
    /// </summary>
    public void RecenterPose()
    {
        InputTracking.Recenter();

        // The current poses are cached for the current frame and won't be updated immediately
        // after UnityEngine.VR.InputTracking.Recenter(). So we need to wait until next frame
        // to trigger the RecenteredPose delegate. The application could expect the correct pose
        // when the RecenteredPose delegate get called.
        recenterRequested           = true;
        recenterRequestedFrameCount = Time.frameCount;

#if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN
        OVRMixedReality.RecenterPose();
#endif
    }