日本語翻訳ドキュメントはサポートを終了しました

MRTK 2.6 以降のドキュメントについては、公式の Microsoft ドキュメント を参照してください。

    Show / Hide Table of Contents

    Class PokePointer

    A near interaction pointer that generates touch events based on touchables in close proximity.

    Inheritance
    Object
    InputSystemGlobalHandlerListener
    ControllerPoseSynchronizer
    BaseControllerPointer
    PokePointer
    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.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.SceneQueryType
    BaseControllerPointer.SphereCastRadius
    BaseControllerPointer.Position
    BaseControllerPointer.Rotation
    BaseControllerPointer.Reset()
    BaseControllerPointer.Equals(Object)
    BaseControllerPointer.GetHashCode()
    ControllerPoseSynchronizer.Handedness
    ControllerPoseSynchronizer.DestroyOnSourceLost
    ControllerPoseSynchronizer.IsTracked
    ControllerPoseSynchronizer.TrackingState
    ControllerPoseSynchronizer.UseSourcePoseData
    ControllerPoseSynchronizer.PoseAction
    ControllerPoseSynchronizer.RegisterHandlers()
    ControllerPoseSynchronizer.UnregisterHandlers()
    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 PokePointer : BaseControllerPointer, IMixedRealityControllerPoseSynchronizer, IMixedRealitySourcePoseHandler, IMixedRealitySourceStateHandler, IMixedRealityInputHandler, IMixedRealityBaseInputHandler, IMixedRealityInputHandler<float>, IMixedRealityInputHandler<Vector2>, IMixedRealityInputHandler<Vector3>, IMixedRealityInputHandler<Quaternion>, IMixedRealityInputHandler<MixedRealityPose>, IEventSystemHandler, IMixedRealityNearPointer, IMixedRealityPointer, IEqualityComparer
    Remarks

    Reachable Objects are objects with a both a BaseNearInteractionTouchable and a collider within TouchableDistance from the poke pointer (based on OverlapSphere).

    If a poke pointer has no CurrentTouchableObjectDown, then it will try to select one from the Reachable Objects based on:

    1. Layer mask priority: Lower-priority layer masks will only be considered if higher-priority layers don't contain any Reachable Objects.
    2. Touchable Distance: the closest object in the highest priority layers is selected based on DistanceToTouchable.
    3. Ray Distance: The object becomes the CurrentTouchableObjectDown once the ray cast distance becomes negative (behind the surface). At this point the OnTouchStarted or OnPointerDown event is raised.

    If a poke pointer does have a CurrentTouchableObjectDown it will not consider any other object, until the DistanceToTouchable exceeds the DebounceThreshold (in front of the surface). At this point the active object is cleared and the OnTouchCompleted or OnPointerUp event is raised.

    Fields

    line

    Declaration
    protected LineRenderer line
    Field Value
    Type Description
    LineRenderer

    touchableDistance

    Declaration
    protected float touchableDistance
    Field Value
    Type Description
    Single

    triggerInteraction

    Declaration
    protected QueryTriggerInteraction triggerInteraction
    Field Value
    Type Description
    QueryTriggerInteraction

    visuals

    Declaration
    protected GameObject visuals
    Field Value
    Type Description
    GameObject

    Properties

    ClosestProximityTouchable

    The closest touchable component that has been detected.

    Declaration
    public BaseNearInteractionTouchable ClosestProximityTouchable { get; }
    Property Value
    Type Description
    BaseNearInteractionTouchable
    Remarks

    The closest touchable component limits the set of objects which are currently touchable. These are all the game objects in the subtree of the closest touchable component's owner object.

    CurrentTouchableObjectDown

    The current object that is being touched.

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

    IgnoreCollidersNotInFOV

    Whether to ignore colliders that may be near the pointer, but not actually in the visual FOV. This can prevent accidental touches, and will allow hand rays to turn on when you may be near a touchable 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

    Is the pointer active and have the conditions for the interaction been satisfied to enable the interaction?

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

    IsNearObject

    Returns true if the hand is near anything that's grabbable Currently performs a sphere cast in the direction of the hand ray. Currently anything that has a collider is considered "Grabbable" Eventually we need to filter based on things that can respond to grab events.

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

    PokeLayerMasks

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

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

    Only BaseNearInteractionTouchables in one of the LayerMasks will raise touch events.

    PreviousPosition

    Declaration
    public Vector3 PreviousPosition { get; }
    Property Value
    Type Description
    Vector3

    SceneQueryBufferSize

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

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

    TouchableDistance

    Maximum distance a which a touchable surface can be interacted with.

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

    TriggerInteraction

    Specify whether queries for touchable surfaces hit triggers.

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

    Methods

    OnEnable()

    Declaration
    protected override void OnEnable()
    Overrides
    BaseControllerPointer.OnEnable()

    OnInputDown(InputEventData)

    Input Down updates from Interactions, Keys, or any other simple input.

    Declaration
    public override void OnInputDown(InputEventData eventData)
    Parameters
    Type Name Description
    InputEventData eventData
    Overrides
    BaseControllerPointer.OnInputDown(InputEventData)

    OnInputUp(InputEventData)

    Input Up updates from Interactions, Keys, or any other simple input.

    Declaration
    public override void OnInputUp(InputEventData eventData)
    Parameters
    Type Name Description
    InputEventData eventData
    Overrides
    BaseControllerPointer.OnInputUp(InputEventData)

    OnPostSceneQuery()

    Called after performing the scene query.

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

    OnPreCurrentPointerTargetChange()

    Called during the scene query just before the current pointer target changes.

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

    OnPreSceneQuery()

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

    OnSourceDetected(SourceStateEventData)

    Raised when a source is detected.

    Declaration
    public override void OnSourceDetected(SourceStateEventData eventData)
    Parameters
    Type Name Description
    SourceStateEventData eventData
    Overrides
    ControllerPoseSynchronizer.OnSourceDetected(SourceStateEventData)

    OnSourceLost(SourceStateEventData)

    Raised when a source is lost.

    Declaration
    public override void OnSourceLost(SourceStateEventData eventData)
    Parameters
    Type Name Description
    SourceStateEventData eventData
    Overrides
    BaseControllerPointer.OnSourceLost(SourceStateEventData)

    OnValidate()

    Declaration
    protected void OnValidate()

    Explicit Interface Implementations

    IMixedRealityNearPointer.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
    bool IMixedRealityNearPointer.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.

    IMixedRealityNearPointer.TryGetNearGraspPoint(out Vector3)

    For near pointer we may want to draw a tether between the pointer and the object.

    The visual grasp point (average of index and thumb) may actually be different from the pointer position (the palm).

    This method provides a mechanism to get the visual grasp point.

    NOTE: Not all near pointers have a grasp point (for example a poke pointer).

    Declaration
    bool IMixedRealityNearPointer.TryGetNearGraspPoint(out Vector3 position)
    Parameters
    Type Name Description
    Vector3 position

    Out parameter filled with the grasp position if available, otherwise Vector3.zero.

    Returns
    Type Description
    Boolean

    True if a grasp point was retrieved, false if not.

    IMixedRealityNearPointer.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
    bool IMixedRealityNearPointer.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
    Back to top Generated by DocFX