diff --git a/UnityProjects/MRTKDevTemplate/Assets/Scenes/EyeGazeExample.unity b/UnityProjects/MRTKDevTemplate/Assets/Scenes/EyeGazeExample.unity index b4aed6af1e0..9e7cbf46a77 100644 --- a/UnityProjects/MRTKDevTemplate/Assets/Scenes/EyeGazeExample.unity +++ b/UnityProjects/MRTKDevTemplate/Assets/Scenes/EyeGazeExample.unity @@ -38,7 +38,7 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 705507994} - m_IndirectSpecularColor: {r: 0.18028378, g: 0.22571412, b: 0.30692285, a: 1} + m_IndirectSpecularColor: {r: 0.18028328, g: 0.22571322, b: 0.30692163, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: @@ -154,6 +154,7 @@ Transform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: -0.251, y: 0.169, z: -0.12100017} m_LocalScale: {x: 0.11298029, y: 0.110994965, z: 0.044128653} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1894132562} m_RootOrder: 1 @@ -196,6 +197,13 @@ MonoBehaviour: m_DistanceCalculationMode: 1 m_SelectMode: 1 m_CustomReticle: {fileID: 0} + m_AllowGazeInteraction: 0 + m_AllowGazeSelect: 0 + m_OverrideGazeTimeToSelect: 0 + m_GazeTimeToSelect: 0.5 + m_OverrideTimeToAutoDeselectGaze: 0 + m_TimeToAutoDeselectGaze: 3 + m_AllowGazeAssistance: 0 m_FirstHoverEntered: m_PersistentCalls: m_Calls: [] @@ -228,6 +236,7 @@ MonoBehaviour: m_Calls: [] m_StartingHoverFilters: [] m_StartingSelectFilters: [] + m_StartingInteractionStrengthFilters: [] m_OnFirstHoverEntered: m_PersistentCalls: m_Calls: [] @@ -371,6 +380,7 @@ MonoBehaviour: allowSelectByVoice: 1 speechRecognitionKeyword: select k__BackingField: 1 + k__BackingField: 0 k__BackingField: active: 0 onEntered: @@ -412,6 +422,7 @@ MeshRenderer: m_CastShadows: 1 m_ReceiveShadows: 1 m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -481,6 +492,7 @@ Transform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: -0.171, y: -0.1631, z: -0.12100017} m_LocalScale: {x: 0.25238925, y: 0.06096921, z: 0.04002599} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 472460404} m_RootOrder: 1 @@ -523,6 +535,13 @@ MonoBehaviour: m_DistanceCalculationMode: 1 m_SelectMode: 1 m_CustomReticle: {fileID: 0} + m_AllowGazeInteraction: 0 + m_AllowGazeSelect: 0 + m_OverrideGazeTimeToSelect: 0 + m_GazeTimeToSelect: 0.5 + m_OverrideTimeToAutoDeselectGaze: 0 + m_TimeToAutoDeselectGaze: 3 + m_AllowGazeAssistance: 0 m_FirstHoverEntered: m_PersistentCalls: m_Calls: [] @@ -555,6 +574,7 @@ MonoBehaviour: m_Calls: [] m_StartingHoverFilters: [] m_StartingSelectFilters: [] + m_StartingInteractionStrengthFilters: [] m_OnFirstHoverEntered: m_PersistentCalls: m_Calls: [] @@ -698,6 +718,7 @@ MonoBehaviour: allowSelectByVoice: 1 speechRecognitionKeyword: select k__BackingField: 1 + k__BackingField: 0 k__BackingField: active: 0 onEntered: @@ -739,6 +760,7 @@ MeshRenderer: m_CastShadows: 1 m_ReceiveShadows: 1 m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -808,6 +830,7 @@ Transform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0.30409005, y: 0.302222, z: -1.0577751} m_LocalScale: {x: 0.20575027, y: 0.21814884, z: 0.34990478} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 621663675} m_RootOrder: 3 @@ -850,6 +873,13 @@ MonoBehaviour: m_DistanceCalculationMode: 1 m_SelectMode: 1 m_CustomReticle: {fileID: 0} + m_AllowGazeInteraction: 0 + m_AllowGazeSelect: 0 + m_OverrideGazeTimeToSelect: 0 + m_GazeTimeToSelect: 0.5 + m_OverrideTimeToAutoDeselectGaze: 0 + m_TimeToAutoDeselectGaze: 3 + m_AllowGazeAssistance: 0 m_FirstHoverEntered: m_PersistentCalls: m_Calls: [] @@ -882,6 +912,7 @@ MonoBehaviour: m_Calls: [] m_StartingHoverFilters: [] m_StartingSelectFilters: [] + m_StartingInteractionStrengthFilters: [] m_OnFirstHoverEntered: m_PersistentCalls: m_Calls: [] @@ -1025,6 +1056,7 @@ MonoBehaviour: allowSelectByVoice: 1 speechRecognitionKeyword: select k__BackingField: 1 + k__BackingField: 0 k__BackingField: active: 0 onEntered: @@ -1066,6 +1098,7 @@ MeshRenderer: m_CastShadows: 1 m_ReceiveShadows: 1 m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -1135,6 +1168,7 @@ Transform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: -0.122599974, y: 0.03660001, z: -0.12100017} m_LocalScale: {x: 0.11298029, y: 0.110994965, z: 0.044128653} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1894132562} m_RootOrder: 2 @@ -1177,6 +1211,13 @@ MonoBehaviour: m_DistanceCalculationMode: 1 m_SelectMode: 1 m_CustomReticle: {fileID: 0} + m_AllowGazeInteraction: 0 + m_AllowGazeSelect: 0 + m_OverrideGazeTimeToSelect: 0 + m_GazeTimeToSelect: 0.5 + m_OverrideTimeToAutoDeselectGaze: 0 + m_TimeToAutoDeselectGaze: 3 + m_AllowGazeAssistance: 0 m_FirstHoverEntered: m_PersistentCalls: m_Calls: [] @@ -1209,6 +1250,7 @@ MonoBehaviour: m_Calls: [] m_StartingHoverFilters: [] m_StartingSelectFilters: [] + m_StartingInteractionStrengthFilters: [] m_OnFirstHoverEntered: m_PersistentCalls: m_Calls: [] @@ -1352,6 +1394,7 @@ MonoBehaviour: allowSelectByVoice: 1 speechRecognitionKeyword: select k__BackingField: 1 + k__BackingField: 0 k__BackingField: active: 0 onEntered: @@ -1393,6 +1436,7 @@ MeshRenderer: m_CastShadows: 1 m_ReceiveShadows: 1 m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -1462,6 +1506,7 @@ Transform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: -0.171, y: -0.2433, z: -0.12100017} m_LocalScale: {x: 0.25238925, y: 0.06096921, z: 0.04002599} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 472460404} m_RootOrder: 0 @@ -1504,6 +1549,13 @@ MonoBehaviour: m_DistanceCalculationMode: 1 m_SelectMode: 1 m_CustomReticle: {fileID: 0} + m_AllowGazeInteraction: 0 + m_AllowGazeSelect: 0 + m_OverrideGazeTimeToSelect: 0 + m_GazeTimeToSelect: 0.5 + m_OverrideTimeToAutoDeselectGaze: 0 + m_TimeToAutoDeselectGaze: 3 + m_AllowGazeAssistance: 0 m_FirstHoverEntered: m_PersistentCalls: m_Calls: [] @@ -1536,6 +1588,7 @@ MonoBehaviour: m_Calls: [] m_StartingHoverFilters: [] m_StartingSelectFilters: [] + m_StartingInteractionStrengthFilters: [] m_OnFirstHoverEntered: m_PersistentCalls: m_Calls: [] @@ -1679,6 +1732,7 @@ MonoBehaviour: allowSelectByVoice: 1 speechRecognitionKeyword: select k__BackingField: 1 + k__BackingField: 0 k__BackingField: active: 0 onEntered: @@ -1720,6 +1774,7 @@ MeshRenderer: m_CastShadows: 1 m_ReceiveShadows: 1 m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -1758,6 +1813,429 @@ MeshFilter: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 326425093} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1001 &367910264 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 1490372589} + m_Modifications: + - target: {fileID: 2446705927233332293, guid: e8c3ea3c1046f8b4bbd682c2b7a0e4fe, type: 3} + propertyPath: m_text + value: This scene showcases using the gaze interactor to highlight various + object in the scene. The following setup tests several edge cases for gaze + selection. + objectReference: {fileID: 0} + - target: {fileID: 3220012215463627515, guid: e8c3ea3c1046f8b4bbd682c2b7a0e4fe, type: 3} + propertyPath: m_Pivot.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 3220012215463627515, guid: e8c3ea3c1046f8b4bbd682c2b7a0e4fe, type: 3} + propertyPath: m_Pivot.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 3220012215463627515, guid: e8c3ea3c1046f8b4bbd682c2b7a0e4fe, type: 3} + propertyPath: m_RootOrder + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3220012215463627515, guid: e8c3ea3c1046f8b4bbd682c2b7a0e4fe, type: 3} + propertyPath: m_AnchorMax.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3220012215463627515, guid: e8c3ea3c1046f8b4bbd682c2b7a0e4fe, type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3220012215463627515, guid: e8c3ea3c1046f8b4bbd682c2b7a0e4fe, type: 3} + propertyPath: m_AnchorMin.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3220012215463627515, guid: e8c3ea3c1046f8b4bbd682c2b7a0e4fe, type: 3} + propertyPath: m_AnchorMin.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3220012215463627515, guid: e8c3ea3c1046f8b4bbd682c2b7a0e4fe, type: 3} + propertyPath: m_SizeDelta.x + value: 213.2298 + objectReference: {fileID: 0} + - target: {fileID: 3220012215463627515, guid: e8c3ea3c1046f8b4bbd682c2b7a0e4fe, type: 3} + propertyPath: m_SizeDelta.y + value: 93.4684 + objectReference: {fileID: 0} + - target: {fileID: 3220012215463627515, guid: e8c3ea3c1046f8b4bbd682c2b7a0e4fe, type: 3} + propertyPath: m_LocalScale.x + value: 0.002 + objectReference: {fileID: 0} + - target: {fileID: 3220012215463627515, guid: e8c3ea3c1046f8b4bbd682c2b7a0e4fe, type: 3} + propertyPath: m_LocalScale.y + value: 0.002 + objectReference: {fileID: 0} + - target: {fileID: 3220012215463627515, guid: e8c3ea3c1046f8b4bbd682c2b7a0e4fe, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3220012215463627515, guid: e8c3ea3c1046f8b4bbd682c2b7a0e4fe, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3220012215463627515, guid: e8c3ea3c1046f8b4bbd682c2b7a0e4fe, type: 3} + propertyPath: m_LocalPosition.z + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 3220012215463627515, guid: e8c3ea3c1046f8b4bbd682c2b7a0e4fe, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9659258 + objectReference: {fileID: 0} + - target: {fileID: 3220012215463627515, guid: e8c3ea3c1046f8b4bbd682c2b7a0e4fe, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3220012215463627515, guid: e8c3ea3c1046f8b4bbd682c2b7a0e4fe, type: 3} + propertyPath: m_LocalRotation.y + value: 0.2588191 + objectReference: {fileID: 0} + - target: {fileID: 3220012215463627515, guid: e8c3ea3c1046f8b4bbd682c2b7a0e4fe, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3220012215463627515, guid: e8c3ea3c1046f8b4bbd682c2b7a0e4fe, type: 3} + propertyPath: m_AnchoredPosition.x + value: 1.1 + objectReference: {fileID: 0} + - target: {fileID: 3220012215463627515, guid: e8c3ea3c1046f8b4bbd682c2b7a0e4fe, type: 3} + propertyPath: m_AnchoredPosition.y + value: 0.3 + objectReference: {fileID: 0} + - target: {fileID: 3220012215463627515, guid: e8c3ea3c1046f8b4bbd682c2b7a0e4fe, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3220012215463627515, guid: e8c3ea3c1046f8b4bbd682c2b7a0e4fe, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 30 + objectReference: {fileID: 0} + - target: {fileID: 3220012215463627515, guid: e8c3ea3c1046f8b4bbd682c2b7a0e4fe, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4568172237328552037, guid: e8c3ea3c1046f8b4bbd682c2b7a0e4fe, type: 3} + propertyPath: m_text + value: Eye Gaze Example + objectReference: {fileID: 0} + - target: {fileID: 6540126486176102408, guid: e8c3ea3c1046f8b4bbd682c2b7a0e4fe, type: 3} + propertyPath: m_Name + value: DescriptionPanel + objectReference: {fileID: 0} + - target: {fileID: 6809291684801504143, guid: e8c3ea3c1046f8b4bbd682c2b7a0e4fe, type: 3} + propertyPath: m_text + value: 'There was an error retrieving eye calibration status. ' + objectReference: {fileID: 0} + - target: {fileID: 6809291684801504143, guid: e8c3ea3c1046f8b4bbd682c2b7a0e4fe, type: 3} + propertyPath: m_fontColor.b + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6809291684801504143, guid: e8c3ea3c1046f8b4bbd682c2b7a0e4fe, type: 3} + propertyPath: m_fontColor.g + value: 0.95351547 + objectReference: {fileID: 0} + - target: {fileID: 6809291684801504143, guid: e8c3ea3c1046f8b4bbd682c2b7a0e4fe, type: 3} + propertyPath: m_fontColor.r + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6809291684801504143, guid: e8c3ea3c1046f8b4bbd682c2b7a0e4fe, type: 3} + propertyPath: m_fontColor32.rgba + value: 4278252543 + objectReference: {fileID: 0} + - target: {fileID: 9182356717869552287, guid: e8c3ea3c1046f8b4bbd682c2b7a0e4fe, type: 3} + propertyPath: m_AnchoredPosition.y + value: -115.31348 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: e8c3ea3c1046f8b4bbd682c2b7a0e4fe, type: 3} +--- !u!224 &367910265 stripped +RectTransform: + m_CorrespondingSourceObject: {fileID: 3220012215463627515, guid: e8c3ea3c1046f8b4bbd682c2b7a0e4fe, type: 3} + m_PrefabInstance: {fileID: 367910264} + m_PrefabAsset: {fileID: 0} +--- !u!1 &367910266 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 8323939510892415185, guid: e8c3ea3c1046f8b4bbd682c2b7a0e4fe, type: 3} + m_PrefabInstance: {fileID: 367910264} + m_PrefabAsset: {fileID: 0} +--- !u!65 &367910267 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 367910266} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 0.99999994, y: 1.0000001, z: 0.099999994} + m_Center: {x: 0, y: 0, z: 0.049999997} +--- !u!114 &367910269 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 367910266} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 80f85af46f9bddd4ea78f11cee5e3b2e, type: 3} + m_Name: + m_EditorClassIdentifier: + handType: 3 + proximityType: 3 + executionOrder: 0 + minimumScale: {x: 0.2, y: 0.2, z: 0.2} + maximumScale: {x: 2, y: 2, z: 2} + relativeToInitialState: 1 +--- !u!114 &367910270 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 367910266} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d9ad66e7cc9a2754d8ea989740c9f00d, type: 3} + m_Name: + m_EditorClassIdentifier: + m_InteractionManager: {fileID: 0} + m_Colliders: [] + m_InteractionLayerMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_InteractionLayers: + m_Bits: 1 + m_DistanceCalculationMode: 1 + m_SelectMode: 1 + m_CustomReticle: {fileID: 0} + m_AllowGazeInteraction: 0 + m_AllowGazeSelect: 0 + m_OverrideGazeTimeToSelect: 0 + m_GazeTimeToSelect: 0.5 + m_OverrideTimeToAutoDeselectGaze: 0 + m_TimeToAutoDeselectGaze: 3 + m_AllowGazeAssistance: 0 + m_FirstHoverEntered: + m_PersistentCalls: + m_Calls: [] + m_LastHoverExited: + m_PersistentCalls: + m_Calls: [] + m_HoverEntered: + m_PersistentCalls: + m_Calls: [] + m_HoverExited: + m_PersistentCalls: + m_Calls: [] + m_FirstSelectEntered: + m_PersistentCalls: + m_Calls: [] + m_LastSelectExited: + m_PersistentCalls: + m_Calls: [] + m_SelectEntered: + m_PersistentCalls: + m_Calls: [] + m_SelectExited: + m_PersistentCalls: + m_Calls: [] + m_Activated: + m_PersistentCalls: + m_Calls: [] + m_Deactivated: + m_PersistentCalls: + m_Calls: [] + m_StartingHoverFilters: [] + m_StartingSelectFilters: [] + m_StartingInteractionStrengthFilters: [] + m_OnFirstHoverEntered: + m_PersistentCalls: + m_Calls: [] + m_OnLastHoverExited: + m_PersistentCalls: + m_Calls: [] + m_OnHoverEntered: + m_PersistentCalls: + m_Calls: [] + m_OnHoverExited: + m_PersistentCalls: + m_Calls: [] + m_OnSelectEntered: + m_PersistentCalls: + m_Calls: [] + m_OnSelectExited: + m_PersistentCalls: + m_Calls: [] + m_OnSelectCanceled: + m_PersistentCalls: + m_Calls: [] + m_OnActivate: + m_PersistentCalls: + m_Calls: [] + m_OnDeactivate: + m_PersistentCalls: + m_Calls: [] + isGazePinchSelected: + active: 0 + onEntered: + m_PersistentCalls: + m_Calls: [] + onExited: + m_PersistentCalls: + m_Calls: [] + isRaySelected: + active: 0 + onEntered: + m_PersistentCalls: + m_Calls: [] + onExited: + m_PersistentCalls: + m_Calls: [] + isPokeSelected: + active: 0 + onEntered: + m_PersistentCalls: + m_Calls: [] + onExited: + m_PersistentCalls: + m_Calls: [] + isGrabSelected: + active: 0 + onEntered: + m_PersistentCalls: + m_Calls: [] + onExited: + m_PersistentCalls: + m_Calls: [] + isGazeHovered: + active: 0 + onEntered: + m_PersistentCalls: + m_Calls: [] + onExited: + m_PersistentCalls: + m_Calls: [] + isGazePinchHovered: + active: 0 + onEntered: + m_PersistentCalls: + m_Calls: [] + onExited: + m_PersistentCalls: + m_Calls: [] + isRayHovered: + active: 0 + onEntered: + m_PersistentCalls: + m_Calls: [] + onExited: + m_PersistentCalls: + m_Calls: [] + isGrabHovered: + active: 0 + onEntered: + m_PersistentCalls: + m_Calls: [] + onExited: + m_PersistentCalls: + m_Calls: [] + isPokeHovered: + active: 0 + onEntered: + m_PersistentCalls: + m_Calls: [] + onExited: + m_PersistentCalls: + m_Calls: [] + isActiveHovered: + active: 0 + onEntered: + m_PersistentCalls: + m_Calls: [] + onExited: + m_PersistentCalls: + m_Calls: [] + disabledInteractorTypes: + - reference: Microsoft.MixedReality.Toolkit.IPokeInteractor, Microsoft.MixedReality.Toolkit.Core + k__BackingField: 0 + k__BackingField: 0.9 + k__BackingField: 0.1 + k__BackingField: 1 + k__BackingField: 0 + k__BackingField: 1 + k__BackingField: 0 + k__BackingField: 1 + allowSelectByVoice: 1 + speechRecognitionKeyword: select + k__BackingField: 1 + k__BackingField: 0 + k__BackingField: + active: 0 + onEntered: + m_PersistentCalls: + m_Calls: [] + onExited: + m_PersistentCalls: + m_Calls: [] + k__BackingField: + m_PersistentCalls: + m_Calls: [] + k__BackingField: + m_PersistentCalls: + m_Calls: [] + k__BackingField: + m_PersistentCalls: + m_Calls: [] + hostTransform: {fileID: 1490372589} + allowedManipulations: 7 + allowedInteractionTypes: -2147483641 + applyTorque: 1 + springForceSoftness: 0.1 + springTorqueSoftness: 0.1 + springDamping: 1 + springForceLimit: 100 + rotationAnchorNear: 1 + rotationAnchorFar: 1 + releaseBehavior: 3 + transformSmoothingLogicType: + reference: Microsoft.MixedReality.Toolkit.SpatialManipulation.DefaultTransformSmoothingLogic, + Microsoft.MixedReality.Toolkit.SpatialManipulation + smoothingFar: 1 + smoothingNear: 1 + moveLerpTime: 0.001 + rotateLerpTime: 0.001 + scaleLerpTime: 0.001 + enableConstraints: 1 + constraintsManager: {fileID: 0} + manipulationLogicTypes: + moveLogicType: + reference: Microsoft.MixedReality.Toolkit.SpatialManipulation.MoveLogic, Microsoft.MixedReality.Toolkit.SpatialManipulation + rotateLogicType: + reference: Microsoft.MixedReality.Toolkit.SpatialManipulation.RotateLogic, + Microsoft.MixedReality.Toolkit.SpatialManipulation + scaleLogicType: + reference: Microsoft.MixedReality.Toolkit.SpatialManipulation.ScaleLogic, Microsoft.MixedReality.Toolkit.SpatialManipulation +--- !u!114 &367910271 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 367910266} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 50cdab0cd5a0916419324bb54314773d, type: 3} + m_Name: + m_EditorClassIdentifier: + autoConstraintSelection: 1 + selectedConstraints: [] --- !u!1 &404605803 GameObject: m_ObjectHideFlags: 0 @@ -1784,6 +2262,7 @@ Transform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0.2847762, y: 0.13767275, z: 1.599408} m_LocalScale: {x: 1.8149, y: 1.8149, z: 1.8149} + m_ConstrainProportionsScale: 0 m_Children: - {fileID: 1093476472} - {fileID: 1894132562} @@ -1791,7 +2270,7 @@ Transform: - {fileID: 472460404} - {fileID: 879594383} m_Father: {fileID: 1490372589} - m_RootOrder: 0 + m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &472460403 GameObject: @@ -1819,6 +2298,7 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: - {fileID: 326425094} - {fileID: 88945692} @@ -1858,6 +2338,7 @@ Transform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0.1452, y: -0.1631, z: -0.12100005} m_LocalScale: {x: 0.25238925, y: 0.06096921, z: 0.04002599} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 472460404} m_RootOrder: 3 @@ -1900,6 +2381,13 @@ MonoBehaviour: m_DistanceCalculationMode: 1 m_SelectMode: 1 m_CustomReticle: {fileID: 0} + m_AllowGazeInteraction: 0 + m_AllowGazeSelect: 0 + m_OverrideGazeTimeToSelect: 0 + m_GazeTimeToSelect: 0.5 + m_OverrideTimeToAutoDeselectGaze: 0 + m_TimeToAutoDeselectGaze: 3 + m_AllowGazeAssistance: 0 m_FirstHoverEntered: m_PersistentCalls: m_Calls: [] @@ -1932,6 +2420,7 @@ MonoBehaviour: m_Calls: [] m_StartingHoverFilters: [] m_StartingSelectFilters: [] + m_StartingInteractionStrengthFilters: [] m_OnFirstHoverEntered: m_PersistentCalls: m_Calls: [] @@ -2075,6 +2564,7 @@ MonoBehaviour: allowSelectByVoice: 1 speechRecognitionKeyword: select k__BackingField: 1 + k__BackingField: 0 k__BackingField: active: 0 onEntered: @@ -2116,6 +2606,7 @@ MeshRenderer: m_CastShadows: 1 m_ReceiveShadows: 1 m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -2213,6 +2704,7 @@ Transform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0.7494491, y: 0.7494491, z: 0.114391096} + m_ConstrainProportionsScale: 0 m_Children: - {fileID: 2058920467} - {fileID: 1346459359} @@ -2310,6 +2802,7 @@ Transform: m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} m_LocalPosition: {x: 0, y: 3, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} m_RootOrder: 0 @@ -2345,6 +2838,7 @@ Transform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: -0.171, y: -0.1631, z: -0.14898} m_LocalScale: {x: 0.25238925, y: 0.06096921, z: 0.09597992} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 879594383} m_RootOrder: 1 @@ -2387,6 +2881,13 @@ MonoBehaviour: m_DistanceCalculationMode: 1 m_SelectMode: 1 m_CustomReticle: {fileID: 0} + m_AllowGazeInteraction: 0 + m_AllowGazeSelect: 0 + m_OverrideGazeTimeToSelect: 0 + m_GazeTimeToSelect: 0.5 + m_OverrideTimeToAutoDeselectGaze: 0 + m_TimeToAutoDeselectGaze: 3 + m_AllowGazeAssistance: 0 m_FirstHoverEntered: m_PersistentCalls: m_Calls: [] @@ -2419,6 +2920,7 @@ MonoBehaviour: m_Calls: [] m_StartingHoverFilters: [] m_StartingSelectFilters: [] + m_StartingInteractionStrengthFilters: [] m_OnFirstHoverEntered: m_PersistentCalls: m_Calls: [] @@ -2562,6 +3064,7 @@ MonoBehaviour: allowSelectByVoice: 1 speechRecognitionKeyword: select k__BackingField: 1 + k__BackingField: 0 k__BackingField: active: 0 onEntered: @@ -2603,6 +3106,7 @@ MeshRenderer: m_CastShadows: 1 m_ReceiveShadows: 1 m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -2667,6 +3171,7 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0.031, y: 0.366, z: 0.289} m_LocalScale: {x: 0.13818, y: 0.71437, z: 4.0244} + m_ConstrainProportionsScale: 0 m_Children: - {fileID: 1213792266} - {fileID: 737023106} @@ -2735,6 +3240,7 @@ Transform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: -0.122599974, y: 0.169, z: -0.12100005} m_LocalScale: {x: 0.11298029, y: 0.110994965, z: 0.044128653} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1894132562} m_RootOrder: 3 @@ -2777,6 +3283,13 @@ MonoBehaviour: m_DistanceCalculationMode: 1 m_SelectMode: 1 m_CustomReticle: {fileID: 0} + m_AllowGazeInteraction: 0 + m_AllowGazeSelect: 0 + m_OverrideGazeTimeToSelect: 0 + m_GazeTimeToSelect: 0.5 + m_OverrideTimeToAutoDeselectGaze: 0 + m_TimeToAutoDeselectGaze: 3 + m_AllowGazeAssistance: 0 m_FirstHoverEntered: m_PersistentCalls: m_Calls: [] @@ -2809,6 +3322,7 @@ MonoBehaviour: m_Calls: [] m_StartingHoverFilters: [] m_StartingSelectFilters: [] + m_StartingInteractionStrengthFilters: [] m_OnFirstHoverEntered: m_PersistentCalls: m_Calls: [] @@ -2952,6 +3466,7 @@ MonoBehaviour: allowSelectByVoice: 1 speechRecognitionKeyword: select k__BackingField: 1 + k__BackingField: 0 k__BackingField: active: 0 onEntered: @@ -2993,6 +3508,7 @@ MeshRenderer: m_CastShadows: 1 m_ReceiveShadows: 1 m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -3031,7 +3547,7 @@ MeshFilter: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 970390112} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} ---- !u!1 &975427118 +--- !u!1 &971743152 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -3039,169 +3555,52 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 975427121} - - component: {fileID: 975427120} - - component: {fileID: 975427119} + - component: {fileID: 971743154} + - component: {fileID: 971743153} m_Layer: 0 - m_Name: TextMeshPro (7) + m_Name: EyeCalibrationChecker m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!114 &975427119 +--- !u!114 &971743153 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 975427118} + m_GameObject: {fileID: 971743152} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 9541d86e2fd84c1d9990edf0852d74ab, type: 3} + m_Script: {fileID: 11500000, guid: 8b0ab44b6f20884458aa9e1d5ea5cf22, type: 3} m_Name: m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_text: This scene showcases using the gaze interactor to highlight various object - in the scene. The following setup tests several edge cases for gaze selection. - m_isRightToLeft: 0 - m_fontAsset: {fileID: 11400000, guid: 533bdd8d5c92b52448ee2ecf7bd828a4, type: 2} - m_sharedMaterial: {fileID: 2100000, guid: b082f80c6b45164418a354f7e116f0a3, type: 2} - m_fontSharedMaterials: [] - m_fontMaterial: {fileID: 0} - m_fontMaterials: [] - m_fontColor32: - serializedVersion: 2 - rgba: 4294638330 - m_fontColor: {r: 0.98039216, g: 0.98039216, b: 0.98039216, a: 1} - m_enableVertexGradient: 0 - m_colorMode: 3 - m_fontColorGradient: - topLeft: {r: 1, g: 1, b: 1, a: 1} - topRight: {r: 1, g: 1, b: 1, a: 1} - bottomLeft: {r: 1, g: 1, b: 1, a: 1} - bottomRight: {r: 1, g: 1, b: 1, a: 1} - m_fontColorGradientPreset: {fileID: 0} - m_spriteAsset: {fileID: 0} - m_tintAllSprites: 0 - m_StyleSheet: {fileID: 0} - m_TextStyleHashCode: -1183493901 - m_overrideHtmlColors: 0 - m_faceColor: - serializedVersion: 2 - rgba: 4294967295 - m_fontSize: 0.08 - m_fontSizeBase: 0.08 - m_fontWeight: 400 - m_enableAutoSizing: 0 - m_fontSizeMin: 18 - m_fontSizeMax: 72 - m_fontStyle: 0 - m_HorizontalAlignment: 1 - m_VerticalAlignment: 512 - m_textAlignment: 65535 - m_characterSpacing: 0 - m_wordSpacing: 0 - m_lineSpacing: 0 - m_lineSpacingMax: 0 - m_paragraphSpacing: 0 - m_charWidthMaxAdj: 0 - m_enableWordWrapping: 1 - m_wordWrappingRatios: 0.4 - m_overflowMode: 0 - m_linkedTextComponent: {fileID: 0} - parentLinkedComponent: {fileID: 0} - m_enableKerning: 1 - m_enableExtraPadding: 0 - checkPaddingRequired: 0 - m_isRichText: 1 - m_parseCtrlCharacters: 1 - m_isOrthographic: 0 - m_isCullingEnabled: 0 - m_horizontalMapping: 0 - m_verticalMapping: 0 - m_uvLineOffset: 0 - m_geometrySortingOrder: 0 - m_IsTextObjectScaleStatic: 0 - m_VertexBufferAutoSizeReduction: 1 - m_useMaxVisibleDescender: 1 - m_pageToDisplay: 1 - m_margin: {x: 0, y: -0.0022691963, z: 0.004040405, w: 0} - m_isUsingLegacyAnimationComponent: 0 - m_isVolumetricText: 0 - m_hasFontAssetChanged: 0 - m_renderer: {fileID: 975427120} - m_maskType: 0 - _SortingLayer: 0 - _SortingLayerID: 0 - _SortingOrder: 0 ---- !u!23 &975427120 -MeshRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 975427118} - m_Enabled: 1 - m_CastShadows: 0 - m_ReceiveShadows: 0 - m_DynamicOccludee: 1 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_RayTracingMode: 2 - m_RayTraceProcedural: 0 - m_RenderingLayerMask: 4294967295 - m_RendererPriority: 0 - m_Materials: - - {fileID: 2100000, guid: b082f80c6b45164418a354f7e116f0a3, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_ReceiveGI: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 0 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 - m_AdditionalVertexStreams: {fileID: 0} ---- !u!224 &975427121 -RectTransform: + EditorTestIsCalibrated: 4 + calibrated: + m_PersistentCalls: + m_Calls: [] + notCalibrated: + m_PersistentCalls: + m_Calls: [] + calibratedStatusChanged: + m_PersistentCalls: + m_Calls: [] +--- !u!4 &971743154 +Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 975427118} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 1.105} - m_LocalScale: {x: 2.3012, y: 2.3012, z: 2.3012} + m_GameObject: {fileID: 971743152} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} m_RootOrder: 6 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 0.631, y: 1.44} - m_SizeDelta: {x: 0.1636, y: 0.04471} - m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &1093476471 GameObject: m_ObjectHideFlags: 0 @@ -3233,6 +3632,7 @@ Transform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0.7494491, y: 0.7494491, z: 0.114391096} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 404605804} m_RootOrder: 0 @@ -3275,6 +3675,13 @@ MonoBehaviour: m_DistanceCalculationMode: 1 m_SelectMode: 1 m_CustomReticle: {fileID: 0} + m_AllowGazeInteraction: 0 + m_AllowGazeSelect: 0 + m_OverrideGazeTimeToSelect: 0 + m_GazeTimeToSelect: 0.5 + m_OverrideTimeToAutoDeselectGaze: 0 + m_TimeToAutoDeselectGaze: 3 + m_AllowGazeAssistance: 0 m_FirstHoverEntered: m_PersistentCalls: m_Calls: [] @@ -3307,6 +3714,7 @@ MonoBehaviour: m_Calls: [] m_StartingHoverFilters: [] m_StartingSelectFilters: [] + m_StartingInteractionStrengthFilters: [] m_OnFirstHoverEntered: m_PersistentCalls: m_Calls: [] @@ -3450,6 +3858,7 @@ MonoBehaviour: allowSelectByVoice: 1 speechRecognitionKeyword: select k__BackingField: 1 + k__BackingField: 0 k__BackingField: active: 0 onEntered: @@ -3491,6 +3900,7 @@ MeshRenderer: m_CastShadows: 1 m_ReceiveShadows: 1 m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -3560,6 +3970,7 @@ Transform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: -0.171, y: -0.2433, z: -0.14898} m_LocalScale: {x: 0.25238925, y: 0.06096921, z: 0.09597992} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 879594383} m_RootOrder: 0 @@ -3602,6 +4013,13 @@ MonoBehaviour: m_DistanceCalculationMode: 1 m_SelectMode: 1 m_CustomReticle: {fileID: 0} + m_AllowGazeInteraction: 0 + m_AllowGazeSelect: 0 + m_OverrideGazeTimeToSelect: 0 + m_GazeTimeToSelect: 0.5 + m_OverrideTimeToAutoDeselectGaze: 0 + m_TimeToAutoDeselectGaze: 3 + m_AllowGazeAssistance: 0 m_FirstHoverEntered: m_PersistentCalls: m_Calls: [] @@ -3634,6 +4052,7 @@ MonoBehaviour: m_Calls: [] m_StartingHoverFilters: [] m_StartingSelectFilters: [] + m_StartingInteractionStrengthFilters: [] m_OnFirstHoverEntered: m_PersistentCalls: m_Calls: [] @@ -3777,6 +4196,7 @@ MonoBehaviour: allowSelectByVoice: 1 speechRecognitionKeyword: select k__BackingField: 1 + k__BackingField: 0 k__BackingField: active: 0 onEntered: @@ -3818,6 +4238,7 @@ MeshRenderer: m_CastShadows: 1 m_ReceiveShadows: 1 m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -3887,6 +4308,7 @@ Transform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0.1452, y: -0.2433, z: -0.12100017} m_LocalScale: {x: 0.25238925, y: 0.06096921, z: 0.04002599} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 472460404} m_RootOrder: 2 @@ -3929,6 +4351,13 @@ MonoBehaviour: m_DistanceCalculationMode: 1 m_SelectMode: 1 m_CustomReticle: {fileID: 0} + m_AllowGazeInteraction: 0 + m_AllowGazeSelect: 0 + m_OverrideGazeTimeToSelect: 0 + m_GazeTimeToSelect: 0.5 + m_OverrideTimeToAutoDeselectGaze: 0 + m_TimeToAutoDeselectGaze: 3 + m_AllowGazeAssistance: 0 m_FirstHoverEntered: m_PersistentCalls: m_Calls: [] @@ -3961,6 +4390,7 @@ MonoBehaviour: m_Calls: [] m_StartingHoverFilters: [] m_StartingSelectFilters: [] + m_StartingInteractionStrengthFilters: [] m_OnFirstHoverEntered: m_PersistentCalls: m_Calls: [] @@ -4104,6 +4534,7 @@ MonoBehaviour: allowSelectByVoice: 1 speechRecognitionKeyword: select k__BackingField: 1 + k__BackingField: 0 k__BackingField: active: 0 onEntered: @@ -4145,6 +4576,7 @@ MeshRenderer: m_CastShadows: 1 m_ReceiveShadows: 1 m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -4214,6 +4646,7 @@ Transform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0.145, y: -0.2433, z: -0.14898} m_LocalScale: {x: 0.25238925, y: 0.06096921, z: 0.09597992} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 879594383} m_RootOrder: 2 @@ -4256,6 +4689,13 @@ MonoBehaviour: m_DistanceCalculationMode: 1 m_SelectMode: 1 m_CustomReticle: {fileID: 0} + m_AllowGazeInteraction: 0 + m_AllowGazeSelect: 0 + m_OverrideGazeTimeToSelect: 0 + m_GazeTimeToSelect: 0.5 + m_OverrideTimeToAutoDeselectGaze: 0 + m_TimeToAutoDeselectGaze: 3 + m_AllowGazeAssistance: 0 m_FirstHoverEntered: m_PersistentCalls: m_Calls: [] @@ -4288,6 +4728,7 @@ MonoBehaviour: m_Calls: [] m_StartingHoverFilters: [] m_StartingSelectFilters: [] + m_StartingInteractionStrengthFilters: [] m_OnFirstHoverEntered: m_PersistentCalls: m_Calls: [] @@ -4431,6 +4872,7 @@ MonoBehaviour: allowSelectByVoice: 1 speechRecognitionKeyword: select k__BackingField: 1 + k__BackingField: 0 k__BackingField: active: 0 onEntered: @@ -4472,6 +4914,7 @@ MeshRenderer: m_CastShadows: 1 m_ReceiveShadows: 1 m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -4541,6 +4984,7 @@ Transform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0.046167247, y: 0.302222, z: -1.0577762} m_LocalScale: {x: 0.20575027, y: 0.21814884, z: 0.34990478} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 621663675} m_RootOrder: 1 @@ -4583,6 +5027,13 @@ MonoBehaviour: m_DistanceCalculationMode: 1 m_SelectMode: 1 m_CustomReticle: {fileID: 0} + m_AllowGazeInteraction: 0 + m_AllowGazeSelect: 0 + m_OverrideGazeTimeToSelect: 0 + m_GazeTimeToSelect: 0.5 + m_OverrideTimeToAutoDeselectGaze: 0 + m_TimeToAutoDeselectGaze: 3 + m_AllowGazeAssistance: 0 m_FirstHoverEntered: m_PersistentCalls: m_Calls: [] @@ -4615,6 +5066,7 @@ MonoBehaviour: m_Calls: [] m_StartingHoverFilters: [] m_StartingSelectFilters: [] + m_StartingInteractionStrengthFilters: [] m_OnFirstHoverEntered: m_PersistentCalls: m_Calls: [] @@ -4758,6 +5210,7 @@ MonoBehaviour: allowSelectByVoice: 1 speechRecognitionKeyword: select k__BackingField: 1 + k__BackingField: 0 k__BackingField: active: 0 onEntered: @@ -4799,6 +5252,7 @@ MeshRenderer: m_CastShadows: 1 m_ReceiveShadows: 1 m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -4863,7 +5317,9 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: -0.2847762, y: 1.3380473, z: 0.6185919} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: + - {fileID: 367910265} - {fileID: 404605804} m_Father: {fileID: 0} m_RootOrder: 4 @@ -4929,176 +5385,36 @@ PrefabInstance: objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 4d7e2f87fefe0ba468719b15288b46e7, type: 3} ---- !u!1 &1739899846 +--- !u!1 &1671028610 stripped GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 5929991690626966069, guid: e8c3ea3c1046f8b4bbd682c2b7a0e4fe, type: 3} + m_PrefabInstance: {fileID: 367910264} m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1739899849} - - component: {fileID: 1739899848} - - component: {fileID: 1739899847} - m_Layer: 0 - m_Name: TextMeshPro (6) - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &1739899847 +--- !u!114 &1671028612 stripped MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 6809291684801504143, guid: e8c3ea3c1046f8b4bbd682c2b7a0e4fe, type: 3} + m_PrefabInstance: {fileID: 367910264} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1739899846} + m_GameObject: {fileID: 1671028610} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 9541d86e2fd84c1d9990edf0852d74ab, type: 3} + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} m_Name: m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_text: Eye Gaze Example Scene - m_isRightToLeft: 0 - m_fontAsset: {fileID: 11400000, guid: 533bdd8d5c92b52448ee2ecf7bd828a4, type: 2} - m_sharedMaterial: {fileID: 2100000, guid: b082f80c6b45164418a354f7e116f0a3, type: 2} - m_fontSharedMaterials: [] - m_fontMaterial: {fileID: 0} - m_fontMaterials: [] - m_fontColor32: - serializedVersion: 2 - rgba: 4294638330 - m_fontColor: {r: 0.98039216, g: 0.98039216, b: 0.98039216, a: 1} - m_enableVertexGradient: 0 - m_colorMode: 3 - m_fontColorGradient: - topLeft: {r: 1, g: 1, b: 1, a: 1} - topRight: {r: 1, g: 1, b: 1, a: 1} - bottomLeft: {r: 1, g: 1, b: 1, a: 1} - bottomRight: {r: 1, g: 1, b: 1, a: 1} - m_fontColorGradientPreset: {fileID: 0} - m_spriteAsset: {fileID: 0} - m_tintAllSprites: 0 - m_StyleSheet: {fileID: 0} - m_TextStyleHashCode: -1183493901 - m_overrideHtmlColors: 0 - m_faceColor: - serializedVersion: 2 - rgba: 4294967295 - m_fontSize: 0.14 - m_fontSizeBase: 0.14 - m_fontWeight: 400 - m_enableAutoSizing: 0 - m_fontSizeMin: 18 - m_fontSizeMax: 72 - m_fontStyle: 0 - m_HorizontalAlignment: 1 - m_VerticalAlignment: 512 - m_textAlignment: 65535 - m_characterSpacing: 0 - m_wordSpacing: 0 - m_lineSpacing: 0 - m_lineSpacingMax: 0 - m_paragraphSpacing: 0 - m_charWidthMaxAdj: 0 - m_enableWordWrapping: 1 - m_wordWrappingRatios: 0.4 - m_overflowMode: 0 - m_linkedTextComponent: {fileID: 0} - parentLinkedComponent: {fileID: 0} - m_enableKerning: 1 - m_enableExtraPadding: 0 - checkPaddingRequired: 0 - m_isRichText: 1 - m_parseCtrlCharacters: 1 - m_isOrthographic: 0 - m_isCullingEnabled: 0 - m_horizontalMapping: 0 - m_verticalMapping: 0 - m_uvLineOffset: 0 - m_geometrySortingOrder: 0 - m_IsTextObjectScaleStatic: 0 - m_VertexBufferAutoSizeReduction: 1 - m_useMaxVisibleDescender: 1 - m_pageToDisplay: 1 - m_margin: {x: 0, y: -0.0022691963, z: 0, w: 0} - m_isUsingLegacyAnimationComponent: 0 - m_isVolumetricText: 0 - m_hasFontAssetChanged: 0 - m_renderer: {fileID: 1739899848} - m_maskType: 0 - _SortingLayer: 0 - _SortingLayerID: 0 - _SortingOrder: 0 ---- !u!23 &1739899848 -MeshRenderer: +--- !u!114 &1671028614 +MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1739899846} + m_GameObject: {fileID: 1671028610} m_Enabled: 1 - m_CastShadows: 0 - m_ReceiveShadows: 0 - m_DynamicOccludee: 1 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_RayTracingMode: 2 - m_RayTraceProcedural: 0 - m_RenderingLayerMask: 4294967295 - m_RendererPriority: 0 - m_Materials: - - {fileID: 2100000, guid: b082f80c6b45164418a354f7e116f0a3, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_ReceiveGI: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 0 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 - m_AdditionalVertexStreams: {fileID: 0} ---- !u!224 &1739899849 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1739899846} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 1.105} - m_LocalScale: {x: 2.3012, y: 2.3012, z: 2.3012} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 5 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 0.64149994, y: 1.5300701} - m_SizeDelta: {x: 0.1712, y: 0.0243} - m_Pivot: {x: 0.5, y: 0.5} + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4af82e4e12ccef3458ece0655ea8fe0f, type: 3} + m_Name: + m_EditorClassIdentifier: + checker: {fileID: 971743153} + text: {fileID: 1671028612} --- !u!1 &1868973377 GameObject: m_ObjectHideFlags: 0 @@ -5130,6 +5446,7 @@ Transform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0.30409005, y: 0.015344606, z: -1.0577762} m_LocalScale: {x: 0.20575027, y: 0.21814884, z: 0.34990478} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 621663675} m_RootOrder: 2 @@ -5172,6 +5489,13 @@ MonoBehaviour: m_DistanceCalculationMode: 1 m_SelectMode: 1 m_CustomReticle: {fileID: 0} + m_AllowGazeInteraction: 0 + m_AllowGazeSelect: 0 + m_OverrideGazeTimeToSelect: 0 + m_GazeTimeToSelect: 0.5 + m_OverrideTimeToAutoDeselectGaze: 0 + m_TimeToAutoDeselectGaze: 3 + m_AllowGazeAssistance: 0 m_FirstHoverEntered: m_PersistentCalls: m_Calls: [] @@ -5204,6 +5528,7 @@ MonoBehaviour: m_Calls: [] m_StartingHoverFilters: [] m_StartingSelectFilters: [] + m_StartingInteractionStrengthFilters: [] m_OnFirstHoverEntered: m_PersistentCalls: m_Calls: [] @@ -5347,6 +5672,7 @@ MonoBehaviour: allowSelectByVoice: 1 speechRecognitionKeyword: select k__BackingField: 1 + k__BackingField: 0 k__BackingField: active: 0 onEntered: @@ -5388,6 +5714,7 @@ MeshRenderer: m_CastShadows: 1 m_ReceiveShadows: 1 m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -5452,6 +5779,7 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: - {fileID: 2109154762} - {fileID: 22699391} @@ -5521,7 +5849,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 7372669237086358568, guid: 8bfb4497dda968b469f9c0c4a22374d1, type: 3} propertyPath: m_RootOrder - value: 7 + value: 5 objectReference: {fileID: 0} - target: {fileID: 7372669237086358568, guid: 8bfb4497dda968b469f9c0c4a22374d1, type: 3} propertyPath: m_LocalPosition.x @@ -5608,6 +5936,7 @@ Transform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0.046167247, y: 0.015344606, z: -1.0577762} m_LocalScale: {x: 0.20575027, y: 0.21814884, z: 0.34990478} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 621663675} m_RootOrder: 0 @@ -5650,6 +5979,13 @@ MonoBehaviour: m_DistanceCalculationMode: 1 m_SelectMode: 1 m_CustomReticle: {fileID: 0} + m_AllowGazeInteraction: 0 + m_AllowGazeSelect: 0 + m_OverrideGazeTimeToSelect: 0 + m_GazeTimeToSelect: 0.5 + m_OverrideTimeToAutoDeselectGaze: 0 + m_TimeToAutoDeselectGaze: 3 + m_AllowGazeAssistance: 0 m_FirstHoverEntered: m_PersistentCalls: m_Calls: [] @@ -5682,6 +6018,7 @@ MonoBehaviour: m_Calls: [] m_StartingHoverFilters: [] m_StartingSelectFilters: [] + m_StartingInteractionStrengthFilters: [] m_OnFirstHoverEntered: m_PersistentCalls: m_Calls: [] @@ -5825,6 +6162,7 @@ MonoBehaviour: allowSelectByVoice: 1 speechRecognitionKeyword: select k__BackingField: 1 + k__BackingField: 0 k__BackingField: active: 0 onEntered: @@ -5866,6 +6204,7 @@ MeshRenderer: m_CastShadows: 1 m_ReceiveShadows: 1 m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -5935,6 +6274,7 @@ Transform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0.145, y: -0.1631, z: -0.14898} m_LocalScale: {x: 0.25238925, y: 0.06096921, z: 0.09597992} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 879594383} m_RootOrder: 3 @@ -5977,6 +6317,13 @@ MonoBehaviour: m_DistanceCalculationMode: 1 m_SelectMode: 1 m_CustomReticle: {fileID: 0} + m_AllowGazeInteraction: 0 + m_AllowGazeSelect: 0 + m_OverrideGazeTimeToSelect: 0 + m_GazeTimeToSelect: 0.5 + m_OverrideTimeToAutoDeselectGaze: 0 + m_TimeToAutoDeselectGaze: 3 + m_AllowGazeAssistance: 0 m_FirstHoverEntered: m_PersistentCalls: m_Calls: [] @@ -6009,6 +6356,7 @@ MonoBehaviour: m_Calls: [] m_StartingHoverFilters: [] m_StartingSelectFilters: [] + m_StartingInteractionStrengthFilters: [] m_OnFirstHoverEntered: m_PersistentCalls: m_Calls: [] @@ -6152,6 +6500,7 @@ MonoBehaviour: allowSelectByVoice: 1 speechRecognitionKeyword: select k__BackingField: 1 + k__BackingField: 0 k__BackingField: active: 0 onEntered: @@ -6193,6 +6542,7 @@ MeshRenderer: m_CastShadows: 1 m_ReceiveShadows: 1 m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -6274,6 +6624,13 @@ MonoBehaviour: m_DistanceCalculationMode: 1 m_SelectMode: 1 m_CustomReticle: {fileID: 0} + m_AllowGazeInteraction: 0 + m_AllowGazeSelect: 0 + m_OverrideGazeTimeToSelect: 0 + m_GazeTimeToSelect: 0.5 + m_OverrideTimeToAutoDeselectGaze: 0 + m_TimeToAutoDeselectGaze: 3 + m_AllowGazeAssistance: 0 m_FirstHoverEntered: m_PersistentCalls: m_Calls: [] @@ -6306,6 +6663,7 @@ MonoBehaviour: m_Calls: [] m_StartingHoverFilters: [] m_StartingSelectFilters: [] + m_StartingInteractionStrengthFilters: [] m_OnFirstHoverEntered: m_PersistentCalls: m_Calls: [] @@ -6449,6 +6807,7 @@ MonoBehaviour: allowSelectByVoice: 1 speechRecognitionKeyword: select k__BackingField: 1 + k__BackingField: 0 k__BackingField: active: 0 onEntered: @@ -6490,6 +6849,7 @@ MeshRenderer: m_CastShadows: 1 m_ReceiveShadows: 1 m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -6538,6 +6898,7 @@ Transform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: -0.251, y: 0.03660001, z: -0.12100017} m_LocalScale: {x: 0.11298029, y: 0.110994965, z: 0.044128653} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1894132562} m_RootOrder: 0 diff --git a/UnityProjects/MRTKDevTemplate/Assets/Scripts/EyeCalibrationWarning.cs b/UnityProjects/MRTKDevTemplate/Assets/Scripts/EyeCalibrationWarning.cs new file mode 100644 index 00000000000..0367cfdea3f --- /dev/null +++ b/UnityProjects/MRTKDevTemplate/Assets/Scripts/EyeCalibrationWarning.cs @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +using UnityEngine; +using UnityEngine.Events; +using Microsoft.MixedReality.Toolkit.Input; +using TMPro; + +namespace Microsoft.MixedReality.Toolkit.Examples +{ + /// + /// Checks whether eyes are calibrated and prompts a notification to encourage the user to calibrate. + /// + [AddComponentMenu("MRTK/Examples/Eye Calibration Notifier")] + public class EyeCalibrationWarning : MonoBehaviour + { + [Tooltip("The EyeCalibrationChecker used to notify the user about calibration status.")] + [SerializeField] + private EyeCalibrationChecker checker; + + /// + /// The EyeCalibrationChecker used to notify the user about calibration status. + /// + public EyeCalibrationChecker Checker + { + get => checker; + set => checker = value; + } + + [Tooltip("The TMP Text used to notify the user about calibration status.")] + [SerializeField] + private TMP_Text text; + + /// + /// The TMP Text used to notify the user about calibration status. + /// + public TMP_Text Text + { + get => text; + set => text = value; + } + + private void OnEnable() + { + if (checker == null) + { + checker = GetComponent(); + } + + if (text == null) + { + text = GetComponent(); + } + + if (checker != null) + { + UpdateMessage(checker.CalibratedStatus); + checker.CalibratedStatusChanged.AddListener(UpdateMessageFromEvent); + } + } + + private void UpdateMessageFromEvent(EyeCalibrationStatusEventArgs args) + { + UpdateMessage(args.CalibratedStatus); + } + + private void UpdateMessage(EyeCalibrationStatus status) + { + string warning = "Eye Calibration Status: Not Calibrated. "; + switch (status) + { + case EyeCalibrationStatus.Unsupported: + text.text = ""; + return; + case EyeCalibrationStatus.Calibrated: + text.text = "Eye Calibration Status: Calibrated."; + text.color = Color.green; + return; + case EyeCalibrationStatus.NotCalibrated: + warning += "Please calibrate eye tracking."; + break; + case EyeCalibrationStatus.NotTracked: + warning += "Please ensure this app is granted the appropriate permissions."; + break; + default: + break; + } + text.text = warning; + text.color = Color.red; + } + } +} diff --git a/UnityProjects/MRTKDevTemplate/Assets/Scripts/EyeCalibrationWarning.cs.meta b/UnityProjects/MRTKDevTemplate/Assets/Scripts/EyeCalibrationWarning.cs.meta new file mode 100644 index 00000000000..3d33350b3d7 --- /dev/null +++ b/UnityProjects/MRTKDevTemplate/Assets/Scripts/EyeCalibrationWarning.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4af82e4e12ccef3458ece0655ea8fe0f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.microsoft.mrtk.input/Tests/Runtime/EyeCalibrationCheckerTests.cs b/com.microsoft.mrtk.input/Tests/Runtime/EyeCalibrationCheckerTests.cs new file mode 100644 index 00000000000..7eef1bedb9a --- /dev/null +++ b/com.microsoft.mrtk.input/Tests/Runtime/EyeCalibrationCheckerTests.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +using Microsoft.MixedReality.Toolkit.Core.Tests; +using Microsoft.MixedReality.Toolkit.Input.Tests; +using Microsoft.MixedReality.Toolkit.Input; +using NUnit.Framework; +using System.Collections; +using System.Threading.Tasks; +using UnityEditor; +using UnityEngine; +using UnityEngine.TestTools; +using UnityEngine.UI; + +namespace Microsoft.MixedReality.Toolkit.UX.Runtime.Tests +{ + /// + /// Tests for the EyeCalibrationChecker. + /// + public class EyeCalibrationCheckerTests : BaseRuntimeInputTests + { + private bool isCalibrated; + private EyeCalibrationStatus calibrationStatus; + + [UnityTest] + public IEnumerator TestEyeCalibrationEvents() + { + // Create an EyeCalibrationChecker and add event listeners + GameObject testButton = new GameObject("EyeCalibrationChecker"); + EyeCalibrationChecker checker = testButton.AddComponent(); + checker.Calibrated.AddListener(YesEyeCalibration); + checker.NotCalibrated.AddListener(NoEyeCalibration); + checker.CalibratedStatusChanged.AddListener(CalibrationEvent); + yield return null; + + // Test whether the events fire when the status is changed + isCalibrated = true; + checker.EditorTestIsCalibrated = EyeCalibrationStatus.Calibrated; + yield return null; + checker.EditorTestIsCalibrated = EyeCalibrationStatus.NotCalibrated; + yield return null; + Assert.IsFalse(isCalibrated, "NotCalibrated event was not fired."); + Assert.AreEqual(calibrationStatus, EyeCalibrationStatus.NotCalibrated, "CalibratedStatusChanged event was not fired."); + yield return null; + checker.EditorTestIsCalibrated = EyeCalibrationStatus.Calibrated; + yield return null; + Assert.IsTrue(isCalibrated, "Calibrated event was not fired."); + Assert.AreEqual(calibrationStatus, EyeCalibrationStatus.Calibrated, "CalibratedStatusChanged event was not fired."); + yield return null; + + checker.Calibrated.RemoveListener(NoEyeCalibration); + checker.NotCalibrated.RemoveListener(YesEyeCalibration); + checker.CalibratedStatusChanged.RemoveListener(CalibrationEvent); + } + + private void CalibrationEvent(EyeCalibrationStatusEventArgs args) + { + calibrationStatus = args.CalibratedStatus; + } + + private void YesEyeCalibration() + { + isCalibrated = true; + } + + private void NoEyeCalibration() + { + isCalibrated = false; + } + } +} diff --git a/com.microsoft.mrtk.input/Tests/Runtime/EyeCalibrationCheckerTests.cs.meta b/com.microsoft.mrtk.input/Tests/Runtime/EyeCalibrationCheckerTests.cs.meta new file mode 100644 index 00000000000..85acf792250 --- /dev/null +++ b/com.microsoft.mrtk.input/Tests/Runtime/EyeCalibrationCheckerTests.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 417412a4c83d0f544b1fe9353f111c1f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.microsoft.mrtk.input/Utilities/EyeCalibration.meta b/com.microsoft.mrtk.input/Utilities/EyeCalibration.meta new file mode 100644 index 00000000000..9eb9f48a41d --- /dev/null +++ b/com.microsoft.mrtk.input/Utilities/EyeCalibration.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 42bbbe751dece7249abea062020a50f3 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.microsoft.mrtk.input/Utilities/EyeCalibration/EyeCalibrationChecker.cs b/com.microsoft.mrtk.input/Utilities/EyeCalibration/EyeCalibrationChecker.cs new file mode 100644 index 00000000000..01085274df4 --- /dev/null +++ b/com.microsoft.mrtk.input/Utilities/EyeCalibration/EyeCalibrationChecker.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +using System; +using System.Runtime.InteropServices.WindowsRuntime; +using UnityEngine; +using UnityEngine.Events; +#if WINDOWS_UWP +using Windows.Perception; +using Windows.Perception.People; +using Windows.Perception.Spatial; +using Windows.UI.Input.Spatial; +#endif + +namespace Microsoft.MixedReality.Toolkit.Input +{ + /// + /// A helper class used to check eye calibration status. Only for UWP Platforms. + /// + [AddComponentMenu("MRTK/Input/Eye Calibration Checker")] + public class EyeCalibrationChecker : MonoBehaviour + { + #region Serialized Fields + + /// + /// For testing purposes, you can manually assign whether eyes are calibrated or not in editor. + /// + [field: SerializeField, Tooltip("For testing purposes, you can manually assign whether eyes are calibrated or not in editor.")] + public EyeCalibrationStatus EditorTestIsCalibrated = EyeCalibrationStatus.Calibrated; + + #endregion Serialized Fields + + #region Private Fields + + private EyeCalibrationStatus calibrationStatus; + + /// + /// Tracks whether eyes are present and calibrated. + /// + public EyeCalibrationStatus CalibratedStatus + { + get => calibrationStatus; + } + + private EyeCalibrationStatus prevCalibrationStatus; + private const int maxPoseAgeInSeconds = 1; + + #endregion Private Fields + + #region Events + + [SerializeField] + [Tooltip("Event fired when eye tracking is calibrated.")] + private UnityEvent calibrated = new UnityEvent(); + + /// + /// Event fired when eye tracking is calibrated. + /// + public UnityEvent Calibrated => calibrated; + + [SerializeField] + [Tooltip("Event fired when eye tracking is not calibrated.")] + private UnityEvent notCalibrated = new UnityEvent(); + + /// + /// Event fired when eye tracking is not calibrated. + /// + public UnityEvent NotCalibrated => notCalibrated; + + [SerializeField] + [Tooltip("Event fired whenever eye tracking status changes.")] + private EyeCalibrationStatusEvent calibratedStatusChanged = new EyeCalibrationStatusEvent(); + + /// + /// Event fired whenever eye tracking status changes. + /// + public EyeCalibrationStatusEvent CalibratedStatusChanged => calibratedStatusChanged; + + #endregion Events + + #region MonoBehaviour Functions + private void Update() + { + if (Application.isEditor) + { + calibrationStatus = EditorTestIsCalibrated; + } + else + { + calibrationStatus = CheckCalibrationStatus(); + } + + if (prevCalibrationStatus != calibrationStatus) + { + if (calibrationStatus == EyeCalibrationStatus.Calibrated) + { + calibrated.Invoke(); + } + else if (calibrationStatus == EyeCalibrationStatus.NotCalibrated) + { + notCalibrated.Invoke(); + } + calibratedStatusChanged.Invoke(new EyeCalibrationStatusEventArgs(calibrationStatus)); + prevCalibrationStatus = calibrationStatus; + } + } + #endregion MonoBehaviour Functions + + #region Private Functions + + private EyeCalibrationStatus CheckCalibrationStatus() + { +#if WINDOWS_UWP + if (MixedReality.OpenXR.PerceptionInterop.GetSceneCoordinateSystem(Pose.identity) is SpatialCoordinateSystem worldOrigin) + { + SpatialPointerPose pointerPose = SpatialPointerPose.TryGetAtTimestamp(worldOrigin, PerceptionTimestampHelper.FromHistoricalTargetTime(DateTimeOffset.Now)); + if (pointerPose != null) + { + EyesPose eyes = pointerPose.Eyes; + if (eyes != null) + { + // If it's been longer than a second since the last perception snapshot, assume the information has expired. + if ((DateTimeOffset.Now - eyes.UpdateTimestamp.TargetTime).TotalSeconds > maxPoseAgeInSeconds) + { + return EyeCalibrationStatus.NotCalibrated; + } + else if (eyes.IsCalibrationValid) + { + return EyeCalibrationStatus.Calibrated; + } + else + { + return EyeCalibrationStatus.NotCalibrated; + } + } + } + } + return EyeCalibrationStatus.NotTracked; +#else + return EyeCalibrationStatus.Unsupported; +#endif // WINDOWS_UWP + } + + #endregion Private Functions + } +} diff --git a/com.microsoft.mrtk.input/Utilities/EyeCalibration/EyeCalibrationChecker.cs.meta b/com.microsoft.mrtk.input/Utilities/EyeCalibration/EyeCalibrationChecker.cs.meta new file mode 100644 index 00000000000..2223743c9d0 --- /dev/null +++ b/com.microsoft.mrtk.input/Utilities/EyeCalibration/EyeCalibrationChecker.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8b0ab44b6f20884458aa9e1d5ea5cf22 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.microsoft.mrtk.input/Utilities/EyeCalibration/EyeCalibrationStatus.cs b/com.microsoft.mrtk.input/Utilities/EyeCalibration/EyeCalibrationStatus.cs new file mode 100644 index 00000000000..184ed116176 --- /dev/null +++ b/com.microsoft.mrtk.input/Utilities/EyeCalibration/EyeCalibrationStatus.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +namespace Microsoft.MixedReality.Toolkit.Input +{ + /// + /// Used to track the current eye calibration status. + /// + public enum EyeCalibrationStatus + { + /// + /// The eye calibration status is not defined. + /// + Undefined, + + /// + /// The eye calibration status could not be retrieved because this is an unsupported device. + /// + Unsupported, + + /// + /// The eye calibration status could not be retrieved because eyes are not being tracked. + /// This usually occurs when SpatialPointerPose's Eyes property is null. + /// + NotTracked, + + /// + /// The eye calibration status was retrieved and eyes are not calibrated. + /// + NotCalibrated, + + /// + /// The eye calibration status was retrieved and eyes are calibrated. + /// + Calibrated + }; +} diff --git a/com.microsoft.mrtk.input/Utilities/EyeCalibration/EyeCalibrationStatus.cs.meta b/com.microsoft.mrtk.input/Utilities/EyeCalibration/EyeCalibrationStatus.cs.meta new file mode 100644 index 00000000000..0a2696423f9 --- /dev/null +++ b/com.microsoft.mrtk.input/Utilities/EyeCalibration/EyeCalibrationStatus.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4104b1fa05eaab743aeed31282ae8ef8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.microsoft.mrtk.input/Utilities/EyeCalibration/EyeCalibrationStatusEvent.cs b/com.microsoft.mrtk.input/Utilities/EyeCalibration/EyeCalibrationStatusEvent.cs new file mode 100644 index 00000000000..bfa7456d3e4 --- /dev/null +++ b/com.microsoft.mrtk.input/Utilities/EyeCalibration/EyeCalibrationStatusEvent.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +using System; +using UnityEditor; +using UnityEngine; +using UnityEngine.Events; + +namespace Microsoft.MixedReality.Toolkit.Input +{ + /// + /// Event arguments used when eye tracking status changes. + /// + [Serializable] + public struct EyeCalibrationStatusEventArgs + { + /// + /// The eye tracking calibration status. + /// + public EyeCalibrationStatus CalibratedStatus { get; set; } + + /// + /// Constructor which sets CalibratedStatus. + /// + public EyeCalibrationStatusEventArgs(EyeCalibrationStatus calibratedStatus) + { + CalibratedStatus = calibratedStatus; + } + } + + /// + /// Event fired whenever eye tracking status changes. Passes the new status as an argument. + /// + [Serializable] + public class EyeCalibrationStatusEvent : UnityEvent { } +} \ No newline at end of file diff --git a/com.microsoft.mrtk.input/Utilities/EyeCalibration/EyeCalibrationStatusEvent.cs.meta b/com.microsoft.mrtk.input/Utilities/EyeCalibration/EyeCalibrationStatusEvent.cs.meta new file mode 100644 index 00000000000..a352e7edabb --- /dev/null +++ b/com.microsoft.mrtk.input/Utilities/EyeCalibration/EyeCalibrationStatusEvent.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4213fbf2624cc1444bcdc469e265ef9a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: