API reference

TeleportInteractor Class

TeleportInteractor uses a provided ITeleportArc and an external Selector to find the best interactable and emit the event requesting a teleport to it.
By itself it does not define the shape of the arc or even moves the player, instead it is the core class that brings these pieces together.

Properties

AcceptDestination : AcceptDestinationComputer
[Get][Set]
This optional delegate method offers one chance to accept or reject a valid target destination.
It will be executed upon the current Interactable and desired target Pose in order to allow selection.
Return true to allow Selection, false to disallow selection. When it is not set, it always allows to select valid interactables.
Signature
AcceptDestinationComputer AcceptDestination
ArcEnd : TeleportHit
[Get]
Signature
TeleportHit ArcEnd
ArcOrigin : Pose
[Get]
The starting point of the teleport arc.
Signature
Pose ArcOrigin
EqualDistanceThreshold : float
[Get][Set]
(Meters, World) The threshold below which distances to a interactable are treated as equal for the purposes of ranking.
Signature
float EqualDistanceThreshold
TeleportArc : IPolyline
[Get]
Specifies the shape of the arc used for detecting available interactables.
If none is provided TeleportArcGravity will be used.
Signature
IPolyline TeleportArc
TeleportTarget : Pose
[Get]
The location to teleport to.
If the interactor has an interactable, then that's the teleport location. Otherwise it just projects the end of the arc onto the ground and uses that as the target.
Signature
Pose TeleportTarget
WhenLocomotionPerformed : Action< LocomotionEvent >
Signature
Action<LocomotionEvent> WhenLocomotionPerformed

Protected Methods

Awake ()
Signature
override void Awake()
Returns
override void
ComputeCandidate ()
Signature
override TeleportInteractable ComputeCandidate()
Returns
override TeleportInteractable
ComputeCandidateTiebreaker ( a , b )
Signature
override int ComputeCandidateTiebreaker(TeleportInteractable a, TeleportInteractable b)
Returns
override int
InteractableSelected ( interactable )
Signature
override void InteractableSelected(TeleportInteractable interactable)
Parameters
interactable: TeleportInteractable
Returns
override void
Start ()
Signature
override void Start()
Returns
override void

Methods

AcceptDestinationComputer ( interactable , destination )
Delegate to accept or reject the selection of teleport destination.
Signature
delegate bool AcceptDestinationComputer(TeleportInteractable interactable, Pose destination)
Parameters
interactable: TeleportInteractable  The interactable the interactor wants to teleport to.
destination: Pose  The final Pose the interactor wants to move to.
Returns
delegate bool  True if the destination is accepted, false if rejected.
CanSelect ( interactable )
Signature
override bool CanSelect(TeleportInteractable interactable)
Parameters
interactable: TeleportInteractable
Returns
override bool
ComputeCandidateDelegate ( TeleportArc , interactables , tiebreaker , hitPose )
Delegate method used for calculating the best available interactable to teleport to.
Implement this delegate to create custom behaviors for the Interactor ComputeCandidate.
Signature
delegate TeleportInteractable ComputeCandidateDelegate(IPolyline TeleportArc, IEnumerable< TeleportInteractable > interactables, ComputeCandidateTiebreakerDelegate tiebreaker, out TeleportHit hitPose)
Parameters
TeleportArc: IPolyline  The serie of segments used to query the interactables.
interactables: IEnumerable< TeleportInteractable >  The list of available interactors whitin range of the arc
tiebreaker: ComputeCandidateTiebreakerDelegate  Method to break the tie when two interactables get the same result, note that this can be modified externally via Interactor.CandidateTiebreaker
hitPose: out TeleportHit  The information about where the best candidate was hit
Returns
delegate TeleportInteractable  The best candidate found
ComputeCandidateTiebreakerDelegate ( a , b )
Signature
delegate int ComputeCandidateTiebreakerDelegate(TeleportInteractable a, TeleportInteractable b)
Returns
delegate int
HasValidDestination ()
Signature
bool HasValidDestination()
Returns
bool
InjectAllTeleportInteractor ( selector )
Sets all required values for a dynamically instantiated GameObject.
Signature
void InjectAllTeleportInteractor(ISelector selector)
Parameters
selector: ISelector
Returns
void
InjectOptionalCandidateComputer ( candidateComputer )
Sets a custom strategy for computing the best teleport candidate.
Signature
void InjectOptionalCandidateComputer(ComputeCandidateDelegate candidateComputer)
Parameters
candidateComputer: ComputeCandidateDelegate
Returns
void
InjectOptionalHmd ( hmd )
Sets the HMD (Head Mounted Display) for a dynamically instantiated GameObject.
Signature
void InjectOptionalHmd(IHmd hmd)
Parameters
hmd: IHmd
Returns
void
InjectOptionalTeleportArc ( teleportArc )
Sets the teleport arc for a dynamically instantiated GameObject.
Signature
void InjectOptionalTeleportArc(IPolyline teleportArc)
Parameters
teleportArc: IPolyline
Returns
void
InjectSelector ( selector )
Sets the selection mechanism for a dynamically instantiated GameObject.
Signature
void InjectSelector(ISelector selector)
Parameters
selector: ISelector
Returns
void