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

SnapInteractable Class

Provide Pose targets for SnapInteractors to translate and rotate towards.
In a Snap interaction, the Interactable can be thought of as the target, with the interactor as the source. The SnapInteractor finds interactables in much the same way as other interactions, and uses this association to determine which target to snap to.

Fields

Rigidbody : Rigidbody
The rigidbody of the snap target.
Signature
Rigidbody Oculus.Interaction.SnapInteractable.Rigidbody

Protected Methods

Awake ()
Signature
override void Oculus.Interaction.SnapInteractable.Awake()
Returns
override void
InteractorAdded ( interactor )
Signature
override void Oculus.Interaction.SnapInteractable.InteractorAdded(SnapInteractor interactor)
Parameters
interactor: SnapInteractor
Returns
override void
InteractorRemoved ( interactor )
Signature
override void Oculus.Interaction.SnapInteractable.InteractorRemoved(SnapInteractor interactor)
Parameters
interactor: SnapInteractor
Returns
override void
SelectingInteractorAdded ( interactor )
Signature
override void Oculus.Interaction.SnapInteractable.SelectingInteractorAdded(SnapInteractor interactor)
Parameters
interactor: SnapInteractor
Returns
override void
SelectingInteractorRemoved ( interactor )
Signature
override void Oculus.Interaction.SnapInteractable.SelectingInteractorRemoved(SnapInteractor interactor)
Parameters
interactor: SnapInteractor
Returns
override void
Start ()
Signature
override void Oculus.Interaction.SnapInteractable.Start()
Returns
override void

Methods

GenerateMovement ( from , interactor )
Generates a movement that when applied will move the interactor from a start to a target pose.
Signature
IMovement Oculus.Interaction.SnapInteractable.GenerateMovement(in Pose from, SnapInteractor interactor)
Parameters
from: in Pose  The starting position of the interactor.
interactor: SnapInteractor  The interactor to move.
Returns
IMovement
InjectAllSnapInteractable ( rigidbody )
Injects all required dependencies for a dynamically instantiated SnapInteractable.
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Signature
void Oculus.Interaction.SnapInteractable.InjectAllSnapInteractable(Rigidbody rigidbody)
Parameters
rigidbody: Rigidbody
Returns
void
InjectOptionalMovementProvider ( provider )
Sets the underlying optional IMovementProvider for a dynamically instantiated SnapInteractable.
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Signature
void Oculus.Interaction.SnapInteractable.InjectOptionalMovementProvider(IMovementProvider provider)
Parameters
Returns
void
InjectOptionalSnapPoseDelegate ( snapPoseDelegate )
Sets the underlying optional ISnapPoseDelegate for a dynamically instantiated SnapInteractable.
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Signature
void Oculus.Interaction.SnapInteractable.InjectOptionalSnapPoseDelegate(ISnapPoseDelegate snapPoseDelegate)
Parameters
snapPoseDelegate: ISnapPoseDelegate
Returns
void
InjectRigidbody ( rigidbody )
Sets the underlying Rigidbody for a dynamically instantiated SnapInteractable.
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Signature
void Oculus.Interaction.SnapInteractable.InjectRigidbody(Rigidbody rigidbody)
Parameters
rigidbody: Rigidbody
Returns
void
InteractorHoverUpdated ( interactor )
Moves the tracked element using the ISnapPoseDelegate.
Signature
void Oculus.Interaction.SnapInteractable.InteractorHoverUpdated(SnapInteractor interactor)
Parameters
interactor: SnapInteractor
Returns
void
PoseForInteractor ( interactor , result )
Sets the pose for the interactor.
Signature
bool Oculus.Interaction.SnapInteractable.PoseForInteractor(SnapInteractor interactor, out Pose result)
Parameters
interactor: SnapInteractor  The SnapInteractor object.
result: out Pose  The resulting pose.
Returns
bool