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

SnapInteractor Class

SnapInteractors can snap to poses provided by SnapInteractables.
SnapInteractors select and unselect in response to a IPointableElement. SnapInteractors hover when the IPointableElement has selecting pointers and snap to the best SnapInteractable pose when the IPointableElement has no more selecting pointers.

Fields

PointableElement : IPointableElement
This IPointableElement will trigger the snap interaction.
This interactor will listen to select and unselect events from this element, and begin the snap interaction in response to these events.
Signature
IPointableElement Oculus.Interaction.SnapInteractor.PointableElement
Rigidbody : Rigidbody
The Rigidbody of the interactor object.
Signature
Rigidbody Oculus.Interaction.SnapInteractor.Rigidbody
SnapPose : Pose
This is the source pose that will be snapped to the SnapInteractable target.
By default this will be the Pose of this GameObject's transform, but can be another transform's pose if a _snapPoseTransform is provided. An example usage of this is a vase which should be snapped to a table using a point on its base, rather than the center of the vase object.
Signature
Pose Oculus.Interaction.SnapInteractor.SnapPose

Properties

DistanceThreshold : float
[Get][Set]
Used to determine which object should snap to your hand when there are multiple to choose from.
Objects with a lower threshold have a higher priority.
Signature
float Oculus.Interaction.SnapInteractor.DistanceThreshold

Protected Methods

Awake ()
Signature
override void Oculus.Interaction.SnapInteractor.Awake()
Returns
override void
ComputeCandidate ()
Signature
override SnapInteractable Oculus.Interaction.SnapInteractor.ComputeCandidate()
Returns
override SnapInteractable
ComputePointerPose ()
Signature
Pose Oculus.Interaction.SnapInteractor.ComputePointerPose()
Returns
Pose
ComputeShouldSelect ()
Signature
override bool Oculus.Interaction.SnapInteractor.ComputeShouldSelect()
Returns
override bool
ComputeShouldUnselect ()
Signature
override bool Oculus.Interaction.SnapInteractor.ComputeShouldUnselect()
Returns
override bool
DoHoverUpdate ()
Signature
override void Oculus.Interaction.SnapInteractor.DoHoverUpdate()
Returns
override void
DoPreprocess ()
Signature
override void Oculus.Interaction.SnapInteractor.DoPreprocess()
Returns
override void
DoSelectUpdate ()
Signature
override void Oculus.Interaction.SnapInteractor.DoSelectUpdate()
Returns
override void
HandlePointerEventRaised ( evt )
Signature
virtual void Oculus.Interaction.SnapInteractor.HandlePointerEventRaised(PointerEvent evt)
Parameters
Returns
void
InteractableSelected ( interactable )
Signature
override void Oculus.Interaction.SnapInteractor.InteractableSelected(SnapInteractable interactable)
Parameters
interactable: SnapInteractable
Returns
override void
InteractableSet ( interactable )
Signature
override void Oculus.Interaction.SnapInteractor.InteractableSet(SnapInteractable interactable)
Parameters
interactable: SnapInteractable
Returns
override void
InteractableUnselected ( interactable )
Signature
override void Oculus.Interaction.SnapInteractor.InteractableUnselected(SnapInteractable interactable)
Parameters
interactable: SnapInteractable
Returns
override void
InteractableUnset ( interactable )
Signature
override void Oculus.Interaction.SnapInteractor.InteractableUnset(SnapInteractable interactable)
Parameters
interactable: SnapInteractable
Returns
override void
OnDisable ()
Signature
override void Oculus.Interaction.SnapInteractor.OnDisable()
Returns
override void
OnEnable ()
Signature
override void Oculus.Interaction.SnapInteractor.OnEnable()
Returns
override void
Start ()
Signature
override void Oculus.Interaction.SnapInteractor.Start()
Returns
override void

Methods

InjectAllSnapInteractor ( pointableElement , rigidbody )
Sets all required values for a <cref="SnapInteractor" /> on a dynamically instantiated GameObject.
Signature
void Oculus.Interaction.SnapInteractor.InjectAllSnapInteractor(PointableElement pointableElement, Rigidbody rigidbody)
Parameters
pointableElement: PointableElement
rigidbody: Rigidbody
Returns
void
InjectOptionalSnapPoseTransform ( snapPoint )
Sets a snap point on a dynamically instantiated GameObject.
Signature
void Oculus.Interaction.SnapInteractor.InjectOptionalSnapPoseTransform(Transform snapPoint)
Parameters
snapPoint: Transform
Returns
void
InjectOptionalTimeOutInteractable ( interactable )
Sets a time out interactable on a dynamically instantiated GameObject.
Signature
void Oculus.Interaction.SnapInteractor.InjectOptionalTimeOutInteractable(SnapInteractable interactable)
Parameters
interactable: SnapInteractable
Returns
void
InjectOptionaTimeOut ( timeOut )
Sets a timeout on a dynamically instantiated GameObject.
Signature
void Oculus.Interaction.SnapInteractor.InjectOptionaTimeOut(float timeOut)
Parameters
timeOut: float
Returns
void
InjectPointableElement ( pointableElement )
Sets a <cref="PointableElement" /> on a dynamically instantiated GameObject.
Signature
void Oculus.Interaction.SnapInteractor.InjectPointableElement(PointableElement pointableElement)
Parameters
pointableElement: PointableElement
Returns
void
InjectRigidbody ( rigidbody )
Sets a Rigidbody on a dynamically instantiated GameObject.
Signature
void Oculus.Interaction.SnapInteractor.InjectRigidbody(Rigidbody rigidbody)
Parameters
rigidbody: Rigidbody
Returns
void