VR Development Framework
v 1.0.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
Public Types | Static Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Attributes | Private Attributes | List of all members
AVR.Core.AVR_GenericXRDevice Class Reference

Represents some spatially tracked XR device. Provides functionality for spacial tracking. Can be used to represent hardware trackers, game controllers or other references. More...

Inheritance diagram for AVR.Core.AVR_GenericXRDevice:
AVR.Core.AVR_Component AVR.Core.AVR_Behaviour AVR.Core.AVR_Controller

Public Types

enum  TrackingUpdateType { TrackingUpdateType.OnUpdate, TrackingUpdateType.OnBeforeRender, TrackingUpdateType.OnBeforeRenderAndUpdate }
 Defines when positional tracking should take place. Recommended setting is OnBeforeRenderAndUpdate More...
 

Static Public Member Functions

static AVR_GenericXRDevice getDeviceAtNode (XRNode node)
 Returns the last AVR_GenericXRDevice enabled that has a given controllerNode value. More...
 

Public Attributes

XRNode controllerNode
 Which XRNode this object represents. More...
 
InputDevice inputDevice => _inputDevice.isValid ? _inputDevice : _inputDevice = InputDevices.GetDeviceAtXRNode(controllerNode)
 XR.Inputdevice that this controller represents. More...
 
bool tracking = true
 Defines if spatial tracking should be performed. More...
 
TrackingUpdateType updateType
 Defines when positional tracking should take place. Recommended setting is OnBeforeRenderAndUpdate More...
 
bool smoothing = false
 Defines if positional tracking is smoothed across several frames. Makes controllers less shaky. More...
 
float smoothingFidelity = 0.3f
 Defines the amount of smoothing. More...
 
- Public Attributes inherited from AVR.Core.AVR_Component
UnityEngine.Events.UnityEvent onAwake
 Events called when this component awakes. More...
 
UnityEngine.Events.UnityEvent onStart
 Events called when this component starts. More...
 
UnityEngine.Events.UnityEvent onEnable
 Events called when this component is enabled. More...
 
UnityEngine.Events.UnityEvent onDisable
 Events called when this component is disabled. More...
 

Protected Member Functions

override void Awake ()
 
void UpdateTracking ()
 Updates the controller position and rotation. More...
 
void OnBeforeRender ()
 
void Update ()
 
override void OnEnable ()
 
override void OnDisable ()
 
- Protected Member Functions inherited from AVR.Core.AVR_Component
virtual void Start ()
 

Static Protected Attributes

static Dictionary< XRNode,
AVR_GenericXRDevice
nodeDevices = new Dictionary<XRNode, AVR_GenericXRDevice>()
 

Private Attributes

InputDevice _inputDevice
 
Vector3 prevPos = Vector3.zero
 
Quaternion prevRot = Quaternion.identity
 

Additional Inherited Members

- Public Member Functions inherited from AVR.Core.AVR_Behaviour
virtual void OnDestroy ()
 
- Protected Attributes inherited from AVR.Core.AVR_Behaviour
AVR_PlayerRig playerRig => AVR_PlayerRig.Instance
 The current AVR_PlayerRig instance in the scene More...
 
AVR_Root root => AVR_Root.Instance
 The current AVR_Root instance in the scene More...
 
bool vrEnabled => UnityEngine.XR.XRSettings.enabled
 True if the application is running as a VR/XR application More...
 

Detailed Description

Represents some spatially tracked XR device. Provides functionality for spacial tracking. Can be used to represent hardware trackers, game controllers or other references.

Definition at line 13 of file AVR_GenericXRDevice.cs.