C# Class HTC.UnityPlugin.Vive.ViveRole

Provide static APIs to retrieve device index by semantic role Same mapping logic as SteamVR_ControllerManager does
Show file Open project: Humon/server Class Usage Examples

Public Properties

Property Type Description
DefaultBodyRoleHandler HTC.UnityPlugin.Vive.BodyRoleHandler
DefaultDeviceRoleHandler HTC.UnityPlugin.Vive.DeviceRoleHandler
DefaultHandRoleHandler HTC.UnityPlugin.Vive.HandRoleHandler
DefaultTrackerRoleHandler HTC.UnityPlugin.Vive.TrackerRoleHandler

Public Methods

Method Description
GetDeviceIndex ( DeviceRole role ) : uint

Returns device index of the device identified by the role Returns INVALID_DEVICE_INDEX if the role doesn't assign to any device

GetDeviceIndex ( HandRole role ) : uint

Returns device index of the device identified by the role Returns INVALID_DEVICE_INDEX if the role doesn't assign to any device

GetDeviceIndexEx ( Type type, int roleValue ) : uint
GetDeviceIndexEx ( role ) : uint

Private Methods

Method Description
GetDeviceClass ( uint deviceIndex ) : VRModuleDeviceClass
GetModelNumber ( uint deviceIndex ) : string
GetSerialNumber ( uint deviceIndex ) : string
Initialize ( ) : void
IsValidIndex ( uint index ) : bool
OnDeviceConnected ( uint deviceIndex, bool connected ) : void
OnTrackedDeviceRoleChanged ( ) : void
TryGetDeviceIndexBySerialNumber ( string serialNumber, uint &deviceIndex ) : bool

Method Details

GetDeviceIndex() public static method

Returns device index of the device identified by the role Returns INVALID_DEVICE_INDEX if the role doesn't assign to any device
public static GetDeviceIndex ( DeviceRole role ) : uint
role DeviceRole
return uint

GetDeviceIndex() public static method

Returns device index of the device identified by the role Returns INVALID_DEVICE_INDEX if the role doesn't assign to any device
public static GetDeviceIndex ( HandRole role ) : uint
role HandRole
return uint

GetDeviceIndexEx() public static method

public static GetDeviceIndexEx ( Type type, int roleValue ) : uint
type Type
roleValue int
return uint

GetDeviceIndexEx() public static method

public static GetDeviceIndexEx ( role ) : uint
role /// TRole can be DeviceRole, TrackerRole or any other enum type that have ViveRoleEnumAttribute. /// Use ViveRole.ValidateViveRoleEnum() to validate role type ///
return uint

Property Details

DefaultBodyRoleHandler public static property

public static BodyRoleHandler,HTC.UnityPlugin.Vive DefaultBodyRoleHandler
return HTC.UnityPlugin.Vive.BodyRoleHandler

DefaultDeviceRoleHandler public static property

public static DeviceRoleHandler,HTC.UnityPlugin.Vive DefaultDeviceRoleHandler
return HTC.UnityPlugin.Vive.DeviceRoleHandler

DefaultHandRoleHandler public static property

public static HandRoleHandler,HTC.UnityPlugin.Vive DefaultHandRoleHandler
return HTC.UnityPlugin.Vive.HandRoleHandler

DefaultTrackerRoleHandler public static property

public static TrackerRoleHandler,HTC.UnityPlugin.Vive DefaultTrackerRoleHandler
return HTC.UnityPlugin.Vive.TrackerRoleHandler