Class XRTrackedDevice
A tracking device in an XR environment.
Inherited Members
Namespace: Evergine.Framework.XR.TrackedDevices
Assembly: Evergine.Framework.dll
Syntax
public abstract class XRTrackedDevice : DisposableObject
Constructors
XRTrackedDevice(uint, XRHandedness)
Initializes a new instance of the XRTrackedDevice class.
Declaration
public XRTrackedDevice(uint id, XRHandedness handedness = XRHandedness.Undefined)
Parameters
Type | Name | Description |
---|---|---|
uint | id | The device ID. |
XRHandedness | handedness | The handedness. |
Fields
handedness
The handedness of the device.
Declaration
protected XRHandedness handedness
Field Value
Type | Description |
---|---|
XRHandedness |
Properties
DeviceType
Gets the type of the device.
Declaration
public abstract XRTrackedDeviceType DeviceType { get; }
Property Value
Type | Description |
---|---|
XRTrackedDeviceType |
Handedness
Gets the handedness of the device.
Declaration
public XRHandedness Handedness { get; }
Property Value
Type | Description |
---|---|
XRHandedness |
ID
Gets the device ID.
Declaration
public uint ID { get; }
Property Value
Type | Description |
---|---|
uint |
IsConnected
Gets or sets a value indicating whether the device is connected.
Declaration
public bool IsConnected { get; protected set; }
Property Value
Type | Description |
---|---|
bool |
Name
Gets the name of the device.
Declaration
public abstract string Name { get; }
Property Value
Type | Description |
---|---|
string |
PoseIsValid
Gets or sets a value indicating whether the pose is valid.
Declaration
public bool PoseIsValid { get; protected set; }
Property Value
Type | Description |
---|---|
bool |
SupportedHandJointKind
Gets the joints supported by this controller.
Declaration
public virtual XRHandJointKind[] SupportedHandJointKind { get; }
Property Value
Type | Description |
---|---|
XRHandJointKind[] |
Methods
Destroy()
Destroys all resources of this instance.
Declaration
protected override void Destroy()
Overrides
FireOnConnectionChanged(bool)
Fires the OnConnectionChanged event.
Declaration
protected void FireOnConnectionChanged(bool isConnected)
Parameters
Type | Name | Description |
---|---|---|
bool | isConnected | Indicates if the device is connected. |
FireOnPoseStatusChanged(bool)
Fires the OnPoseStatusChanged event.
Declaration
protected void FireOnPoseStatusChanged(bool isPoseValid)
Parameters
Type | Name | Description |
---|---|---|
bool | isPoseValid | Indicates whether the pose is valid. |
GetControllerState(out XRControllerGenericState)
Gets the controller state if this device is a controller.
Declaration
public abstract bool GetControllerState(out XRControllerGenericState controllerState)
Parameters
Type | Name | Description |
---|---|---|
XRControllerGenericState | controllerState | The controller state. |
Returns
Type | Description |
---|---|
bool | False if the device is not a controller. |
GetTrackingState(out XRTrackedDeviceState)
Gets the tracking state of this device.
Declaration
public abstract bool GetTrackingState(out XRTrackedDeviceState trackingState)
Parameters
Type | Name | Description |
---|---|---|
XRTrackedDeviceState | trackingState | The tracking state. |
Returns
Type | Description |
---|---|
bool | False if the device is not connected. |
TryGetArticulatedHandJoint(XRHandJointKind, out XRHandJoint)
Tries to get the hand joint by the specified joint kind.
Declaration
public virtual bool TryGetArticulatedHandJoint(XRHandJointKind jointKind, out XRHandJoint joint)
Parameters
Type | Name | Description |
---|---|---|
XRHandJointKind | jointKind | The joint kind. |
XRHandJoint | joint | The pose of the hand joint. |
Returns
Type | Description |
---|---|
bool | True if the specified joint kind is available. |
TryGetRenderableModelAsync()
Gets a renderable model for this tracked device.
Declaration
public abstract Task<XRRenderableModelInfo> TryGetRenderableModelAsync()
Returns
Type | Description |
---|---|
Task<XRRenderableModelInfo> | An awaitable task that returns the entity containing the renderable model. |
Events
OnConnectionChanged
Event fired when the connection status of this device changes.
Declaration
public event EventHandler<bool> OnConnectionChanged
Event Type
Type | Description |
---|---|
EventHandler<bool> |
OnPoseStatusChanged
Event fired when the pose status changes.
Declaration
public event EventHandler<bool> OnPoseStatusChanged
Event Type
Type | Description |
---|---|
EventHandler<bool> |