class MAGES::Drivers::XR::XRDriver¶
Overview¶
A driver using Unity XR. More…
class XRDriver: public MAGES::IDriver { public: // classes class VirtualController; // properties string Name; int DefaultSortOrder; UnityEvent<DriverEvent> OnDriverEvent; DriverType DriverType; bool IsAvailable; List<XRLoaderOffset> XRLoaderOffsets; // methods void Initialize(); void Possess(Rig rig); void Update(UpdatePhase updatePhase); void UnPossess(); void Deinitialize(); bool TrySendHapticImpulse( DeviceManagerModule.Device device, float intensity, float duration ); bool IsDeviceAvailable(DeviceManagerModule.Device device); };
Inherited Members¶
public: // properties bool IsAvailable; UnityEvent<DriverEvent> OnDriverEvent; DriverType DriverType; string Name; int DefaultSortOrder; // methods void Initialize(); void Possess(ComponentLibrary.Framework.Rig rig); void Update(UpdatePhase updatePhase); void UnPossess(); void Deinitialize(); bool TrySendHapticImpulse( DeviceManagerModule.Device device, float intensity, float duration ); bool IsDeviceAvailable(DeviceManagerModule.Device device);
Detailed Documentation¶
A driver using Unity XR.
Properties¶
string Name
Gets the driver name.
int DefaultSortOrder
Gets the default sort order of the driver. When the driver is loaded from the DeviceManager, the drivers are sorted by this value. The user can then change the order of the drivers in the DeviceManager.
UnityEvent<DriverEvent> OnDriverEvent
Gets the driver event.
DriverEvent instances are valid only for the duration of the event.
DriverType DriverType
Gets the driver type.
bool IsAvailable
Gets a value indicating whether the driver is available.
List<XRLoaderOffset> XRLoaderOffsets
Gets or sets the offset of the controllers for different loaders.
Methods¶
void Initialize()
<inheritdoc cref=”IDriver.Initialize/>
void Possess(Rig rig)
Drive the rig.
Parameters:
rig |
The rig to drive. |
void Update(UpdatePhase updatePhase)
Update callback. Called in each update phase.
Update is called always, even if the rig is not possessed by this driver.
void UnPossess()
Stop driving the rig.
Parameters:
rig |
The rig. |
void Deinitialize()
Called right before the device manager shuts down.
bool TrySendHapticImpulse( DeviceManagerModule.Device device, float intensity, float duration )
Tries to send a haptic impulse to the device.
Parameters:
device |
The device. |
intensity |
The impulse intensity. |
duration |
The impulse durtation. |
Returns:
true
if the impulse was sent.
bool IsDeviceAvailable(DeviceManagerModule.Device device)
Checks if the device is available (There is tracking for the transform responsible for it).
Parameters:
device |
The device |
Returns:
true
if the device is available.