UxrTrackingDevice Class

Base class for tracking devices.

Inheritance Hierarchy

System.Object
  Object
    Component
      Behaviour
        MonoBehaviour
          UltimateXR.Core.Components.UxrComponent
            UltimateXR.Core.Components.UxrComponent(UxrTrackingDevice)
              UltimateXR.Core.Components.Composite.UxrAvatarComponent(UxrTrackingDevice)
                UltimateXR.Devices.UxrTrackingDevice
                  UltimateXR.Devices.UxrControllerTracking
                  UltimateXR.Devices.UxrHandTracking
Namespace: UltimateXR.Devices
Assembly: UltimateXR (in UltimateXR.dll) Version: 0.0.0.0

Syntax

C#

public abstract class UxrTrackingDevice : UxrAvatarComponent<UxrTrackingDevice>, 
	IUxrTrackingDevice, IUxrDevice


The UxrTrackingDevice type exposes the following members.

Constructors

NameDescription
Protected methodUxrTrackingDevice

Properties

NameDescription
Public propertyStatic memberHeadsetDeviceName Gets the headset device name.
Public propertySDKDependency Gets the SDK the implemented device needs in order to be available. It should be null or empty if there is no SDK dependency. Otherwise is should use any of the SDK names in UxrManager. For example if requires the Oculus SDK, it should return SdkOculus.
Public propertyTrackingUpdateOrder There are cases where more than one tracking device might be active. We use TrackingUpdateOrder for cases where there is one that should be applied after the other(s). For example an Oculus Rift together with a Leap Motion setup has one tracking component for each. But Leap Motion should override the tracking values of the rift controllers if the Leap Motion component is active. In this case Oculus, like most tracking devices, has a value of OrderStandard while Leap Motion has a value of OrderPostprocess so that the tracking devices update the avatar in the correct order.

Methods

NameDescription
Public methodStatic memberGetHeadsetDevice Tries to get the connected headset device.
Protected methodOnAvatarUpdated Event trigger for the AvatarUpdated event. Can be used to override in child classes in order to use the event without subscribing to the parent.
Protected methodOnAvatarUpdating Event trigger for the AvatarUpdating event. Can be used to override in child classes in order to use the event without subscribing to the parent.
Protected methodOnDestroy Sets events to null in order to help remove unused references. (Overrides UxrComponent<T>.OnDestroy().)
Protected methodOnDeviceConnected Event trigger for the DeviceConnected event. Can be used to override in child classes in order to use the event without subscribing to the parent.
Protected methodOnSensorsUpdated Event trigger for the SensorsUpdated event. Can be used to override in child classes in order to use the event without subscribing to the parent.
Protected methodOnSensorsUpdating Event trigger for the SensorsUpdating event. Can be used to override in child classes in order to use the event without subscribing to the parent.
Protected methodUpdateAvatar Overriden in child classes to implement the update of the avatar using the current sensor data.
Protected methodUpdateSensors Overriden in child classes to implement the update of the current sensor data.

Events

NameDescription
Public eventAvatarUpdated Event called right after updating an avatar with the current sensor data.
Public eventAvatarUpdating Event called right before updating an avatar with the current sensor data.
Public eventDeviceConnected Event called whenever the device is connected or disconnected
Public eventSensorsUpdated Event called right after updating sensor data.
Public eventSensorsUpdating Event called right before updating sensor data.

Fields

NameDescription
Public fieldStatic memberOrderPostprocess Default update order for post-process tracking devices such as hand-tracking.
Public fieldStatic memberOrderStandard Default update order.

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.Devices Namespace