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

DistanceGrabInteractor Class

The DistanceGrabInteractor enables the grabbing of a DistanceGrabInteractable from a distance using controllers.
It moves the interactable object using a configurable IMovement instance. Additionally, it employs a DistantCandidateComputer<TInteractor, TInteractable> to determine and hover over the most suitable candidate for interaction.

Properties

IThrowVelocityCalculator VelocityCalculator[Get]
The hitpoint of your controller's frustrum.
This value represents the exact point where the frustum intersects with an interactable, providing a precise location for interaction.

Fields

The origin of the frustrums used by <cref="DistantCandidateComputer" />.
This property provides the starting point for the detection frustum, which is used to identify potential interactables.
A reference to the main Transform of the currently selected DistanceGrabInteractable.
This property links back to the interactable object that is currently being manipulated by the user, allowing for continued interaction.

Protected Functions

override void Awake ( )
override void Start ( )
override void DoPreprocess ( )
Determines the best DistanceGrabInteractable candidate for selection based on the user's input and the current position of the interactor.
This method leverages the DistantCandidateComputer<TInteractor, TInteractable> to analyze the available interactables and select the one that best aligns with the user's input and the interactor's position. It updates the HitPoint property with the exact point of interaction for the selected candidate.
Returns
The best DistanceGrabInteractable candidate, or null if no suitable candidate is found.
Handles the logic required when a DistanceGrabInteractable is selected by the interactor.
This method initiates the movement sequence for the selected interactable using the configured movement provider. It also subscribes to pointer events from the interactable to manage its state during interaction.
Parameters
interactable
The DistanceGrabInteractable that has been selected.
Handles the logic required when a DistanceGrabInteractable is unselected by the interactor.
This method finalizes the interaction by unsubscribing from the interactable's pointer events and resetting the movement state. If a velocity calculator is available, it applies the calculated velocities to the interactable, simulating a throw or release action.
Parameters
interactable
The DistanceGrabInteractable that has been unselected.
virtual override Pose ComputePointerPose ( )
Updates the interactable's state while it is selected, ensuring it follows the target position.
This method is called during each frame while an interactable is selected, updating its position and rotation to match the target's current pose. It utilizes the movement provider to smoothly transition the interactable towards the target position.

Member Functions

Adds a DistanceGrabInteractor to a dynamically instantiated GameObject.
This method sets up the necessary components for a DistanceGrabInteractor, including the selector and candidate computer.
Adds an ISelector to a dynamically instantiated GameObject.
This method injects the selector, which is responsible for detecting the user's input to initiate the grab action.
Adds a DistantCandidateComputer<TInteractor, TInteractable> to a dynamically instantiated GameObject.
This method injects the candidate computer, which is used to determine the best interactable to hover based on the user's input.
Adds a grab center to a dynamically instantiated GameObject.
Adds a grab target to a dynamically instantiated GameObject.
Adds a IThrowVelocityCalculator to a dynamically instantiated GameObject.
This method is marked as obsolete and should no longer be used. Use Grabbable instead.
Did you find this page helpful?
Thumbs up icon
Thumbs down icon