Skip to content

Commit

Permalink
Update the "Use Eye Tracking" properties to be consistent with each o…
Browse files Browse the repository at this point in the history
…ther.

As microsoft#4195 calls out, the inspector has a term called "Prefer Eye Tracking" but elsewhere it's referred to as "UseEyeTracking." Renaming everything to PreferEyeTracking would actually be more proper (because it's a more accurate description of how things work)

However, renaming things to PreferEyeTracking would be a breaking change (where the main value here is consistency/term correctness). It's safer for us to keep things consistent by renaming the serialized property (which supports backwards compat and is not a breaking change)
  • Loading branch information
wiwei committed May 8, 2019
1 parent 9e85047 commit 0a249ae
Show file tree
Hide file tree
Showing 13 changed files with 24 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ MonoBehaviour:
gazeTransform: {fileID: 0}
minHeadVelocityThreshold: 0.5
maxHeadVelocityThreshold: 2
preferEyeTracking: 1
useEyeTracking: 1
--- !u!114 &256863739
MonoBehaviour:
m_ObjectHideFlags: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ MonoBehaviour:
gazeTransform: {fileID: 0}
minHeadVelocityThreshold: 0.5
maxHeadVelocityThreshold: 2
preferEyeTracking: 0
useEyeTracking: 0
--- !u!114 &1292482203
MonoBehaviour:
m_ObjectHideFlags: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ MonoBehaviour:
gazeTransform: {fileID: 0}
minHeadVelocityThreshold: 0.5
maxHeadVelocityThreshold: 2
preferEyeTracking: 0
useEyeTracking: 0
--- !u!114 &290616759
MonoBehaviour:
m_ObjectHideFlags: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9221,7 +9221,7 @@ MonoBehaviour:
gazeTransform: {fileID: 0}
minHeadVelocityThreshold: 0.5
maxHeadVelocityThreshold: 2
preferEyeTracking: 0
useEyeTracking: 0
--- !u!114 &1087739258
MonoBehaviour:
m_ObjectHideFlags: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1926,7 +1926,7 @@ MonoBehaviour:
gazeTransform: {fileID: 0}
minHeadVelocityThreshold: 0.5
maxHeadVelocityThreshold: 2
preferEyeTracking: 0
useEyeTracking: 0
--- !u!114 &1140877734
MonoBehaviour:
m_ObjectHideFlags: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ MonoBehaviour:
gazeTransform: {fileID: 0}
minHeadVelocityThreshold: 0.5
maxHeadVelocityThreshold: 2
preferEyeTracking: 0
useEyeTracking: 0
--- !u!114 &1325208058
MonoBehaviour:
m_ObjectHideFlags: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,7 @@ MonoBehaviour:
gazeTransform: {fileID: 0}
minHeadVelocityThreshold: 0.5
maxHeadVelocityThreshold: 2
preferEyeTracking: 0
useEyeTracking: 0
--- !u!114 &1619951302
MonoBehaviour:
m_ObjectHideFlags: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3131,7 +3131,7 @@ MonoBehaviour:
gazeTransform: {fileID: 0}
minHeadVelocityThreshold: 0.5
maxHeadVelocityThreshold: 2
preferEyeTracking: 0
useEyeTracking: 0
--- !u!114 &2124803462
MonoBehaviour:
m_ObjectHideFlags: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,7 @@ MonoBehaviour:
gazeTransform: {fileID: 0}
minHeadVelocityThreshold: 0.5
maxHeadVelocityThreshold: 2
preferEyeTracking: 0
useEyeTracking: 0
--- !u!114 &534669907
MonoBehaviour:
m_ObjectHideFlags: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3186,7 +3186,7 @@ MonoBehaviour:
gazeTransform: {fileID: 0}
minHeadVelocityThreshold: 0.5
maxHeadVelocityThreshold: 2
preferEyeTracking: 0
useEyeTracking: 0
--- !u!114 &1607275050
MonoBehaviour:
m_ObjectHideFlags: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,7 @@ MonoBehaviour:
gazeTransform: {fileID: 0}
minHeadVelocityThreshold: 0.5
maxHeadVelocityThreshold: 2
preferEyeTracking: 0
useEyeTracking: 0
--- !u!81 &1428889687
AudioListener:
m_ObjectHideFlags: 0
Expand Down
12 changes: 7 additions & 5 deletions Assets/MixedRealityToolkit.Services/InputSystem/GazeProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Microsoft.MixedReality.Toolkit.Utilities;
using System;
using UnityEngine;
using UnityEngine.Serialization;
using UnityPhysics = UnityEngine.Physics;

namespace Microsoft.MixedReality.Toolkit.Input
Expand Down Expand Up @@ -80,14 +81,15 @@ public bool Enabled
}

[SerializeField]
[Tooltip("True to prefer eye tracking over head gaze, when available.")]
private bool preferEyeTracking = false;
[Tooltip("If true, eye-based tracking will be used when available. Requires the 'Gaze Input' permission and device eye calibration to have been run.")]
[FormerlySerializedAs("preferEyeTracking")]
private bool useEyeTracking = false;

/// <inheritdoc />
public bool UseEyeTracking
{
get { return preferEyeTracking; }
set { preferEyeTracking = value; }
get { return useEyeTracking; }
set { useEyeTracking = value; }
}

/// <inheritdoc />
Expand Down Expand Up @@ -224,7 +226,7 @@ public override void OnPreSceneQuery()
Vector3 newGazeOrigin = Vector3.zero;
Vector3 newGazeNormal = Vector3.zero;

if (gazeProvider.preferEyeTracking && gazeProvider.IsEyeTrackingAvailable)
if (gazeProvider.useEyeTracking && gazeProvider.IsEyeTrackingAvailable)
{
gazeProvider.gazeInputSource.SourceType = InputSourceType.Eyes;
newGazeOrigin = gazeProvider.latestEyeGaze.origin;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,13 @@ public interface IMixedRealityEyeGazeProvider : IMixedRealityGazeProvider
bool IsEyeGazeValid { get; }

/// <summary>
/// True to provide eye tracking, when available.
/// If true, eye-based tracking will be used when available.
/// </summary>
/// <remarks>
/// The usage of eye-based tracking depends on having the Gaze Input permission set
/// and user approved, along with proper device eye calibration. This willback to head-based
/// gaze when eye-based tracking is not available.
/// </remarks>
bool UseEyeTracking { get; set; }

/// <summary>
Expand Down

0 comments on commit 0a249ae

Please sign in to comment.