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
Name | Description | |
---|---|---|
UxrController3DModel |
Properties
Name | Description | |
---|---|---|
ControllerHand | Gets or sets the hand that is interacting with the controller, when the controller is used with only one hand. | |
ControllerHandLeft | Gets or sets the left hand that is interacting with the controller, when the controller can be held using both hands. | |
ControllerHandRight | Gets or sets the right hand that is interacting with the controller, when the controller can be held using both hands. | |
Forward | 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. | |
ForwardTrackingRotation | 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. | |
HandSide | Gets the hand required to hold the controller, if NeedsBothHands is false. | |
IsControllerVisible | Gets or sets whether the controller is visible. | |
IsHandVisible | Gets or sets whether the hand, if present, is visible. In setups where both hands are used, it targets visibility of both hands. | |
NeedsBothHands | Gets whether the controller requires two hands to hold it. |
Methods
Name | Description | |
---|---|---|
Awake | Initializes the component. (Overrides UxrComponent.Awake().) | |
GetElements | Gets the list of GameObjects that represent the given different controller input elements. | |
GetElementsMaterials | Gets the list of materials of all objects that represent the given different controller input elements. | |
GetElementsOriginalMaterials | 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. | |
RestoreElementsMaterials | Restores the materials of the objects that represent the given different controller input elements. | |
SetElementsMaterial | Changes the material of the objects that represent the given different controller input elements. | |
SwitchHandedness | Changes the current hand to use the controller to the opposite side. | |
UpdateFromInput | Updates the current visual state using the given input. |
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.) |