Editar

Compartilhar via


GazeProvider Class

Definition

This class provides Gaze as an Input Source so users can interact with objects using their head.

public ref class GazeProvider : Microsoft::MixedReality::Toolkit::Input::InputSystemGlobalHandlerListener, Microsoft::MixedReality::Toolkit::Input::IMixedRealityEyeGazeProvider, Microsoft::MixedReality::Toolkit::Input::IMixedRealityGazeProviderHeadOverride, Microsoft::MixedReality::Toolkit::Input::IMixedRealityInputHandler, UnityEngine::EventSystems::IEventSystemHandler
[UnityEngine.AddComponentMenu("Scripts/MRTK/Services/GazeProvider")]
[UnityEngine.DisallowMultipleComponent]
public class GazeProvider : Microsoft.MixedReality.Toolkit.Input.InputSystemGlobalHandlerListener, Microsoft.MixedReality.Toolkit.Input.IMixedRealityEyeGazeProvider, Microsoft.MixedReality.Toolkit.Input.IMixedRealityGazeProviderHeadOverride, Microsoft.MixedReality.Toolkit.Input.IMixedRealityInputHandler, UnityEngine.EventSystems.IEventSystemHandler
[<UnityEngine.AddComponentMenu("Scripts/MRTK/Services/GazeProvider")>]
[<UnityEngine.DisallowMultipleComponent>]
type GazeProvider = class
    inherit InputSystemGlobalHandlerListener
    interface IMixedRealityGazeProvider
    interface IMixedRealityGazeProviderHeadOverride
    interface IMixedRealityEyeGazeProvider
    interface IMixedRealityInputHandler
    interface IMixedRealityBaseInputHandler
    interface IEventSystemHandler
[<UnityEngine.AddComponentMenu("Scripts/MRTK/Services/GazeProvider")>]
[<UnityEngine.DisallowMultipleComponent>]
type GazeProvider = class
    inherit InputSystemGlobalHandlerListener
    interface IMixedRealityGazeProviderHeadOverride
    interface IMixedRealityEyeGazeProvider
    interface IMixedRealityGazeProvider
    interface IMixedRealityInputHandler
    interface IMixedRealityBaseInputHandler
    interface IEventSystemHandler
Public Class GazeProvider
Inherits InputSystemGlobalHandlerListener
Implements IEventSystemHandler, IMixedRealityEyeGazeProvider, IMixedRealityGazeProviderHeadOverride, IMixedRealityInputHandler
Inheritance
UnityEngine.MonoBehaviour
GazeProvider
Derived
Attributes
UnityEngine.AddComponentMenuAttribute UnityEngine.DisallowMultipleComponentAttribute
Implements

Constructors

GazeProvider()

Properties

Enabled

Enable or disable the Component attached to the GameObjectReference

GameObjectReference

Get the GameObject reference for this Gaze Provider.

GazeCursor

The Gaze Cursor for the provider.

GazeCursorPrefab

The prefab to be instantiated as the gaze cursor.

GazeDirection

Normal of the gaze.

GazeInputSource

The Gaze Input Source for the provider.

GazeOrigin

Origin of the gaze.

GazePointer

The Gaze Pointer for the provider.

GazeTarget

The game object that is currently being gazed at, if any.

HeadMovementDirection

The current head movement direction.

HeadVelocity

The current head velocity.

HitInfo

HitInfo property gives access to information at the object being gazed at, if any.

HitNormal

Normal of the point at which the gaze manager hit an object. If no object is currently being hit, this will return the previous normal.

HitPosition

Position at which the gaze manager hit an object. If no object is currently being hit, this will use the last hit distance.

IsEyeCalibrationValid

Whether the user is eye calibrated. It returns 'null', if the value has not yet received data from the eye tracking system.

IsEyeTrackingDataValid

Whether eye tracking data is available. It may be unavailable due to timeout or lack of tracking hardware or permissions.

IsEyeTrackingEnabled

If true, eye-based tracking will be used when available. This field does not control whether eye tracking data is provided.

IsEyeTrackingEnabledAndValid

Whether eye tracking data is currently been used for gaze rather then head pose. Eye Tracking must be both enabled and have valid data.

LatestEyeGaze

The most recent eye tracking ray

overrideHeadForward
overrideHeadPosition
Timestamp

DateTime in UTC when the signal was last updated.

UseHeadGazeOverride

If true, platform-specific head gaze override is used, when available. Otherwise, the center of the camera frame is used by default.

Methods

EnsureInputSystemValid()

A task that will only complete when the input system has in a valid state.

(Inherited from InputSystemGlobalHandlerListener)
OnDisable() UnityEngine.MonoBehaviour.OnDisable
OnEnable() UnityEngine.MonoBehaviour.OnEnable
OnInputDown(InputEventData)
OnInputUp(InputEventData)
OverrideHeadGaze(Vector3, Vector3)

Allows head gaze to be overridden, typically by platform-specific values.

RegisterHandlers()

Overload this method to specify, which global events component wants to listen to. Use RegisterHandler API of InputSystem

SetGazeCursor(GameObject)

Set the gaze cursor.

Start() UnityEngine.MonoBehaviour.Start
UnregisterHandlers()

Overload this method to specify, which global events component should stop listening to. Use UnregisterHandler API of InputSystem

UpdateEyeGaze(IMixedRealityEyeGazeDataProvider, Ray, DateTime)

Tells the eye gaze provider that eye gaze has updated.

UpdateEyeTrackingStatus(IMixedRealityEyeGazeDataProvider, Boolean)

Tells the eye gaze provider about the eye tracking status (e.g., whether the user is calibrated);

UpdateGazeInfoFromHit(MixedRealityRaycastHit)

Notifies this gaze provider of its new hit details.

Applies to