API reference

PokeInteractable Class

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

Properties

CancelSelectNormal : float
[Get][Set]
If greater than zero, the distance required for a selecting PokeInteractor to cancel selection, measured along the negative normal to the surface (in meters).
Signature
float CancelSelectNormal
CancelSelectTangent : float
[Get][Set]
If greater than zero, the distance required for a selecting PokeInteractor to cancel selection, measured along the tangent plane to the surface (in meters).
Signature
float CancelSelectTangent
CloseDistanceThreshold : float
[Get][Set]
The threshold below which distances near this surface are treated as equal in depth for the purposes of ranking, in world-space meters.
Signature
float CloseDistanceThreshold
DragThresholds : DragThresholdsConfig
[Get][Set]
The DragThresholdsConfig for this interactable instance.
This value is typically set from the Unity Editor, but it can also be set and modified programmatically.
Signature
DragThresholdsConfig DragThresholds
EnterHoverNormal : float
[Get][Set]
The distance required for a PokeInteractor to enter hovering, measured along the tangent plane to the surface (in meters).
Signature
float EnterHoverNormal
EnterHoverTangent : float
[Get][Set]
The distance required for a PokeInteractor to enter hovering, measured along the tangent plane to the surface (in meters).
Signature
float EnterHoverTangent
ExitHoverNormal : float
[Get][Set]
The distance required for a PokeInteractor to exit hovering, measured along the normal to the surface (in meters).
Signature
float ExitHoverNormal
ExitHoverTangent : float
[Get][Set]
The distance required for a PokeInteractor to exit hovering, measured along the tangent plane to the surface (in meters).
Signature
float ExitHoverTangent
MinThresholds : MinThresholdsConfig
[Get][Set]
The MinThresholdsConfig for this interactable instance.
This value is typically set from the Unity Editor, but it can also be set and modified programmatically.
Signature
MinThresholdsConfig MinThresholds
PositionPinning : PositionPinningConfig
[Get][Set]
The PositionPinningConfig for this interactable instance.
This value is typically set from the Unity Editor, but it can also be set and modified programmatically.
Signature
PositionPinningConfig PositionPinning
RecoilAssist : RecoilAssistConfig
[Get][Set]
The RecoilAssistConfig for this interactable instance.
This value is typically set from the Unity Editor, but it can also be set and modified programmatically.
Signature
RecoilAssistConfig RecoilAssist
SurfacePatch : ISurfacePatch
[Get]
An ISurfacePatch, which provides both the backing surface (generally infinite) and pokable area (generally finite) of the interactor.
Signature
ISurfacePatch SurfacePatch
TiebreakerScore : int
[Get][Set]
If a PokeInteractor is positioned near multiple interactables such that it is equally interactable with any of them (i.e., the distances to all of them are within CloseDistanceThreshold of each other), the interactable with the largest TiebreakerScore wins and is targeted for interaction.
If there's a tie for largest TiebreakerScore, one of the interactables will be selected arbitrarily.
Signature
int TiebreakerScore

Protected Methods

Awake ()
Signature
override void Awake()
Returns
override void
Start ()
Signature
override void Start()
Returns
override void

Methods

ClosestBackingSurfaceHit ( point , hit )
Convenience method wrapping a call to ISurface.ClosestSurfacePoint(in Vector3, out SurfaceHit, float) on the ISurfacePatch.BackingSurface of this interactable's SurfacePatch.
Signature
bool ClosestBackingSurfaceHit(Vector3 point, out SurfaceHit hit)
Parameters
point: Vector3  The point, in world space, for which the nearest point on the surface must be found
hit: out SurfaceHit  The returned hit data in world space if a nearest point could be found, default otherwise
Returns
bool  True if the racyast hit the surface, false otherwise
ClosestSurfacePatchHit ( point , hit )
Convenience method wrapping a call to ISurface.ClosestSurfacePoint(in Vector3, out SurfaceHit, float) on the SurfacePatch.
Signature
bool ClosestSurfacePatchHit(Vector3 point, out SurfaceHit hit)
Parameters
point: Vector3  The point, in world space, for which the nearest point on the surface must be found
hit: out SurfaceHit  The returned hit data in world space if a nearest point could be found, default otherwise
Returns
bool  True if the racyast hit the surface, false otherwise
InjectAllPokeInteractable ( surfacePatch )
Sets all the required values for a PokeInteractable on a dynamically instantiated GameObject.
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Signature
void InjectAllPokeInteractable(ISurfacePatch surfacePatch)
Parameters
surfacePatch: ISurfacePatch
Returns
void
InjectSurfacePatch ( surfacePatch )
Sets a surface patch for a dynamically instantiated GameObject.
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Signature
void InjectSurfacePatch(ISurfacePatch surfacePatch)
Parameters
surfacePatch: ISurfacePatch
Returns
void

Inner Classes

DragThresholdsConfig Class

Configures the drag thresholds, which are useful for distinguishing between press and drag and suppressing move pointer events when a PokeInteractor follows a pressing motion.
This configuration can vary by instance and can be set either through the Unity Editor or by programmatically setting the PokeInteractable.DragThresholds property.

