UxrController3DModel Class

Represents the 3D model of a VR controller. It allows to graphically render the current position/orientation and input state of the device.

Inheritance Hierarchy

System.Object
  Object
    Component
      Behaviour
        MonoBehaviour
          UltimateXR.Core.Components.UxrComponent
            UltimateXR.Devices.Visualization.UxrController3DModel
Namespace: UltimateXR.Devices.Visualization
Assembly: UltimateXR (in UltimateXR.dll) Version: 0.0.0.0

Syntax

C#

public class UxrController3DModel : UxrComponent


The UxrController3DModel type exposes the following members.

Constructors

NameDescription
Public methodUxrController3DModel

Properties

NameDescription
Public propertyControllerHand Gets or sets the hand that is interacting with the controller, when the controller is used with only one hand.
Public propertyControllerHandLeft Gets or sets the left hand that is interacting with the controller, when the controller can be held using both hands.
Public propertyControllerHandRight Gets or sets the right hand that is interacting with the controller, when the controller can be held using both hands.
Public propertyForward Gets the forward transform as it is currently in the scene. It can be different than the actual forward tracking when we use grab mechanics because the hand transform can be modified by the grab manager and the controller usually hangs from the hand hierarchy. If you need to know the forward controller transform using the information of tracking sensors without any intervention by external elements like the grabbing mechanics use ForwardTrackingRotation.
Public propertyForwardTrackingRotation Gets the rotation that represents the controller’s forward orientation. We use this mainly to be able to align certain mechanics no matter the controller that is currently active. A gun in a game needs to be aligned to the controller, teleport mechanics, etc.
Public propertyHandSide Gets the hand required to hold the controller, if NeedsBothHands is false.
Public propertyIsControllerVisible Gets or sets whether the controller is visible.
Public propertyIsHandVisible Gets or sets whether the hand, if present, is visible. In setups where both hands are used, it targets visibility of both hands.
Public propertyNeedsBothHands Gets whether the controller requires two hands to hold it.

Methods

NameDescription
Protected methodAwake Initializes the component. (Overrides UxrComponent.Awake().)
Public methodGetElements Gets the list of GameObjects that represent the given different controller input elements.
Public methodGetElementsMaterials Gets the list of materials of all objects that represent the given different controller input elements.
Public methodGetElementsOriginalMaterials Gets the list of original shared materials of all objects that represent the given different controller input elements. The original materials are the shared materials that the input elements had at the beginning, before any modifications.
Public methodRestoreElementsMaterials Restores the materials of the objects that represent the given different controller input elements.
Public methodSetElementsMaterial Changes the material of the objects that represent the given different controller input elements.
Public methodSwitchHandedness Changes the current hand to use the controller to the opposite side.
Public methodUpdateFromInput Updates the current visual state using the given input.

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