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

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.

Search Results for

    Show / Hide Table of Contents

    Class BaseCursor

    Object that represents a cursor in 3D space.

    Inheritance
    Object
    BaseCursor
    AnimatedCursor
    FingerCursor
    InteractiveMeshCursor
    MeshCursor
    ObjectCursor
    SpriteCursor
    Implements
    IMixedRealityCursor
    IMixedRealityFocusChangedHandler
    IMixedRealitySourceStateHandler
    IMixedRealityPointerHandler
    IEventSystemHandler
    Namespace: Microsoft.MixedReality.Toolkit.Input
    Assembly: cs.temp.dll.dll
    Syntax
    public class BaseCursor : MonoBehaviour, IMixedRealityCursor, IMixedRealityFocusChangedHandler, IMixedRealitySourceStateHandler, IMixedRealityPointerHandler, IEventSystemHandler

    Fields

    PrimaryCursorVisual

    Declaration
    protected Transform PrimaryCursorVisual
    Field Value
    Type Description
    Transform

    SourceDownIds

    Declaration
    public List<uint> SourceDownIds
    Field Value
    Type Description
    List<UInt32>

    TargetedObject

    Declaration
    protected GameObject TargetedObject
    Field Value
    Type Description
    GameObject

    targetPosition

    Declaration
    protected Vector3 targetPosition
    Field Value
    Type Description
    Vector3

    targetRotation

    Declaration
    protected Quaternion targetRotation
    Field Value
    Type Description
    Quaternion

    targetScale

    Declaration
    protected Vector3 targetScale
    Field Value
    Type Description
    Vector3

    Properties

    CursorAngularScale

    The angular scale of cursor in relation to Main Camera, assuming a mesh with bounds of Vector3(1,1,1)

    Declaration
    [Obsolete("Property obsolete. Use CursorAngularSize instead")]
    public float CursorAngularScale { get; set; }
    Property Value
    Type Description
    Single

    CursorAngularSize

    The angular size of cursor in relation to Main Camera, assuming a mesh with bounds of Vector3(1,1,1)

    Declaration
    public float CursorAngularSize { get; set; }
    Property Value
    Type Description
    Single

    CursorContext

    Declaration
    public CursorContextEnum CursorContext { get; }
    Property Value
    Type Description
    CursorContextEnum

    CursorState

    Declaration
    public CursorStateEnum CursorState { get; }
    Property Value
    Type Description
    CursorStateEnum

    DefaultCursorDistance

    The maximum distance the cursor can be with nothing hit

    Declaration
    public float DefaultCursorDistance { get; set; }
    Property Value
    Type Description
    Single

    GameObjectReference

    Returns the IMixedRealityCursor's GameObject reference.

    Declaration
    public GameObject GameObjectReference { get; }
    Property Value
    Type Description
    GameObject

    The GameObject this IMixedRealityCursor component is attached to.

    IsPointerDown

    Declaration
    public bool IsPointerDown { get; }
    Property Value
    Type Description
    Boolean

    IsPointerValid

    Checks whether the associated pointer is null, and if the pointer is a UnityEngine.Object it also checks whether it has been destroyed.

    Declaration
    protected bool IsPointerValid { get; }
    Property Value
    Type Description
    Boolean

    IsSourceDetected

    Declaration
    protected bool IsSourceDetected { get; }
    Property Value
    Type Description
    Boolean

    IsVisible

    Is the cursor currently visible?

    Declaration
    public bool IsVisible { get; }
    Property Value
    Type Description
    Boolean

    LocalScale

    Local scale of the IMixedRealityCursor.

    Declaration
    public virtual Vector3 LocalScale { get; }
    Property Value
    Type Description
    Vector3

    LookRotationBlend

    Blend value for surface normal to user facing lerp.

    Declaration
    public float LookRotationBlend { get; set; }
    Property Value
    Type Description
    Single

    Pointer

    The IMixedRealityPointer this IMixedRealityCursor is associated with.

    Declaration
    public virtual IMixedRealityPointer Pointer { get; set; }
    Property Value
    Type Description
    IMixedRealityPointer

    Position

    Position of the IMixedRealityCursor.

    Declaration
    public virtual Vector3 Position { get; }
    Property Value
    Type Description
    Vector3

    PositionLerpTime

    Blend value for surface normal to user facing lerp.

    Declaration
    public float PositionLerpTime { get; set; }
    Property Value
    Type Description
    Single

    ResizeCursorWithDistance

    Dictates whether the cursor should resize based on distance. If true, cursor will appear to be the same size no matter what distance it is from Main Camera.

    Declaration
    public bool ResizeCursorWithDistance { get; set; }
    Property Value
    Type Description
    Boolean

    Rotation

    Rotation of the IMixedRealityCursor.

    Declaration
    public virtual Quaternion Rotation { get; }
    Property Value
    Type Description
    Quaternion

    RotationLerpTime

    Blend value for surface normal to user facing lerp.

    Declaration
    public float RotationLerpTime { get; set; }
    Property Value
    Type Description
    Single

    ScaleLerpTime

    Blend value for surface normal to user facing lerp.

    Declaration
    public float ScaleLerpTime { get; set; }
    Property Value
    Type Description
    Single

    SetVisibilityOnSourceDetected

    Sets the visibility of the IMixedRealityCursor when the source is detected.

    Declaration
    public bool SetVisibilityOnSourceDetected { get; set; }
    Property Value
    Type Description
    Boolean

    SurfaceCursorDistance

    Declaration
    public float SurfaceCursorDistance { get; }
    Property Value
    Type Description
    Single

    UseUnscaledTime

    When lerping, use unscaled time. This is useful for games that have a pause mechanism or otherwise adjust the game timescale.

    Declaration
    public bool UseUnscaledTime { get; set; }
    Property Value
    Type Description
    Boolean

    VisibleSourcesCount

    Declaration
    public uint VisibleSourcesCount { get; set; }
    Property Value
    Type Description
    UInt32

    Methods

    CheckCursorContext()

    Virtual function for checking cursor context changes.

    Declaration
    public virtual CursorContextEnum CheckCursorContext()
    Returns
    Type Description
    CursorContextEnum

    CheckCursorState()

    Virtual function for checking state changes.

    Declaration
    public virtual CursorStateEnum CheckCursorState()
    Returns
    Type Description
    CursorStateEnum

    Destroy()

    Utility method to destroy cursor dependencies (e.g. event subscriptions) in the system explicitly in the middle update loop. This is a "replacement" of Unity OnDestroy. Relying on Unity OnDestroy may cause event handler subscription to become invalid at the point of destroying.

    Declaration
    public virtual void Destroy()

    LerpToTargetTransform()

    Declaration
    protected void LerpToTargetTransform()

    OnBeforeFocusChange(FocusEventData)

    Focus event that is raised before the focus is actually changed.

    Declaration
    public virtual void OnBeforeFocusChange(FocusEventData eventData)
    Parameters
    Type Name Description
    FocusEventData eventData
    Remarks

    Useful for logic that needs to take place before focus changes.

    OnCursorContextChange(CursorContextEnum)

    Change the cursor context state to the new context. Override in cursor implementations.

    Declaration
    public virtual void OnCursorContextChange(CursorContextEnum context)
    Parameters
    Type Name Description
    CursorContextEnum context

    OnCursorStateChange(CursorStateEnum)

    Change the cursor state to the new state. Override in cursor implementations.

    Declaration
    public virtual void OnCursorStateChange(CursorStateEnum state)
    Parameters
    Type Name Description
    CursorStateEnum state

    OnDisable()

    Declaration
    protected virtual void OnDisable()

    OnEnable()

    Declaration
    protected virtual void OnEnable()

    OnFocusChanged(FocusEventData)

    Focus event that is raised when the focused object is changed.

    Declaration
    public virtual void OnFocusChanged(FocusEventData eventData)
    Parameters
    Type Name Description
    FocusEventData eventData

    OnInputDisabled()

    Disable input and set to contextual to override input

    Declaration
    public virtual void OnInputDisabled()

    OnInputEnabled()

    Enable input and set to none to reset cursor

    Declaration
    public virtual void OnInputEnabled()

    OnPointerClicked(MixedRealityPointerEventData)

    When a pointer clicked event is raised, this method is used to pass along the event data to the input handler.

    Declaration
    public virtual void OnPointerClicked(MixedRealityPointerEventData eventData)
    Parameters
    Type Name Description
    MixedRealityPointerEventData eventData

    OnPointerDown(MixedRealityPointerEventData)

    When a pointer down event is raised, this method is used to pass along the event data to the input handler.

    Declaration
    public virtual void OnPointerDown(MixedRealityPointerEventData eventData)
    Parameters
    Type Name Description
    MixedRealityPointerEventData eventData

    OnPointerDragged(MixedRealityPointerEventData)

    Called every frame a pointer is down. Can be used to implement drag-like behaviors.

    Declaration
    public virtual void OnPointerDragged(MixedRealityPointerEventData eventData)
    Parameters
    Type Name Description
    MixedRealityPointerEventData eventData

    OnPointerUp(MixedRealityPointerEventData)

    When a pointer up event is raised, this method is used to pass along the event data to the input handler.

    Declaration
    public virtual void OnPointerUp(MixedRealityPointerEventData eventData)
    Parameters
    Type Name Description
    MixedRealityPointerEventData eventData

    OnSourceDetected(SourceStateEventData)

    Raised when a source is detected.

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

    OnSourceLost(SourceStateEventData)

    Raised when a source is lost.

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

    RegisterManagers()

    Register to events from the managers the cursor needs.

    Declaration
    protected virtual void RegisterManagers()

    SetVisibility(Boolean)

    Declaration
    public virtual void SetVisibility(bool visible)
    Parameters
    Type Name Description
    Boolean visible

    SnapToTargetTransform()

    Declaration
    protected void SnapToTargetTransform()

    Start()

    Declaration
    protected virtual void Start()

    UnregisterManagers()

    Unregister from events from the managers the cursor needs.

    Declaration
    protected virtual void UnregisterManagers()

    UpdateCursorTransform()

    Update the cursor's transform

    Declaration
    protected virtual void UpdateCursorTransform()

    Implements

    IMixedRealityCursor
    IMixedRealityFocusChangedHandler
    IMixedRealitySourceStateHandler
    IMixedRealityPointerHandler
    IEventSystemHandler
    In This Article
    • Fields
      • PrimaryCursorVisual
      • SourceDownIds
      • TargetedObject
      • targetPosition
      • targetRotation
      • targetScale
    • Properties
      • CursorAngularScale
      • CursorAngularSize
      • CursorContext
      • CursorState
      • DefaultCursorDistance
      • GameObjectReference
      • IsPointerDown
      • IsPointerValid
      • IsSourceDetected
      • IsVisible
      • LocalScale
      • LookRotationBlend
      • Pointer
      • Position
      • PositionLerpTime
      • ResizeCursorWithDistance
      • Rotation
      • RotationLerpTime
      • ScaleLerpTime
      • SetVisibilityOnSourceDetected
      • SurfaceCursorDistance
      • UseUnscaledTime
      • VisibleSourcesCount
    • Methods
      • CheckCursorContext()
      • CheckCursorState()
      • Destroy()
      • LerpToTargetTransform()
      • OnBeforeFocusChange(FocusEventData)
      • OnCursorContextChange(CursorContextEnum)
      • OnCursorStateChange(CursorStateEnum)
      • OnDisable()
      • OnEnable()
      • OnFocusChanged(FocusEventData)
      • OnInputDisabled()
      • OnInputEnabled()
      • OnPointerClicked(MixedRealityPointerEventData)
      • OnPointerDown(MixedRealityPointerEventData)
      • OnPointerDragged(MixedRealityPointerEventData)
      • OnPointerUp(MixedRealityPointerEventData)
      • OnSourceDetected(SourceStateEventData)
      • OnSourceLost(SourceStateEventData)
      • RegisterManagers()
      • SetVisibility(Boolean)
      • SnapToTargetTransform()
      • Start()
      • UnregisterManagers()
      • UpdateCursorTransform()
    • Implements
    Back to top Generated by DocFX