Fields

DragEaseCurve : ProgressCurve
The curve that a PokeInteractor will use to ease when transitioning between a press and drag state.
Signature
ProgressCurve DragEaseCurve
DragNormal : float
The distance a PokeInteractor must travel to be treated as a press, measured along the normal to the surface (in meters).
Signature
float DragNormal
DragTangent : float
The distance a PokeInteractor must travel to be treated as a press, measured along the tangent plane to the surface (in meters.
Signature
float DragTangent
Enabled : bool
Sets whether or not this config block is enabled.
If disabled, all values will be ignored and default behavior will apply.
Signature
bool Enabled

MinThresholdsConfig Class

Configures the minimum distance required for a PokeInteractor to surpass before it can hover a PokeInteractable.
This configuration can vary by instance and can be set either through the Unity Editor or by programmatically setting the PokeInteractable.MinThresholds property.

Fields

Enabled : bool
Sets whether or not this config block is enabled.
If disabled, all values will be ignored and default behavior will apply.
Signature
bool Enabled
MinNormal : float
The minimum distance required for a PokeInteractor to surpass before being able to hover, measured along the normal to the surface (in meters).
Signature
float MinNormal

PositionPinningConfig Class

Position pinning is applied to surface motion during drag, which is useful for adding a sense of friction to initial drag motion.
This configuration can vary by instance and can be set either through the Unity Editor or by programmatically setting the PokeInteractable.PositionPinning property.

Fields

Enabled : bool
Sets whether or not this config block is enabled.
If disabled, all values will be ignored and default behavior will apply.
Signature
bool Enabled
MaxPinDistance : float
The distance over which a PokeInteractor drag motion will be remapped to the surface (in meters).
If the hand is detected to move along this surface less than this value, those movements will be ignored; this can help to eliminate noise and reduce the degree to which poking feels "slippery."
Signature
float MaxPinDistance
PinningEaseCurve : AnimationCurve
The PokeInteractor position will be remapped along this curve from the initial touch point to the current position on surface.
Signature
AnimationCurve PinningEaseCurve
ResyncCurve : ProgressCurve
In cases where a resync is necessary between the pinned position and the unpinned position, this time-based curve will be used.
Signature
ProgressCurve ResyncCurve

RecoilAssistConfig Class

Recoil assist will affect unselection and reselection criteria, which is useful for triggering unselect in response to a smaller motion in the negative direction from a surface.
This configuration can vary by instance and can be set either through the Unity Editor or by programmatically setting the PokeInteractable.RecoilAssist property.

Fields

DynamicDecayCurve : AnimationCurve
A Unity AnimationCurve of the normal movement ratio to determine the rate of decay.
Signature
AnimationCurve DynamicDecayCurve
Enabled : bool
Sets whether or not this config block is enabled.
If disabled, all values will be ignored and default behavior will apply.
Signature
bool Enabled
ExitDistance : float
The distance over which a poke interactor must surpass to trigger an early unselect, measured along the normal to the surface (in meters).
Signature
float ExitDistance
ReEnterDistance : float
When in recoil, the distance which a poke interactor must surpass to trigger a subsequent select, measured along the negative normal to the surface (in meters).
Signature
float ReEnterDistance
UseDynamicDecay : bool
If true, DynamicDecayCurve will be used to decay the max distance based on the normal velocity.
Otherwise, default behavior will apply.
Signature
bool UseDynamicDecay
UseVelocityExpansion : bool
Expand recoil window when fast Z motion is detected.
When poking a surface rapidly, users are much more likely to over-penetrate to move their hands spatially further past the virtual PokeInteractable.SurfacePatch than they might normally do, simply because they're moving fast. Under such circumstances, both motion tracking and user proprioception tend to contain large spatial errors, and typical interaction windows may consequently be inadequate in such scenarios. This leads to the concept of "velocity expansion," which pads or "expands" the error margins for certain interaction parameters (notably recoil assist) based on the velocity of the user's interaction.
Signature
bool UseVelocityExpansion
VelocityExpansionDecayRate : float
Window will contract toward ExitDistance at this rate (in meters) per second when velocity lowers.
See UseVelocityExpansion for a more detailed overview of what "velocity expansion" means.
Signature
float VelocityExpansionDecayRate
VelocityExpansionDistance : float
Window will expand by this distance when Z velocity reaches max speed.
See UseVelocityExpansion for a more detailed overview of what "velocity expansion" means.
Signature
float VelocityExpansionDistance
VelocityExpansionMaxSpeed : float
Full recoil window expansion reached at this speed.
See UseVelocityExpansion for a more detailed overview of what "velocity expansion" means.
Signature
float VelocityExpansionMaxSpeed
VelocityExpansionMinSpeed : float
When average velocity in interactable Z is greater than min speed, the recoil window will begin expanding.
See UseVelocityExpansion for a more detailed overview of what "velocity expansion" means.
Signature
float VelocityExpansionMinSpeed