Edit

Share via


PokePointer Class

Definition

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

public ref class PokePointer : Microsoft::MixedReality::Toolkit::Input::BaseControllerPointer, Microsoft::MixedReality::Toolkit::Input::IMixedRealityNearPointer, System::Collections::IEqualityComparer
[UnityEngine.AddComponentMenu("Scripts/MRTK/SDK/PokePointer")]
public class PokePointer : Microsoft.MixedReality.Toolkit.Input.BaseControllerPointer, Microsoft.MixedReality.Toolkit.Input.IMixedRealityNearPointer, System.Collections.IEqualityComparer
[<UnityEngine.AddComponentMenu("Scripts/MRTK/SDK/PokePointer")>]
type PokePointer = class
    inherit BaseControllerPointer
    interface IMixedRealityNearPointer
    interface IMixedRealityPointer
    interface IEqualityComparer
Public Class PokePointer
Inherits BaseControllerPointer
Implements IEqualityComparer, IMixedRealityNearPointer
Inheritance
Attributes
UnityEngine.AddComponentMenuAttribute
Implements

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.

Constructors

PokePointer()

Fields

grabAction (Inherited from BaseControllerPointer)
HasSelectPressedOnce

True if select has been pressed once since this component was enabled

(Inherited from BaseControllerPointer)
IsGrabPressed

True if grab is pressed right now

(Inherited from BaseControllerPointer)
IsHoldPressed (Inherited from BaseControllerPointer)
IsSelectPressed

True if select is pressed right now

(Inherited from BaseControllerPointer)
line
pointerAction (Inherited from BaseControllerPointer)
raycastOrigin (Inherited from BaseControllerPointer)
sourcePoseOffset
touchableDistance
TrackingState

The current tracking state of the assigned IMixedRealityController

(Inherited from ControllerPoseSynchronizer)
triggerInteraction
visuals

Properties

BaseCursor

The pointer's cursor.

(Inherited from BaseControllerPointer)
ClosestProximityTouchable

The closest touchable component that has been detected.

Controller

The pointer's current controller reference.

(Inherited from BaseControllerPointer)
CurrentTouchableObjectDown

The current object that is being touched.

CursorModifier

The currently active cursor modifier.

(Inherited from BaseControllerPointer)
DefaultPointerExtent

The length of the pointer when nothing is hit.

(Inherited from BaseControllerPointer)
DestroyOnSourceLost

Should this GameObject clean itself up when its controller is lost?

(Inherited from ControllerPoseSynchronizer)
DisableCursorOnStart (Inherited from BaseControllerPointer)
FocusTarget

The currently focused target.

(Inherited from BaseControllerPointer)
Handedness

The controller handedness this component is synchronized with.

(Inherited from ControllerPoseSynchronizer)
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.

InputSourceParent
Obsolete.

This pointer's input source parent.

(Inherited from BaseControllerPointer)
IsActive

Controls whether the pointer dispatches input.

(Inherited from BaseControllerPointer)
IsFocusLocked

Is the focus for this pointer currently locked?

(Inherited from BaseControllerPointer)
IsInteractionEnabled

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

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.

IsTargetPositionLockedOnFocusLock

Specifies whether the pointer's target position (cursor) is locked to the target object when focus is locked. Most pointers want the cursor to "stick" to the object when manipulating, so set this to true by default.

(Inherited from BaseControllerPointer)
IsTracked

Is the controller this Synchronizer is registered to currently tracked?

(Inherited from ControllerPoseSynchronizer)
PointerExtent

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

(Inherited from BaseControllerPointer)
PointerId

This pointer's id.

(Inherited from BaseControllerPointer)
PointerName

This pointer's name.

(Inherited from BaseControllerPointer)
PokeLayerMasks
Obsolete.

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

PoseAction

The input action that will drive the Transform's pose, position, or rotation.

(Inherited from ControllerPoseSynchronizer)
Position

Pointer position.

(Inherited from BaseControllerPointer)
PreviousPosition
PrioritizedLayerMasksOverride

The physics layers to use when performing scene queries.

PrioritizedLayerMasksOverride

The physics layers to use when performing scene queries.

(Inherited from BaseControllerPointer)
Rays

The scene query rays.

(Inherited from BaseControllerPointer)
RayStabilizer

Ray stabilizer used when calculating position of pointer end point.

(Inherited from BaseControllerPointer)
Result

The scene query pointer result.

(Inherited from BaseControllerPointer)
Rotation

Pointer rotation.

(Inherited from BaseControllerPointer)
SceneQueryBufferSize

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

SceneQueryType

The type of physics scene query to use.

(Inherited from BaseControllerPointer)
SourcePoseOffset

The offset that the poke pointer has from the source pose when the index finger pose is not available. This value puts the pointer slightly in front of the source pose's origin, oriented according to the source pose's rotation

SphereCastRadius

The radius to use when SceneQueryType is set to Sphere or SphereColliders.

(Inherited from BaseControllerPointer)
TouchableDistance

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

