File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Assets/MRTK/Providers/WindowsMixedReality/XRSDK Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -129,6 +129,7 @@ public override void Update()
129
129
centerEye = InputDevices . GetDeviceAtXRNode ( XRNode . CenterEye ) ;
130
130
if ( ! centerEye . isValid )
131
131
{
132
+ Service ? . EyeGazeProvider ? . UpdateEyeTrackingStatus ( this , false ) ;
132
133
return ;
133
134
}
134
135
}
@@ -141,11 +142,15 @@ public override void Update()
141
142
142
143
Service ? . EyeGazeProvider ? . UpdateEyeTrackingStatus ( this , true ) ;
143
144
144
- if ( centerEye . TryGetFeatureValue ( WindowsMRUsages . EyeGazeTracked , out bool gazeTracked ) && gazeTracked
145
+ if ( centerEye . TryGetFeatureValue ( WindowsMRUsages . EyeGazeTracked , out bool gazeTracked )
146
+ && gazeTracked
145
147
&& centerEye . TryGetFeatureValue ( WindowsMRUsages . EyeGazePosition , out Vector3 eyeGazePosition )
146
148
&& centerEye . TryGetFeatureValue ( WindowsMRUsages . EyeGazeRotation , out Quaternion eyeGazeRotation ) )
147
149
{
148
- Ray newGaze = new Ray ( eyeGazePosition , eyeGazeRotation * Vector3 . forward ) ;
150
+ Vector3 worldPosition = MixedRealityPlayspace . TransformPoint ( eyeGazePosition ) ;
151
+ Vector3 worldRotation = MixedRealityPlayspace . TransformDirection ( eyeGazeRotation * Vector3 . forward ) ;
152
+
153
+ Ray newGaze = new Ray ( worldPosition , worldRotation ) ;
149
154
150
155
if ( SmoothEyeTracking )
151
156
{
You can’t perform that action at this time.
0 commit comments