/// <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) { 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; }