/// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="inputSystem">The <see cref="Microsoft.MixedReality.Toolkit.Input.IMixedRealityInputSystem"/> instance that receives data from this provider.</param>
        /// <param name="name">Friendly name of the service.</param>
        /// <param name="priority">Service priority. Used to determine order of instantiation.</param>
        /// <param name="profile">The service's configuration profile.</param>
        public WindowsMixedRealityEyeGazeDataProvider(
            IMixedRealityInputSystem inputSystem,
            string name,
            uint priority,
            BaseMixedRealityProfile profile) : base(inputSystem, name, priority, profile)
        {
            eyesApiAvailable = WindowsApiChecker.IsPropertyAvailable(
                "Windows.UI.Input.Spatial",
                "SpatialPointerPose",
                "Eyes");

#if (UNITY_WSA && DOTNETWINRT_PRESENT) || WINDOWS_UWP
            if (eyesApiAvailable)
            {
                eyesApiAvailable &= EyesPose.IsSupported();
            }
#endif // (UNITY_WSA && DOTNETWINRT_PRESENT) || WINDOWS_UWP

            gazeSmoother = new EyeGazeSmoother();

            // Register for these events to forward along, in case code is still registering for the obsolete actions
            gazeSmoother.OnSaccade  += GazeSmoother_OnSaccade;
            gazeSmoother.OnSaccadeX += GazeSmoother_OnSaccadeX;
            gazeSmoother.OnSaccadeY += GazeSmoother_OnSaccadeY;
        }
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="inputSystem">The <see cref="Microsoft.MixedReality.Toolkit.Input.IMixedRealityInputSystem"/> instance that receives data from this provider.</param>
 /// <param name="name">Friendly name of the service.</param>
 /// <param name="priority">Service priority. Used to determine order of instantiation.</param>
 /// <param name="profile">The service's configuration profile.</param>
 public WindowsMixedRealityEyeGazeDataProvider(
     IMixedRealityInputSystem inputSystem,
     string name,
     uint priority,
     BaseMixedRealityProfile profile) : base(inputSystem, name, priority, profile)
 {
     eyesApiAvailable = WindowsApiChecker.IsPropertyAvailable(
         "Windows.UI.Input.Spatial",
         "SpatialPointerPose",
         "Eyes");
 }
Exemple #3
0
        /// <summary>
        /// Check whether the Windows Eyes API is available
        /// </summary>
        private void CheckIfEyesApiAvailable()
        {
#if (UNITY_WSA && DOTNETWINRT_PRESENT) || WINDOWS_UWP
            // Make sure EyeTracking is available on the device
            EyesApiAvailable = WindowsApiChecker.IsPropertyAvailable(
                "Windows.UI.Input.Spatial",
                "SpatialPointerPose",
                "Eyes");

            // If yes, ask for permission to use it
            if (EyesApiAvailable)
            {
                EyesApiAvailable &= EyesPose.IsSupported();
            }
#endif
        }
Exemple #4
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="inputSystem">The <see cref="Microsoft.MixedReality.Toolkit.Input.IMixedRealityInputSystem"/> instance that receives data from this provider.</param>
        /// <param name="name">Friendly name of the service.</param>
        /// <param name="priority">Service priority. Used to determine order of instantiation.</param>
        /// <param name="profile">The service's configuration profile.</param>
        public WindowsMixedRealityEyeGazeDataProvider(
            IMixedRealityInputSystem inputSystem,
            string name,
            uint priority,
            BaseMixedRealityProfile profile) : base(inputSystem, name, priority, profile)
        {
            eyesApiAvailable = WindowsApiChecker.IsPropertyAvailable(
                "Windows.UI.Input.Spatial",
                "SpatialPointerPose",
                "Eyes");

#if (UNITY_WSA && DOTNETWINRT_PRESENT) || WINDOWS_UWP
            if (eyesApiAvailable)
            {
                eyesApiAvailable &= EyesPose.IsSupported();
            }
#endif // (UNITY_WSA && DOTNETWINRT_PRESENT) || WINDOWS_UWP
        }