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 SpherePointer

    Inheritance
    Object
    InputSystemGlobalHandlerListener
    ControllerPoseSynchronizer
    BaseControllerPointer
    SpherePointer
    Implements
    IMixedRealityControllerPoseSynchronizer
    IMixedRealitySourcePoseHandler
    IMixedRealitySourceStateHandler
    IMixedRealityInputHandler
    IMixedRealityBaseInputHandler
    IMixedRealityInputHandler<Single>
    IMixedRealityInputHandler<Vector2>
    IMixedRealityInputHandler<Vector3>
    IMixedRealityInputHandler<Quaternion>
    IMixedRealityInputHandler<MixedRealityPose>
    IEventSystemHandler
    IMixedRealityNearPointer
    IMixedRealityPointer
    IEqualityComparer
    Inherited Members
    BaseControllerPointer.DisableCursorOnStart
    BaseControllerPointer.raycastOrigin
    BaseControllerPointer.pointerAction
    BaseControllerPointer.IsSelectPressed
    BaseControllerPointer.HasSelectPressedOnce
    BaseControllerPointer.IsHoldPressed
    BaseControllerPointer.SetCursor(GameObject)
    BaseControllerPointer.OnEnable()
    BaseControllerPointer.Start()
    BaseControllerPointer.OnDisable()
    BaseControllerPointer.Controller
    BaseControllerPointer.PointerId
    BaseControllerPointer.PointerName
    BaseControllerPointer.InputSourceParent
    BaseControllerPointer.BaseCursor
    BaseControllerPointer.CursorModifier
    BaseControllerPointer.IsActive
    BaseControllerPointer.IsFocusLocked
    BaseControllerPointer.IsTargetPositionLockedOnFocusLock
    BaseControllerPointer.PointerExtent
    BaseControllerPointer.DefaultPointerExtent
    BaseControllerPointer.Rays
    BaseControllerPointer.PrioritizedLayerMasksOverride
    BaseControllerPointer.FocusTarget
    BaseControllerPointer.Result
    BaseControllerPointer.RayStabilizer
    BaseControllerPointer.SphereCastRadius
    BaseControllerPointer.Position
    BaseControllerPointer.Rotation
    BaseControllerPointer.OnPostSceneQuery()
    BaseControllerPointer.OnPreCurrentPointerTargetChange()
    BaseControllerPointer.Reset()
    BaseControllerPointer.Equals(Object)
    BaseControllerPointer.GetHashCode()
    BaseControllerPointer.OnSourceLost(SourceStateEventData)
    BaseControllerPointer.OnInputUp(InputEventData)
    BaseControllerPointer.OnInputDown(InputEventData)
    ControllerPoseSynchronizer.Handedness
    ControllerPoseSynchronizer.DestroyOnSourceLost
    ControllerPoseSynchronizer.IsTracked
    ControllerPoseSynchronizer.TrackingState
    ControllerPoseSynchronizer.UseSourcePoseData
    ControllerPoseSynchronizer.PoseAction
    ControllerPoseSynchronizer.RegisterHandlers()
    ControllerPoseSynchronizer.UnregisterHandlers()
    ControllerPoseSynchronizer.OnSourceDetected(SourceStateEventData)
    ControllerPoseSynchronizer.OnSourcePoseChanged(SourcePoseEventData<TrackingState>)
    ControllerPoseSynchronizer.OnSourcePoseChanged(SourcePoseEventData<Vector2>)
    ControllerPoseSynchronizer.OnSourcePoseChanged(SourcePoseEventData<Vector3>)
    ControllerPoseSynchronizer.OnSourcePoseChanged(SourcePoseEventData<Quaternion>)
    ControllerPoseSynchronizer.OnSourcePoseChanged(SourcePoseEventData<MixedRealityPose>)
    ControllerPoseSynchronizer.OnInputChanged(InputEventData<Single>)
    ControllerPoseSynchronizer.OnInputChanged(InputEventData<Vector2>)
    ControllerPoseSynchronizer.OnInputChanged(InputEventData<Vector3>)
    ControllerPoseSynchronizer.OnInputChanged(InputEventData<Quaternion>)
    ControllerPoseSynchronizer.OnInputChanged(InputEventData<MixedRealityPose>)
    InputSystemGlobalHandlerListener.EnsureInputSystemValid()
    Namespace: Microsoft.MixedReality.Toolkit.Input
    Assembly: cs.temp.dll.dll
    Syntax
    public class SpherePointer : BaseControllerPointer, IMixedRealityControllerPoseSynchronizer, IMixedRealitySourcePoseHandler, IMixedRealitySourceStateHandler, IMixedRealityInputHandler, IMixedRealityBaseInputHandler, IMixedRealityInputHandler<float>, IMixedRealityInputHandler<Vector2>, IMixedRealityInputHandler<Vector3>, IMixedRealityInputHandler<Quaternion>, IMixedRealityInputHandler<MixedRealityPose>, IEventSystemHandler, IMixedRealityNearPointer, IMixedRealityPointer, IEqualityComparer

    Fields

    triggerInteraction

    Declaration
    protected QueryTriggerInteraction triggerInteraction
    Field Value
    Type Description
    QueryTriggerInteraction

    Properties

    GrabLayerMasks

    The LayerMasks, in prioritized order, that are used to determine the touchable objects.

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

    Only NearInteractionGrabbables in one of the LayerMasks will raise events.

    IgnoreCollidersNotInFOV

    Whether to ignore colliders that may be near the pointer, but not actually in the visual FOV. This can prevent accidental grabs, and will allow hand rays to turn on when you may be near a grabbable but cannot see it. Visual FOV is defined by cone centered about display center, radius equal to half display height.

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

    IsInteractionEnabled

    Test if the pointer is within the grabbable radius of collider that's both on a grabbable layer mask, and has a NearInteractionGrabbable. Uses SphereCastRadius to determine if near an object. Note: if focus on pointer is locked, will always return true.

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

    True if the pointer is within the grabbable radius of collider that's both on a grabbable layer mask, and has a NearInteractionGrabbable.

    Overrides
    BaseControllerPointer.IsInteractionEnabled

    IsNearObject

    Test if the pointer is near any collider that's both on a grabbable layer mask, and has a NearInteractionGrabbable. Uses SphereCastRadius + NearObjectMargin to determine if near an object within the sector angle Also returns true of any grabbable objects are within SphereCastRadius even if they aren't within the sector angle Ignores bounds handlers for the IsNearObject check.

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

    True if the pointer is near any collider that's both on a grabbable layer mask, and has a NearInteractionGrabbable.

    NearObjectAxisLerp

    Lerp factor between the palm direction and the index finger direction used to build the cone direction.

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

    NearObjectMargin

    Additional distance on top ofSphereCastRadius when pointer is considered 'near' an object and far interaction will turn off.

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

    This creates a dead zone in which far interaction is disabled before objects become grabbable.

    NearObjectRadius

    Distance at which the pointer is considered "near" an object.

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

    Sum of SphereCastRadius and NearObjectMargin. Entering the NearObjectRadius disables far interaction.

    NearObjectSectorAngle

    Angle range of the forward axis to query in degrees. Angle >= 360 means the entire sphere is queried.

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

    NearObjectSmoothingFactor

    Smoothing factor for query detection. If an object is detected in the NearObjectRadius, the queried radius then becomes NearObjectRadius * (1 + nearObjectSmoothingFactor) to reduce the sensitivity.

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

    PullbackDistance

    Amount to pull back the center of the sphere behind the hand for detecting when to turn off far interaction.

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

    SceneQueryBufferSize

    Maximum number of colliders that can be detected in a scene query.

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

    SceneQueryType

    The type of physics scene query to use.

    Declaration
    public override SceneQueryType SceneQueryType { get; set; }
    Property Value
    Type Description
    SceneQueryType
    Overrides
    BaseControllerPointer.SceneQueryType

    TriggerInteraction

    Specify whether queries for grabbable objects hit triggers.

    Declaration
    public QueryTriggerInteraction TriggerInteraction { get; }
    Property Value
    Type Description
    QueryTriggerInteraction

    Methods

    OnPreSceneQuery()

    Called before performing the scene query.

    Declaration
    public override void OnPreSceneQuery()
    Overrides
    BaseControllerPointer.OnPreSceneQuery()

    TryGetDistanceToNearestSurface(out Single)

    Near pointers often interact with surfaces.

    This method provides a mechanism to get the distance to the closest surface the near pointer is interacting with.

    Declaration
    public bool TryGetDistanceToNearestSurface(out float distance)
    Parameters
    Type Name Description
    Single distance

    Out parameter filled with the distance along the surface normal from the surface to the pointer if available, otherwise 0.0f.

    Returns
    Type Description
    Boolean

    True if a distance was retrieved, false if not.

    TryGetNearGraspPoint(out Vector3)

    Gets the position of where grasp happens For IMixedRealityHand it's the average of index and thumb. For any other IMixedRealityController, return just the pointer origin

    Declaration
    public bool TryGetNearGraspPoint(out Vector3 result)
    Parameters
    Type Name Description
    Vector3 result
    Returns
    Type Description
    Boolean

    TryGetNormalToNearestSurface(out Vector3)

    Near pointers often interact with surfaces.

    This method provides a mechanism to get the normal of the closest surface the near pointer is interacting with.

    Declaration
    public bool TryGetNormalToNearestSurface(out Vector3 normal)
    Parameters
    Type Name Description
    Vector3 normal

    Out parameter filled with the surface normal if available, otherwise Vector3.zero.

    Returns
    Type Description
    Boolean

    True if a normal was retrieved, false if not.

    Implements

    IMixedRealityControllerPoseSynchronizer
    IMixedRealitySourcePoseHandler
    IMixedRealitySourceStateHandler
    IMixedRealityInputHandler
    IMixedRealityBaseInputHandler
    IMixedRealityInputHandler<T>
    IMixedRealityInputHandler<T>
    IMixedRealityInputHandler<T>
    IMixedRealityInputHandler<T>
    IMixedRealityInputHandler<T>
    IEventSystemHandler
    IMixedRealityNearPointer
    IMixedRealityPointer
    IEqualityComparer
    In This Article
    • Fields
      • triggerInteraction
    • Properties
      • GrabLayerMasks
      • IgnoreCollidersNotInFOV
      • IsInteractionEnabled
      • IsNearObject
      • NearObjectAxisLerp
      • NearObjectMargin
      • NearObjectRadius
      • NearObjectSectorAngle
      • NearObjectSmoothingFactor
      • PullbackDistance
      • SceneQueryBufferSize
      • SceneQueryType
      • TriggerInteraction
    • Methods
      • OnPreSceneQuery()
      • TryGetDistanceToNearestSurface(out Single)
      • TryGetNearGraspPoint(out Vector3)
      • TryGetNormalToNearestSurface(out Vector3)
    • Implements
    Back to top Generated by DocFX