mrtk_developmentreleases/2.0.0releases/2.1.0releases/2.2.0releases/2.3.0releases/2.4.0releases/2.5.0releases/2.5.1releases/2.5.2releases/2.5.3
  • Features and Architecture
  • API Documentation

We've moved!

Starting from MRTK 2.6, we are publishing both conceptual docs and API references on docs.microsoft.com. For conceptual docs, please visit our new landing page. For API references, please visit the MRTK-Unity section of the dot net API explorer. Existing content will remain here but will not be updated further.

  • API Documentation
Search Results for

    Show / Hide Table of Contents

    Class FocusProvider

    The focus provider handles the focused objects per input source.

    Inheritance
    Object
    BaseService
    BaseEventSystem
    BaseCoreSystem
    FocusProvider
    Implements
    IMixedRealityEventSystem
    IMixedRealityFocusProvider
    IMixedRealityService
    IDisposable
    IMixedRealitySourceStateHandler
    IMixedRealitySpeechHandler
    IMixedRealityBaseInputHandler
    IEventSystemHandler
    IPointerPreferences
    Inherited Members
    BaseCoreSystem.Registrar
    BaseEventSystem.enableDanglingHandlerDiagnostics
    BaseEventSystem.EventHandlersByType
    BaseEventSystem.EventListeners
    BaseEventSystem.HandleEvent<T>(BaseEventData, ExecuteEvents.EventFunction<T>)
    BaseEventSystem.RegisterHandler<T>(IEventSystemHandler)
    BaseEventSystem.UnregisterHandler<T>(IEventSystemHandler)
    BaseEventSystem.Register(GameObject)
    BaseEventSystem.Unregister(GameObject)
    BaseService.DefaultPriority
    BaseService.ConfigurationProfile
    BaseService.Reset()
    BaseService.Enable()
    BaseService.LateUpdate()
    BaseService.Disable()
    BaseService.disposed
    BaseService.Dispose()
    BaseService.Dispose(Boolean)
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Microsoft.MixedReality.Toolkit.Input
    Assembly: cs.temp.dll.dll
    Syntax
    public class FocusProvider : BaseCoreSystem, IMixedRealityEventSystem, IMixedRealityFocusProvider, IMixedRealityService, IDisposable, IMixedRealitySourceStateHandler, IMixedRealitySpeechHandler, IMixedRealityBaseInputHandler, IEventSystemHandler, IPointerPreferences
    Remarks

    There are convenience properties for getting only Gaze Pointer if needed.

    Constructors

    FocusProvider(IMixedRealityServiceRegistrar, MixedRealityInputSystemProfile)

    Constructor.

    Declaration
    [Obsolete("This constructor is obsolete (registrar parameter is no longer required) and will be removed in a future version of the Microsoft Mixed Reality Toolkit.")]
    public FocusProvider(IMixedRealityServiceRegistrar registrar, MixedRealityInputSystemProfile profile)
    Parameters
    Type Name Description
    IMixedRealityServiceRegistrar registrar

    The IMixedRealityServiceRegistrar instance that loaded the service.

    MixedRealityInputSystemProfile profile

    The configuration profile for the service.

    FocusProvider(MixedRealityInputSystemProfile)

    Constructor.

    Declaration
    public FocusProvider(MixedRealityInputSystemProfile profile)
    Parameters
    Type Name Description
    MixedRealityInputSystemProfile profile

    The configuration profile for the service.

    Properties

    FocusLayerMasks

    The layer masks for the focus pointers to raycast against.

    Declaration
    public LayerMask[] FocusLayerMasks { get; }
    Property Value
    Type Description
    LayerMask[]

    GazePointerBehavior

    Pointer behavior for the gaze pointer. We make gaze pointer unique because the internal gaze pointer actually cannot be referenced from here since it's an internal class.

    Declaration
    public PointerBehavior GazePointerBehavior { get; set; }
    Property Value
    Type Description
    PointerBehavior

    Name

    Optional Priority attribute if multiple services of the same type are required, enables targeting a service for action.

    Declaration
    public override string Name { get; protected set; }
    Property Value
    Type Description
    String
    Overrides
    BaseService.Name

    NumFarPointersActive

    The number of pointers that support far interaction (like motion controller rays, hand rays) that are active (IsInteractionEnabled == true), excluding the gaze cursor

    Declaration
    public int NumFarPointersActive { get; }
    Property Value
    Type Description
    Int32

    NumNearPointersActive

    Number of IMixedRealityNearPointers that are active (IsInteractionEnabled == true).

    Declaration
    public int NumNearPointersActive { get; }
    Property Value
    Type Description
    Int32

    PointerMediators

    Declaration
    public IReadOnlyDictionary<uint, IMixedRealityPointerMediator> PointerMediators { get; }
    Property Value
    Type Description
    IReadOnlyDictionary<UInt32, IMixedRealityPointerMediator>

    PrimaryPointer

    Declaration
    public IMixedRealityPointer PrimaryPointer { get; }
    Property Value
    Type Description
    IMixedRealityPointer

    Priority

    Optional Priority to reorder registered managers based on their respective priority, reduces the risk of race conditions by prioritizing the order in which managers are evaluated.

    Declaration
    public override uint Priority { get; }
    Property Value
    Type Description
    UInt32
    Overrides
    BaseService.Priority

    UIRaycastCamera

    The Camera the EventSystem uses to raycast against.

    Declaration
    public Camera UIRaycastCamera { get; }
    Property Value
    Type Description
    Camera
    Remarks

    Every uGUI canvas in your scene should use this camera as its event camera.

    Methods

    Destroy()

    Optional Destroy function to perform cleanup of the service before the Mixed Reality Toolkit is destroyed.

    Declaration
    public override void Destroy()
    Overrides
    BaseEventSystem.Destroy()

    GenerateNewPointerId()

    Generate a new unique pointer id.

    Declaration
    public uint GenerateNewPointerId()
    Returns
    Type Description
    UInt32

    GetFocusedObject(IMixedRealityPointer)

    Gets the currently focused object for the pointing source.

    Declaration
    public GameObject GetFocusedObject(IMixedRealityPointer pointingSource)
    Parameters
    Type Name Description
    IMixedRealityPointer pointingSource
    Returns
    Type Description
    GameObject

    Currently Focused Object.

    Remarks

    If the pointing source is not registered, then the Gaze's Focused GameObject is returned.

    GetPointerBehavior(IMixedRealityPointer)

    Gets the PointerBehavior for a given pointer

    Declaration
    public PointerBehavior GetPointerBehavior(IMixedRealityPointer pointer)
    Parameters
    Type Name Description
    IMixedRealityPointer pointer
    Returns
    Type Description
    PointerBehavior

    GetPointerBehavior<T>(Handedness, InputSourceType)

    Gets the behavior for the given pointer type.

    Declaration
    public PointerBehavior GetPointerBehavior<T>(Handedness handedness, InputSourceType sourceType)
        where T : class, IMixedRealityPointer
    Parameters
    Type Name Description
    Handedness handedness

    Handedness to query

    InputSourceType sourceType
    Returns
    Type Description
    PointerBehavior

    PointerBehavior for the given pointer type and handedness. If right hand is enabled, left hand is not enabled, and Handedness.Any is passed, returns value for the right hand.

    Type Parameters
    Name Description
    T

    GetPointers<T>()

    Provides access to all registered pointers of a specified type.

    Declaration
    public IEnumerable<T> GetPointers<T>()
        where T : class, IMixedRealityPointer
    Returns
    Type Description
    IEnumerable<T>
    Type Parameters
    Name Description
    T

    The type of pointers to request. Use IMixedRealityPointer to access all pointers.

    Initialize()

    The initialize function is used to setup the service once created. This method is called once all services have been registered in the Mixed Reality Toolkit.

    Declaration
    public override void Initialize()
    Overrides
    BaseService.Initialize()

    IsPointerRegistered(IMixedRealityPointer)

    Checks if the pointer is registered with the Focus Manager.

    Declaration
    public bool IsPointerRegistered(IMixedRealityPointer pointer)
    Parameters
    Type Name Description
    IMixedRealityPointer pointer
    Returns
    Type Description
    Boolean

    True, if registered, otherwise false.

    OnSourceDetected(SourceStateEventData)

    Raised when a source is detected.

    Declaration
    public void OnSourceDetected(SourceStateEventData eventData)
    Parameters
    Type Name Description
    SourceStateEventData eventData

    OnSourceLost(SourceStateEventData)

    Raised when a source is lost.

    Declaration
    public void OnSourceLost(SourceStateEventData eventData)
    Parameters
    Type Name Description
    SourceStateEventData eventData

    OnSpeechKeywordRecognized(SpeechEventData)

    Declaration
    public void OnSpeechKeywordRecognized(SpeechEventData eventData)
    Parameters
    Type Name Description
    SpeechEventData eventData

    RegisterPointer(IMixedRealityPointer)

    Registers the pointer with the Focus Manager.

    Declaration
    public bool RegisterPointer(IMixedRealityPointer pointer)
    Parameters
    Type Name Description
    IMixedRealityPointer pointer
    Returns
    Type Description
    Boolean

    True, if the pointer was registered, false if the pointer was previously registered.

    SetPointerBehavior<T>(Handedness, InputSourceType, PointerBehavior)

    Sets the PointerBehavior for a given pointer type, handedness, and input type

    Declaration
    public void SetPointerBehavior<T>(Handedness handedness, InputSourceType inputType, PointerBehavior pointerBehavior)
        where T : class, IMixedRealityPointer
    Parameters
    Type Name Description
    Handedness handedness

    Specify Handedness.Any to apply to all handedness, or specify a specific handedness to just disable, right, left.

    InputSourceType inputType
    PointerBehavior pointerBehavior
    Type Parameters
    Name Description
    T

    All pointers that are of this type, or a subclass of this type, will have the given behavior

    SubscribeToPrimaryPointerChanged(PrimaryPointerChangedHandler, Boolean)

    Declaration
    public void SubscribeToPrimaryPointerChanged(PrimaryPointerChangedHandler handler, bool invokeHandlerWithCurrentPointer)
    Parameters
    Type Name Description
    PrimaryPointerChangedHandler handler
    Boolean invokeHandlerWithCurrentPointer

    TryGetFocusDetails(IMixedRealityPointer, out FocusDetails)

    Gets the currently focused object for the pointing source.

    Declaration
    public bool TryGetFocusDetails(IMixedRealityPointer pointer, out FocusDetails focusDetails)
    Parameters
    Type Name Description
    IMixedRealityPointer pointer
    FocusDetails focusDetails
    Returns
    Type Description
    Boolean

    TryOverrideFocusDetails(IMixedRealityPointer, FocusDetails)

    Sets the FocusDetails of the specified pointer, overriding the focus point that was currently set. This can be used to change the FocusDetails of a specific pointer even if focus is locked.

    Declaration
    public bool TryOverrideFocusDetails(IMixedRealityPointer pointer, FocusDetails focusDetails)
    Parameters
    Type Name Description
    IMixedRealityPointer pointer
    FocusDetails focusDetails
    Returns
    Type Description
    Boolean

    True if the FocusDetails were set successfully. False if the pointer is not associated with the FocusProvider.

    UnregisterPointer(IMixedRealityPointer)

    Unregisters the pointer with the Focus Manager.

    Declaration
    public bool UnregisterPointer(IMixedRealityPointer pointer)
    Parameters
    Type Name Description
    IMixedRealityPointer pointer
    Returns
    Type Description
    Boolean

    True, if the pointer was unregistered, false if the pointer was not registered.

    UnsubscribeFromPrimaryPointerChanged(PrimaryPointerChangedHandler)

    Declaration
    public void UnsubscribeFromPrimaryPointerChanged(PrimaryPointerChangedHandler handler)
    Parameters
    Type Name Description
    PrimaryPointerChangedHandler handler

    Update()

    Optional Update function to perform per-frame updates of the service.

    Declaration
    public override void Update()
    Overrides
    BaseService.Update()

    Explicit Interface Implementations

    IMixedRealityFocusProvider.GlobalPointingExtent

    Maximum distance at which all pointers can collide with a GameObject, unless it has an override extent.

    Declaration
    float IMixedRealityFocusProvider.GlobalPointingExtent { get; }
    Returns
    Type Description
    Single

    Implements

    IMixedRealityEventSystem
    IMixedRealityFocusProvider
    IMixedRealityService
    System.IDisposable
    IMixedRealitySourceStateHandler
    IMixedRealitySpeechHandler
    IMixedRealityBaseInputHandler
    IEventSystemHandler
    IPointerPreferences
    In This Article
    • Constructors
      • FocusProvider(IMixedRealityServiceRegistrar, MixedRealityInputSystemProfile)
      • FocusProvider(MixedRealityInputSystemProfile)
    • Properties
      • FocusLayerMasks
      • GazePointerBehavior
      • Name
      • NumFarPointersActive
      • NumNearPointersActive
      • PointerMediators
      • PrimaryPointer
      • Priority
      • UIRaycastCamera
    • Methods
      • Destroy()
      • GenerateNewPointerId()
      • GetFocusedObject(IMixedRealityPointer)
      • GetPointerBehavior(IMixedRealityPointer)
      • GetPointerBehavior<T>(Handedness, InputSourceType)
      • GetPointers<T>()
      • Initialize()
      • IsPointerRegistered(IMixedRealityPointer)
      • OnSourceDetected(SourceStateEventData)
      • OnSourceLost(SourceStateEventData)
      • OnSpeechKeywordRecognized(SpeechEventData)
      • RegisterPointer(IMixedRealityPointer)
      • SetPointerBehavior<T>(Handedness, InputSourceType, PointerBehavior)
      • SubscribeToPrimaryPointerChanged(PrimaryPointerChangedHandler, Boolean)
      • TryGetFocusDetails(IMixedRealityPointer, out FocusDetails)
      • TryOverrideFocusDetails(IMixedRealityPointer, FocusDetails)
      • UnregisterPointer(IMixedRealityPointer)
      • UnsubscribeFromPrimaryPointerChanged(PrimaryPointerChangedHandler)
      • Update()
    • Explicit Interface Implementations
      • IMixedRealityFocusProvider.GlobalPointingExtent
    • Implements
    Back to top Generated by DocFX