예제 #1
0
    void OnVuforiaStarted()
    {
        Debug.Log("OnVuforiaStarted() called.");

        if (Device.Instance is EyewearDevice)
        {
            EyewearDevice eyewearDevice = (EyewearDevice)Device.Instance;

            DigitalEyewearARController.Instance.SetEyewearType(DigitalEyewearARController.EyewearType.OpticalSeeThrough);
            DigitalEyewearARController.Instance.SetSeeThroughConfiguration(DigitalEyewearARController.SeeThroughConfiguration.Vuforia);

            // when entering into 3d stereo mode
            if (!eyewearDevice.IsDisplayExtended())
            {
                eyewearDevice.SetDisplayExtended(true);
            }

            // to enable predictive tracking
            if (!eyewearDevice.IsPredictiveTrackingEnabled())
            {
                eyewearDevice.SetPredictiveTracking(true);
            }

            // when exiting 3d stereo mode back to 2d (duplication/mono) mode for menus, etc.
            eyewearDevice.SetDisplayExtended(false);
        }
    }
예제 #2
0
    private void SetTargetFrameRate()
    {
        int           targetFPS     = 0;
        EyewearDevice eyewearDevice = Device.Instance as EyewearDevice;

        if ((eyewearDevice != null) && eyewearDevice.IsSeeThru())
        {
            // In see-through devices, there is no video background to render
            targetFPS = VuforiaRenderer.Instance.GetRecommendedFps(VuforiaRenderer.FpsHint.NO_VIDEOBACKGROUND);
        }
        else
        {
            // Query Vuforia for AR target frame rate and set it in Unity:
            targetFPS = VuforiaRenderer.Instance.GetRecommendedFps(VuforiaRenderer.FpsHint.NONE);
        }
        // Note: if you use vsync in your quality settings, you should also set
        // your QualitySettings.vSyncCount according to the value returned above.
        // e.g. if targetFPS > 50 --> vSyncCount = 1; else vSyncCount = 2;
        Application.targetFrameRate = targetFPS;
    }