UxrTeleportLocomotionBase Class
Base component for teleport locomotion.
Inheritance Hierarchy
System.Object
Object
Component
Behaviour
MonoBehaviour
UltimateXR.Core.Components.UxrComponent
UltimateXR.Core.Components.UxrComponent(UxrLocomotion)
UltimateXR.Core.Components.Composite.UxrAvatarComponent(UxrLocomotion)
UltimateXR.Locomotion.UxrLocomotion
UltimateXR.Locomotion.UxrTeleportLocomotionBase
UltimateXR.Locomotion.UxrTeleportLocomotion
Namespace: UltimateXR.Locomotion
Assembly: UltimateXR (in UltimateXR.dll) Version: 0.0.0.0
Syntax
C#
public abstract class UxrTeleportLocomotionBase : UxrLocomotion,
IUxrPrecacheable
The UxrTeleportLocomotionBase type exposes the following members.
Constructors
Name | Description | |
---|---|---|
UxrTeleportLocomotionBase |
Properties
Name | Description | |
---|---|---|
BlockingTargetLayers | Gets or sets the layers which should be considered when ray-casting looking for either valid or invalid teleportation surfaces. | |
CanBackStep | Gets whether the avatar can currently receive input to step backwards. | |
CanRotate | Gets whether the avatar can currently receive input to rotate around. | |
ControllerForward | Gets the smoothed direction of ray-casting when starts on the controller. | |
ControllerStart | Gets the smoothed source of ray-casting when it starts on the controller. | |
DestinationValidationRadius | Gets or sets the radius of a cylinder used when validating if a teleport destination is valid. | |
FadeRotationColor | Gets or sets the fade color when using Fade translation teleporting. | |
FadeRotationSeconds | Gets or sets the transition duration in seconds for the Fade rotation type. | |
FadeTranslationColor | Gets or sets the fade color when using Fade translation teleporting. | |
FadeTranslationSeconds | Gets or sets the transition duration in seconds for the Fade translation type. | |
HandSide | Gets the hand used to control the teleport component. | |
InvalidMaterialColorTargets | When ShowTargetAlsoWhenInvalid is true, sets the teleport target color used when the destination is invalid. | |
IsAllowedToTeleport | Gets whether the component is currently allowed to teleport the avatar. | |
IsOtherComponentTeleporting | Gets whether other teleport component is currently teleporting the avatar. | |
IsTeleporting | Gets or sets whether the component is currently teleporting the avatar. | |
LayerMaskRaycast | Gets the LayerMask used for ray-casting either valid or invalid teleport destinations. | |
MaxAllowedDistance | Gets or sets the maximum teleport distance. | |
MaxAllowedHeightDifference | Gets or sets the maximum height difference allowed from the current position to a destination. | |
MaxAllowedSlopeDegrees | Gets or sets the maximum slop for a destination to be considered valid. | |
ParentToDestination | Gets or sets whether to parent the avatar to the destination object (TeleportReference) after teleporting. This can also be overriden using a UxrParentAvatarDestination component. | |
PrecachedInstances | Gets the GameObjects, usually prefabs, that will be precached when the scene is loaded. | |
ReorientationType | Gets or sets how the teleport target direction is set. | |
RotationStepDegrees | Gets or sets the amount of degrees rotated around the avatar axis when the user presses the left or right joystick buttons. | |
RotationType | Gets or sets the teleport rotation type. | |
ShowTargetAlsoWhenInvalid | Gets or sets whether the target should also be visible when the teleport destination is not valid. | |
SmoothRotationSeconds | Gets or sets the transition duration in seconds for the Smooth rotation type. | |
SmoothTranslationSeconds | Gets or sets the transition duration in seconds for the Smooth translation type. | |
Target | Gets or sets the target object. | |
TargetPlacementAboveHit | Gets or sets the distance above the ground the target is positioned. | |
TeleportLocalDirection | Gets or sets the current teleport direction in in TeleportReference space. If TeleportReference is null, it will be considered as world-space rotation. | |
TeleportLocalPosition | Gets or sets the current teleport destination in TeleportReference space. If TeleportReference is null, it will be considered as world-space position. | |
TeleportReference | Gets or sets the transform that will be used as reference for [!:TeleportPosition] and [!:TeleportDirection] to keep the relative positioning/orientation to while performing potential transitions, such as fades, before the actual teleporting. It is usually assigned the transform of the object that was hit with the destination raycast. The reference transform is used to make teleport transitions work correctly when the avatar is on a moving object. Without it, using absolute position and rotation only, would spawn the avatar with an incorrect offset due to the delay the transition introduces before the teleport. | |
TranslationType | Gets or sets the teleport translation type. | |
TriggerCollidersInteraction | Gets or sets the behaviour for raycasts against trigger volumes. | |
ValidMaterialColorTargets | When ShowTargetAlsoWhenInvalid is true, sets the teleport target color used when the destination is valid. | |
ValidTargetLayers | Gets or sets the layers over which teleportation is allowed. |
Methods
Name | Description | |
---|---|---|
Awake | Initializes the component. Should also be called in child classes. (Overrides UxrLocomotion.Awake().) | |
CancelOtherTeleportTargets | Cancels all other current teleport targets. When overriden in child classes the base class should be called too. | |
CancelTarget | Cancels the current teleport target. When overriden in child classes the base class should be called too. | |
HasBlockingRaycastHit | Checks whether the given raycast hits have any that are blocking. A blocking raycast can either be a valid or invalid teleport destination depending on many factors. Use IsValidDestination(Vector3, Vector3, Boolean) to check whether the given position is valid. This method filters out invalid raycasts such as against anything part of an avatar or a grabbed object. | |
IsValidTeleport | Checks if the teleport position is valid. | |
NotifyDestinationRaycast | Notifies a raycast was selected to be a potential destination. Computes whether the destination is valid. If it is, sets the appropriate internal state that can later be executed using TryTeleportUsingCurrentTarget(). | |
NotifyNoDestinationRaycast | Notifies that no raycast were found to be processed as a potential teleport destination. | |
OnDisable | Clear some states and unsubscribes from events. (Overrides UxrComponent<T>.OnDisable().) | |
OnEnable | Resets the component and subscribes to events. (Overrides UxrComponent<T>.OnEnable().) | |
TryTeleportUsingCurrentTarget | Tries to teleport the avatar using the current [!:TeleportPosition] and [!:TeleportDirection] values, only if the current destination is valid and the avatar isn’t currently being teleported. | |
UpdateLocomotion | Updates the locomotion and the avatar’s position/orientation the component belongs to. (Overrides UxrLocomotion.UpdateLocomotion().) | |
UpdateTeleportLocomotion | Can be overriden in child classes to execute the additional per-frame teleport locomotion logic. |
Extension Methods
Name | Description | |
---|---|---|
CheckSetEnabled | Enables/disabled the component if it isn’t enabled already. (Defined by MonoBehaviourExt.) | |
GetOrAddComponent<T> | Gets the Component of a given type. If it doesn’t exist, it is added to the GameObject. (Defined by ComponentExt.) | |
GetPathUnderScene | Gets the full path under current scene, including all parents, but scene name, for the given component. (Defined by ComponentExt.) | |
GetSceneUid | Gets an unique identifier string for the given component. (Defined by ComponentExt.) | |
GetUniqueScenePath | Gets an unique path in the scene for the given component. It will include scene name, sibling and component indices to make it unique. (Defined by ComponentExt.) | |
LoopCoroutine | Creates a coroutine that simplifies executing a loop during a certain amount of time. (Defined by MonoBehaviourExt.) | |
SafeGetComponentInParent<T> | Gets the Component of a given type in the GameObject or any of its parents. It also works on prefabs, where regular GetComponentInParent(Type, Boolean) will not work: https://issuetracker.unity3d.com/issues/getcomponentinparent-is-returning-null-when-the-gameobject-is-a-prefab (Defined by ComponentExt.) | |
ShowInInspector(Boolean) | Overloaded. Controls whether to show the current object in the inspector. (Defined by ObjectExt.) | |
ShowInInspector(Boolean, Boolean) | Overloaded. Controls whether to show the current object in the inspector and whether it is editable. (Defined by ObjectExt.) | |
ThrowIfNull | Throws an exception if the object is null. (Defined by ObjectExt.) |