Class XRTrackedDevice
A tracking device in a XR environment.
Implements
Inherited Members
Namespace: Evergine.Framework.XR.TrackedDevices
Assembly: Evergine.Framework.dll
Syntax
public abstract class XRTrackedDevice : DisposableObject, IDisposable
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 device handedness.
Declaration
protected XRHandedness handedness
Field Value
Type | Description |
---|---|
XRHandedness |
Properties
DeviceType
Gets the device type.
Declaration
public abstract XRTrackedDeviceType DeviceType { get; }
Property Value
Type | Description |
---|---|
XRTrackedDeviceType |
Handedness
Gets the device handedness.
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 device name.
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 supported joints by this controller.
Declaration
public virtual XRHandJointKind[] SupportedHandJointKind { get; }
Property Value
Type | Description |
---|---|
XRHandJointKind[] |
Methods
Destroy()
Destroy all resources of this instance.
Declaration
protected override void Destroy()
Overrides
FireOnConnectionChanged(bool)
Fire OnConnectionChanged event.
Declaration
protected void FireOnConnectionChanged(bool isConnected)
Parameters
Type | Name | Description |
---|---|---|
bool | isConnected | if the device is connected. |
FireOnPoseStatusChanged(bool)
Fire OnPoseStatusChanged event.
Declaration
protected void FireOnPoseStatusChanged(bool isPoseValid)
Parameters
Type | Name | Description |
---|---|---|
bool | isPoseValid | if 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 this device is not a controller. |
GetTrackingState(out XRTrackedDeviceState)
Gets the tracking state of this device.
Declaration
public abstract bool GetTrackingState(out XRTrackedDeviceState trckingState)
Parameters
Type | Name | Description |
---|---|---|
XRTrackedDeviceState | trckingState | The tracking state. |
Returns
Type | Description |
---|---|
bool | False if the device is not connected. |
TryGetArticulatedHandJoint(XRHandJointKind, out XRHandJoint)
Try get 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 that contains the renderable model. |
Events
OnConnectionChanged
Event fired when the connection status of this device has changed.
Declaration
public event EventHandler<bool> OnConnectionChanged
Event Type
Type | Description |
---|---|
EventHandler<bool> |
OnPoseStatusChanged
Event fired when the pose status has been changed.
Declaration
public event EventHandler<bool> OnPoseStatusChanged
Event Type
Type | Description |
---|---|
EventHandler<bool> |