TriggerInteraction

Specify whether queries for touchable surfaces hit triggers.

UseSourcePoseAsFallback

Should the Transform's position use the source pose by default until the input handler events are received?

(Inherited from ControllerPoseSynchronizer)
UseSourcePoseData

Should the Transform's position be driven from the source pose or from input handler?

(Inherited from ControllerPoseSynchronizer)

Methods

EnsureInputSystemValid()

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

(Inherited from InputSystemGlobalHandlerListener)
Equals(Object) (Inherited from BaseControllerPointer)
GetHashCode() (Inherited from BaseControllerPointer)
InputEventDataUsable<T>(InputEventData<T>)

Helper function used to determine whether or not the controller pose synchronizer is configured to make use of the InputEventData

(Inherited from ControllerPoseSynchronizer)
OnDisable() (Inherited from BaseControllerPointer)
OnEnable()
OnInputChanged(InputEventData<MixedRealityPose>)

Raised input event updates from the type of input specified in the interface handler implementation.

(Inherited from ControllerPoseSynchronizer)
OnInputChanged(InputEventData<Quaternion>)

Raised input event updates from the type of input specified in the interface handler implementation.

(Inherited from ControllerPoseSynchronizer)
OnInputChanged(InputEventData<Single>)

Raised input event updates from the type of input specified in the interface handler implementation.

(Inherited from ControllerPoseSynchronizer)
OnInputChanged(InputEventData<Vector2>)

Raised input event updates from the type of input specified in the interface handler implementation.

(Inherited from ControllerPoseSynchronizer)
OnInputChanged(InputEventData<Vector3>)

Raised input event updates from the type of input specified in the interface handler implementation.

(Inherited from ControllerPoseSynchronizer)
OnInputDown(InputEventData)

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

OnInputUp(InputEventData)

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

OnPostSceneQuery()

Called after performing the scene query.

OnPreCurrentPointerTargetChange()

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

OnPreSceneQuery()
OnSceneQuery(LayerMask[], Boolean, GameObject, Vector3, Single)

Called to have the pointer query the scene to determine which objects it is hitting. Updates hitObject, hitPoint, and hitDistance. Used when the method for querying the scene does not utilize a RaycastHit. Examples of this include UnityEngine.Physics.SphereOverlap, which performs no raycast calls

(Inherited from BaseControllerPointer)
OnSceneQuery(LayerMask[], Boolean, MixedRealityRaycastHit, RayStep, Int32)

Called to have the pointer query the scene to determine which objects it is hitting. Updates hitinfo. Used when the method for querying the scene utilizes a RaycastHit, such as when using UnityEngine.Physics.Raycast

(Inherited from BaseControllerPointer)
OnSourceDetected(SourceStateEventData)

Raised when a source is detected.

OnSourceLost(SourceStateEventData)

Raised when a source is lost.

OnSourcePoseChanged(SourcePoseEventData<MixedRealityPose>)

Raised when the source pose is changed.

OnSourcePoseChanged(SourcePoseEventData<MixedRealityPose>)

Raised when the source pose is changed.

(Inherited from ControllerPoseSynchronizer)
OnSourcePoseChanged(SourcePoseEventData<Quaternion>)

Raised when the source rotation is changed.

(Inherited from ControllerPoseSynchronizer)
OnSourcePoseChanged(SourcePoseEventData<TrackingState>)

Raised when the source pose tracking state is changed.

(Inherited from ControllerPoseSynchronizer)
OnSourcePoseChanged(SourcePoseEventData<Vector2>)

Raised when the source position is changed.

(Inherited from ControllerPoseSynchronizer)
OnSourcePoseChanged(SourcePoseEventData<Vector3>)

Raised when the source position is changed.

(Inherited from ControllerPoseSynchronizer)
OnValidate()
RegisterHandlers()

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

(Inherited from ControllerPoseSynchronizer)
Reset()

Resets pointer to initial state. After invoked pointer should be functional and ready for re-use.

(Inherited from BaseControllerPointer)
SetCursor(GameObject)

Set a new cursor for this IMixedRealityPointer

(Inherited from BaseControllerPointer)
SourcePoseDataUsable<T>(SourcePoseEventData<T>)

Helper function used to determine whether or not the controller pose synchronizer is configured to make use of the SourcePoseEventData

(Inherited from ControllerPoseSynchronizer)
Start() (Inherited from BaseControllerPointer)
UnregisterHandlers()

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

(Inherited from ControllerPoseSynchronizer)

Explicit Interface Implementations

IEqualityComparer.Equals(Object, Object) (Inherited from BaseControllerPointer)
IEqualityComparer.GetHashCode(Object) (Inherited from BaseControllerPointer)
IMixedRealityNearPointer.TryGetDistanceToNearestSurface(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.

IMixedRealityNearPointer.TryGetNearGraspPoint(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).

IMixedRealityNearPointer.TryGetNormalToNearestSurface(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.

Applies to