Esempio n. 1
0
    // Update is called once per frame
    void Update()
    {
        GvrBetaSeeThroughCameraMode camMode   = GvrBetaSeeThroughCameraMode.RawImage;
        GvrBetaSeeThroughSceneType  sceneType = GvrBetaSeeThroughSceneType.Augmented;

        GvrBetaHeadset.SetSeeThroughConfig(camMode, sceneType);
    }
Esempio n. 2
0
 /// <summary>Sets the current see-through camera mode and scene type.</summary>
 /// <param name="cameraMode">The see-through camera mode to be set.</param>
 /// <param name="sceneType">The see-through scene type to be set.</param>
 public static void SetSeeThroughConfig(GvrBetaSeeThroughCameraMode cameraMode,
                                        GvrBetaSeeThroughSceneType sceneType)
 {
     currentCameraMode = cameraMode;
     currentSceneType  = sceneType;
     GvrBetaHeadsetProvider.SetSeeThroughConfig(cameraMode, sceneType);
 }
        public static void SetSeeThroughConfig(GvrBetaSeeThroughCameraMode cameraMode,
                                               GvrBetaSeeThroughSceneType sceneType)
        {
#if UNITY_ANDROID && !UNITY_EDITOR
            if (seeThroughConfig == IntPtr.Zero)
            {
                Initialize();
            }

            gvr_beta_see_through_config_set_camera_mode(seeThroughConfig, (int)cameraMode);
            gvr_beta_see_through_config_set_scene_type(seeThroughConfig, (int)sceneType);

            IntPtr gvrContextPtr = GvrSettings.GetValidGvrNativePtrOrLogError();
            gvr_beta_set_see_through_config(gvrContextPtr, seeThroughConfig);
#endif
        }
        private void CycleSeeThroughModes()
        {
            if (!GvrBetaSettings.IsFeatureEnabled(GvrBetaFeature.SeeThrough))
            {
                return;
            }

            GvrBetaSeeThroughCameraMode camMode   = GvrBetaHeadset.CameraMode;
            GvrBetaSeeThroughSceneType  sceneType = GvrBetaSeeThroughSceneType.Augmented;

            switch (camMode)
            {
            case GvrBetaSeeThroughCameraMode.Disabled:
                camMode = GvrBetaSeeThroughCameraMode.RawImage;
                break;

            case GvrBetaSeeThroughCameraMode.RawImage:
                camMode = GvrBetaSeeThroughCameraMode.ToneMap;
                break;

            case GvrBetaSeeThroughCameraMode.ToneMap:
                // When see-through is disabled, use scene type Virtual to restore headpose
                // offset to 0.
                sceneType = GvrBetaSeeThroughSceneType.Virtual;
                camMode   = GvrBetaSeeThroughCameraMode.Disabled;
                break;
            }

            GvrBetaHeadset.SetSeeThroughConfig(camMode, sceneType);

            statusText.text = "Mode: " + camMode;

            bool seethruEnabled = camMode != GvrBetaSeeThroughCameraMode.Disabled;

            foreach (var go in hideDuringSeeThrough)
            {
                go.SetActive(!seethruEnabled);
            }
        }