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

NameDescription
Protected methodUxrTeleportLocomotionBase

Properties

NameDescription
Public propertyBlockingTargetLayers Gets or sets the layers which should be considered when ray-casting looking for either valid or invalid teleportation surfaces.
Protected propertyCanBackStep Gets whether the avatar can currently receive input to step backwards.
Protected propertyCanRotate Gets whether the avatar can currently receive input to rotate around.
Protected propertyControllerForward Gets the smoothed direction of ray-casting when starts on the controller.
Protected propertyControllerStart Gets the smoothed source of ray-casting when it starts on the controller.
Public propertyDestinationValidationRadius Gets or sets the radius of a cylinder used when validating if a teleport destination is valid.
Public propertyFadeRotationColor Gets or sets the fade color when using Fade translation teleporting.
Public propertyFadeRotationSeconds Gets or sets the transition duration in seconds for the Fade rotation type.
Public propertyFadeTranslationColor Gets or sets the fade color when using Fade translation teleporting.
Public propertyFadeTranslationSeconds Gets or sets the transition duration in seconds for the Fade translation type.
Public propertyHandSide Gets the hand used to control the teleport component.
Public propertyInvalidMaterialColorTargets When ShowTargetAlsoWhenInvalid is true, sets the teleport target color used when the destination is invalid.
Protected propertyIsAllowedToTeleport Gets whether the component is currently allowed to teleport the avatar.
Protected propertyIsOtherComponentTeleporting Gets whether other teleport component is currently teleporting the avatar.
Protected propertyIsTeleporting Gets or sets whether the component is currently teleporting the avatar.
Protected propertyLayerMaskRaycast Gets the LayerMask used for ray-casting either valid or invalid teleport destinations.
Public propertyMaxAllowedDistance Gets or sets the maximum teleport distance.
Public propertyMaxAllowedHeightDifference Gets or sets the maximum height difference allowed from the current position to a destination.
Public propertyMaxAllowedSlopeDegrees Gets or sets the maximum slop for a destination to be considered valid.
Protected propertyParentToDestination Gets or sets whether to parent the avatar to the destination object (TeleportReference) after teleporting. This can also be overriden using a UxrParentAvatarDestination component.
Public propertyPrecachedInstances Gets the GameObjects, usually prefabs, that will be precached when the scene is loaded.
Public propertyReorientationType Gets or sets how the teleport target direction is set.
Public propertyRotationStepDegrees Gets or sets the amount of degrees rotated around the avatar axis when the user presses the left or right joystick buttons.
Public propertyRotationType Gets or sets the teleport rotation type.
Public propertyShowTargetAlsoWhenInvalid Gets or sets whether the target should also be visible when the teleport destination is not valid.
Public propertySmoothRotationSeconds Gets or sets the transition duration in seconds for the Smooth rotation type.
Public propertySmoothTranslationSeconds Gets or sets the transition duration in seconds for the Smooth translation type.
Public propertyTarget Gets or sets the target object.
Public propertyTargetPlacementAboveHit Gets or sets the distance above the ground the target is positioned.
Protected propertyTeleportLocalDirection Gets or sets the current teleport direction in in TeleportReference space. If TeleportReference is null, it will be considered as world-space rotation.
Protected propertyTeleportLocalPosition Gets or sets the current teleport destination in TeleportReference space. If TeleportReference is null, it will be considered as world-space position.
Protected propertyTeleportReference 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.
Public propertyTranslationType Gets or sets the teleport translation type.
Public propertyTriggerCollidersInteraction Gets or sets the behaviour for raycasts against trigger volumes.
Public propertyValidMaterialColorTargets When ShowTargetAlsoWhenInvalid is true, sets the teleport target color used when the destination is valid.
Public propertyValidTargetLayers Gets or sets the layers over which teleportation is allowed.

Methods

NameDescription
Protected methodAwake Initializes the component. Should also be called in child classes. (Overrides UxrLocomotion.Awake().)
Protected methodCancelOtherTeleportTargets Cancels all other current teleport targets. When overriden in child classes the base class should be called too.
Protected methodCancelTarget Cancels the current teleport target. When overriden in child classes the base class should be called too.
Protected methodHasBlockingRaycastHit 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.
Protected methodIsValidTeleport Checks if the teleport position is valid.
Protected methodNotifyDestinationRaycast 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().
Protected methodNotifyNoDestinationRaycast Notifies that no raycast were found to be processed as a potential teleport destination.
Protected methodOnDisable Clear some states and unsubscribes from events. (Overrides UxrComponent<T>.OnDisable().)
Protected methodOnEnable Resets the component and subscribes to events. (Overrides UxrComponent<T>.OnEnable().)
Protected methodTryTeleportUsingCurrentTarget 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.
Protected methodUpdateLocomotion Updates the locomotion and the avatar’s position/orientation the component belongs to. (Overrides UxrLocomotion.UpdateLocomotion().)
Protected methodUpdateTeleportLocomotion Can be overriden in child classes to execute the additional per-frame teleport locomotion logic.

Extension Methods

NameDescription
Public Extension MethodCheckSetEnabled Enables/disabled the component if it isn’t enabled already. (Defined by MonoBehaviourExt.)
Public Extension MethodGetOrAddComponent<T> Gets the Component of a given type. If it doesn’t exist, it is added to the GameObject. (Defined by ComponentExt.)
Public Extension MethodGetPathUnderScene Gets the full path under current scene, including all parents, but scene name, for the given component. (Defined by ComponentExt.)
Public Extension MethodGetSceneUid Gets an unique identifier string for the given component. (Defined by ComponentExt.)
Public Extension MethodGetUniqueScenePath 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.)
Public Extension MethodLoopCoroutine Creates a coroutine that simplifies executing a loop during a certain amount of time. (Defined by MonoBehaviourExt.)
Public Extension MethodSafeGetComponentInParent<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.)
Public Extension MethodShowInInspector(Boolean)Overloaded.
Controls whether to show the current object in the inspector. (Defined by ObjectExt.)
Public Extension MethodShowInInspector(Boolean, Boolean)Overloaded.
Controls whether to show the current object in the inspector and whether it is editable. (Defined by ObjectExt.)
Public Extension MethodThrowIfNull Throws an exception if the object is null. (Defined by ObjectExt.)

See Also

Reference

UltimateXR.Locomotion Namespace