Class XRPokeInteractor
Interactor used for interacting with interactables through poking.
Implements
Inherited Members
Namespace: UnityEngine.XR.Interaction.Toolkit.Interactors
Assembly: Unity.XR.Interaction.Toolkit.dll
Syntax
[MovedFrom("UnityEngine.XR.Interaction.Toolkit")]
[AddComponentMenu("XR/Interactors/XR Poke Interactor", 11)]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@3.0/api/UnityEngine.XR.Interaction.Toolkit.Interactors.XRPokeInteractor.html")]
public class XRPokeInteractor : XRBaseInteractor, IXRHoverInteractor, IXRSelectInteractor, IXRTargetPriorityInteractor, IXRGroupMember, IXRInteractionStrengthInteractor, IXRInteractor, IUIHoverInteractor, IUIInteractor, IPokeStateDataProvider, IAttachPointVelocityProvider
Properties
attachPointVelocityTracker
The tracker used to compute the velocity of the attach point. This behavior automatically updates this velocity tracker each frame during PreprocessInteractor(UpdatePhase).
Declaration
protected IAttachPointVelocityTracker attachPointVelocityTracker { get; set; }
Property Value
Type | Description |
---|---|
IAttachPointVelocityTracker |
See Also
debugVisualizationsEnabled
Denotes whether or not debug visuals are enabled for this poke interactor. Debug visuals include two spheres to display whether or not hover and select colliders have collided.
Declaration
public bool debugVisualizationsEnabled { get; set; }
Property Value
Type | Description |
---|---|
bool |
See Also
enableUIInteraction
Gets or sets whether this Interactor is able to affect UI.
Declaration
public bool enableUIInteraction { get; set; }
Property Value
Type | Description |
---|---|
bool |
See Also
physicsLayerMask
Physics layer mask used for limiting poke sphere overlap.
Declaration
public LayerMask physicsLayerMask { get; set; }
Property Value
Type | Description |
---|---|
LayerMask |
See Also
physicsTriggerInteraction
Determines whether the poke sphere overlap will hit triggers.
Declaration
public QueryTriggerInteraction physicsTriggerInteraction { get; set; }
Property Value
Type | Description |
---|---|
QueryTriggerInteraction |
See Also
pokeDepth
The depth threshold within which an interaction can begin to be evaluated as a poke.
Declaration
public float pokeDepth { get; set; }
Property Value
Type | Description |
---|---|
float |
See Also
pokeHoverRadius
The radius threshold within which an interaction can be evaluated as a poke hover.
Declaration
public float pokeHoverRadius { get; set; }
Property Value
Type | Description |
---|---|
float |
See Also
pokeInteractionOffset
Distance along the poke interactable interaction axis that allows for a poke to be triggered sooner/with less precision.
Declaration
public float pokeInteractionOffset { get; set; }
Property Value
Type | Description |
---|---|
float |
See Also
pokeSelectWidth
The width threshold within which an interaction can be evaluated as a poke select.
Declaration
public float pokeSelectWidth { get; set; }
Property Value
Type | Description |
---|---|
float |
See Also
pokeStateData
Unity.XR.CoreUtils.Bindings.Variables.IReadOnlyBindableVariable<T> that updates whenever the poke logic state is evaluated.
Declaration
public IReadOnlyBindableVariable<PokeStateData> pokeStateData { get; }
Property Value
Type | Description |
---|---|
IReadOnlyBindableVariable<PokeStateData> |
See Also
pokeWidth
The width threshold within which an interaction can begin to be evaluated as a poke.
Declaration
public float pokeWidth { get; set; }
Property Value
Type | Description |
---|---|
float |
See Also
requirePokeFilter
Denotes whether or not valid targets will only include objects with a poke filter.
Declaration
public bool requirePokeFilter { get; set; }
Property Value
Type | Description |
---|---|
bool |
See Also
uiHoverEntered
The event that is called when the Interactor begins hovering over a UI element.
Declaration
public UIHoverEnterEvent uiHoverEntered { get; set; }
Property Value
Type | Description |
---|---|
UIHoverEnterEvent |
Remarks
The UIHoverEventArgs passed to each listener is only valid while the event is invoked, do not hold a reference to it.
See Also
uiHoverExited
The event that is called when this Interactor ends hovering over a UI element.
Declaration
public UIHoverExitEvent uiHoverExited { get; set; }
Property Value
Type | Description |
---|---|
UIHoverExitEvent |
Remarks
The UIHoverEventArgs passed to each listener is only valid while the event is invoked, do not hold a reference to it.
See Also
Methods
Awake()
See MonoBehaviour.
Declaration
protected override void Awake()
Overrides
See Also
GetAttachPointAngularVelocity()
Last computed default attach point angular velocity, based on multi-frame sampling of the pose in world space.
Declaration
public Vector3 GetAttachPointAngularVelocity()
Returns
Type | Description |
---|---|
Vector3 | Returns the transformed attach point angular velocity. |
See Also
GetAttachPointVelocity()
Last computed default attach point velocity, based on multi-frame sampling of the pose in world space.
Declaration
public Vector3 GetAttachPointVelocity()
Returns
Type | Description |
---|---|
Vector3 | Returns the transformed attach point linear velocity. |
See Also
GetValidTargets(List<IXRInteractable>)
Retrieve the list of Interactables that this Interactor could possibly interact with this frame. This list is sorted by priority (with highest priority first).
Declaration
public override void GetValidTargets(List<IXRInteractable> targets)
Parameters
Type | Name | Description |
---|---|---|
List<IXRInteractable> | targets | The results list to populate with Interactables that are valid for selection or hover. |
Overrides
Remarks
When implementing this method, Unity expects you to clear targets
before adding to it.
See Also
OnDisable()
See MonoBehaviour.
Declaration
protected override void OnDisable()
Overrides
See Also
OnEnable()
See MonoBehaviour.
Declaration
protected override void OnEnable()
Overrides
See Also
OnHoverEntering(HoverEnterEventArgs)
The XRInteractionManager calls this method right before the Interactor first initiates hovering over an Interactable in a first pass.
Declaration
protected override void OnHoverEntering(HoverEnterEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
HoverEnterEventArgs | args | Event data containing the Interactable that is being hovered over. |
Overrides
Remarks
args
is only valid during this method call, do not hold a reference to it.
See Also
OnUIHoverEntered(UIHoverEventArgs)
The XRUIInputModule calls this method when the Interactor begins hovering over a UI element.
Declaration
protected virtual void OnUIHoverEntered(UIHoverEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
UIHoverEventArgs | args | Event data containing the UI element that is being hovered over. |
Remarks
args
is only valid during this method call, do not hold a reference to it.
See Also
OnUIHoverExited(UIHoverEventArgs)
The XRUIInputModule calls this method when the Interactor ends hovering over a UI element.
Declaration
protected virtual void OnUIHoverExited(UIHoverEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
UIHoverEventArgs | args | Event data containing the UI element that is no longer hovered over. |
Remarks
args
is only valid during this method call, do not hold a reference to it.
See Also
PreprocessInteractor(UpdatePhase)
The XRInteractionManager or containing IXRInteractionGroup calls this method to update the Interactor before interaction events occur. Interactors should use this method to do tasks like determine their valid targets.
Declaration
public override void PreprocessInteractor(XRInteractionUpdateOrder.UpdatePhase updatePhase)
Parameters
Type | Name | Description |
---|---|---|
XRInteractionUpdateOrder.UpdatePhase | updatePhase | The update phase this is called during. |
Overrides
Remarks
Please see the XRInteractionManager and XRInteractionUpdateOrder.UpdatePhase documentation for more details on update order.
See Also
ProcessInteractor(UpdatePhase)
The XRInteractionManager or containing IXRInteractionGroup calls this method to update the Interactor after interaction events occur.
Declaration
public override void ProcessInteractor(XRInteractionUpdateOrder.UpdatePhase updatePhase)
Parameters
Type | Name | Description |
---|---|---|
XRInteractionUpdateOrder.UpdatePhase | updatePhase | The update phase this is called during. |
Overrides
Remarks
Please see the XRInteractionManager and XRInteractionUpdateOrder.UpdatePhase documentation for more details on update order.
See Also
TryGetUIModel(out TrackedDeviceModel)
Attempts to retrieve the current UI Model.
Declaration
public bool TryGetUIModel(out TrackedDeviceModel model)
Parameters
Type | Name | Description |
---|---|---|
TrackedDeviceModel | model | The returned model that reflects the UI state of this Interactor. |
Returns
Type | Description |
---|---|
bool | Returns true if the model was able to retrieved. Otherwise, returns false. |
See Also
UpdateUIModel(ref TrackedDeviceModel)
Updates the current UI Model to match the state of the Interactor.
Declaration
public virtual void UpdateUIModel(ref TrackedDeviceModel model)
Parameters
Type | Name | Description |
---|---|---|
TrackedDeviceModel | model | The returned model that will match this Interactor. |