API reference
API reference
Select your platform
No SDKs available
No versions available

PokeInteractor Class

Defines a near-poke interaction that is driven by a near-distance proximity computation and a raycast between the position recorded across two frames against a target surface.
The interactable type for this interactor is PokeInteractable.

Properties

During interaction (and potential interaction), this exposes the point on the surface of the Interactor<TInteractor, TInteractable>.Interactable's PokeInteractable.SurfacePatch considered to be closest to this interactor.
This point is specifically on the PokeInteractable.SurfacePatch itself (as opposed to the ISurfacePatch.BackingSurface). This point is primarily used in visualizations, for example to display a highlight which "follows" the tip of a poking finger across the surface of a pokable button.
During interaction (and potential interaction), this exposes the point on the surface of the Interactor<TInteractor, TInteractable>.Interactable's PokeInteractable.SurfacePatch's ISurfacePatch.BackingSurface considered to be closest to this interactor.
Because this point is on the ISurfacePatch.BackingSurface, it is sometimes but not always different from ClosestPoint. The distance between these two points can be used for visualization purposes (to control the intensity or direction of a highlight), for cancellation purposes, etc.
During interaction (and potential interaction), this exposes the normal of the Interactor<TInteractor, TInteractable>.Interactable's PokeInteractable.SurfacePatch's ISurfacePatch.BackingSurface at TouchPoint.
The origin of the sphere which represents the interacting shape of this interactor.
Conceptually, this can be thought of as a sphere which follows the fingertip of a tracked hand, centering itself beneath the fingernail.
Checks whether the interactor has penetrated through the PokeInteractable.SurfacePatch of the current Interactor<TInteractor, TInteractable>.Interactable.
Note: while the set for this property is public, it should be considered an internal API; manually overriding the value of this from outside poke interaction logic is not supported. Because PokeInteractables typically have no physical representation, it is common for users to unintentionally poke through them because there is nothing to physically stop the user's hand. Handling this gracefully is a large part of the value PokeInteractor provides, one of the most fundamental pieces of which is determining whether or not it has happened. This property specifies that.

Fields

The radius of the sphere which represents the interacting shape of this interactor.
Conceptually, this can be thought of as half the width of a fingertip, from the center of the fingernail to the edge of the finger.
Signals when IsPassedSurface changes.
IsPassedSurface is a nuanced value with behavior affected and controlled by many circumstances and settings (see PokeInteractable.RecoilAssistConfig or the poke interaction documentation for details), and its changes do not always map to readily-observable values in obvious ways. This behavior is the result of intentional design choices, but it can disrupt what might otherwise seem like safe assumptions about the connection between two states: for example, there are some circumstances where IsPassedSurface can become false while Origin is still past the surface of the interactable. Thus, when implementing behavior that depends upon multiple seemingly related happenstances (such as IsPassedSurface becoming true and IInteractorView.State becoming InteractorState.Select), you should always check all relevant conditions even if they are always expected to co-occur.

Member Functions

Implementation of ITimeConsumer.SetTimeProvider(Func<float>); for details, please refer to the related documentation provided for that interface.
Returns the smallest "depth" to which the interactable is being poked by any of the interactors currently poking it.
Articulated buttons, such as the "big red button" or the keys on a physical keyboard, translate in space when they are interacted with. PokeInteractables which simulate this behavior also simulate this translation, causing the conceptual surface of the button (though not necessarily the data in its PokeInteractable.SurfacePatch) to move as well. Certain poke interaction calculations, such as whether or not a nearby interactor can hover an articulated button which is already being pushed, can be impacted this conceptual translation, so this method is used to retrieve that information for those calculations.
Parameters
interactable
The PokeInteractable to retrieve the minimum poike depth from
Returns
The minimum poke depth
Obsolete: the distance below a surface along the closest normal.
Always positive. This simply wraps SurfaceUtils.ComputeDepth(ISurfacePatch, Vector3, float), which should simply be invoked directly in new code.
Parameters
interactable
The PokeInteractable to compute the depth within
point
The point to compute the depth of
Returns
The depth to which the point is "within" (past the surface of) the interactable
Injects all required dependencies for a dynamically instantiated PokeInteractor; effectively wraps InjectPointTransform(Transform) and InjectRadius(float).
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Sets a point transform for a dynamically instantiated PokeInteractor.
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Sets a radius for a dynamically instantiated PokeInteractor.
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Sets a touch release threshold for a dynamically instantiated PokeInteractor.
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Sets an equal distance threshold for a dynamically instantiated PokeInteractor.
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Obsolete, replaced by SetTimeProvider().
Sets a time provider for a dynamically instantiated PokeInteractor. This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.

Protected Functions

override void Awake ( )
override void Start ( )
override void DoPreprocess ( )
override void DoPostprocess ( )
override bool ComputeShouldSelect ( )
override bool ComputeShouldUnselect ( )
override void DoHoverUpdate ( )
override PokeInteractable ComputeCandidate ( )
override int ComputeCandidateTiebreaker
override void InteractableSelected
( PokeInteractable interactable )
override void HandleDisabled ( )
virtual override Pose ComputePointerPose ( )
virtual bool SurfaceUpdate
( PokeInteractable interactable )
virtual bool ShouldCancel
( PokeInteractable interactable )
virtual bool ShouldRecoil
( PokeInteractable interactable )
override void DoSelectUpdate ( )
Did you find this page helpful?
Thumbs up icon
Thumbs down icon