Haply::Inverse::Unity::VerseGrip
Represents a VerseGrip device, handling its state and interactions.
Inherits from Haply.Inverse.Unity.DeviceBehaviour, MonoBehaviour
Public Events
Name | |
---|---|
DeviceDelegate | DeviceStateChanged() Event triggered when the state of the VerseGrip device changes. |
Public Functions
Name | |
---|---|
delegate void | DeviceDelegate(VerseGrip verseGrip) Delegate for handling VerseGrip state changes. |
bool | GetButton(VerseGripButton button =VerseGripButton.Button0) Returns true while the user holds down the button. |
bool | GetButtonDown(VerseGripButton button =VerseGripButton.Button0) Returns true during the frame when the user starts pressing the specified button. |
bool | GetButtonUp(VerseGripButton button =VerseGripButton.Button0) Returns true during the frame when the user starts releasing the specified button. |
Public Properties
Name | |
---|---|
override DeviceType | DeviceType |
override CursorBehaviour | Cursor |
Quaternion | LocalRotation |
Quaternion | Orientation VerseGrip orientation. |
bool | IsAttached Indicates whether the VerseGrip is attached to the Inverse3. |
Protected Properties
Name | |
---|---|
override BaseCoordinateConverter | CoordinateConverter |
Public Attributes
Name | |
---|---|
UnityEvent< VerseGrip > | Attached Event triggered when the VerseGrip is attached to a device. |
UnityEvent< VerseGrip > | Detached Event triggered when the VerseGrip is detached from a device. |
UnityEvent< VerseGrip, VerseGripButton > | ButtonDown Event triggered when a VerseGrip button is pressed down. |
UnityEvent< VerseGrip, VerseGripButton > | ButtonUp Event triggered when a VerseGrip button is released. |
Additional inherited members
Public Events inherited from Haply.Inverse.Unity.DeviceBehaviour
Name | |
---|---|
Action< DeviceBehaviour, Ret > | ErrorEvent() |
ConnectionStateDelegate | ConnectionStateChanged() Event triggered when the device connection state changes. |
Action< DeviceBehaviour, DeviceConnectionState, DeviceConnectionState > | ConnectionStateChangedAsync() Event triggered shortly after the device connection state changes. |
Public Functions inherited from Haply.Inverse.Unity.DeviceBehaviour
Name | |
---|---|
delegate void | ConnectionStateDelegate(DeviceBehaviour device, DeviceConnectionState state, DeviceConnectionState prevState) Delegate for handling connection state changes of the device. |
void | SetSetupToPerform() Indicate to perform setup on next frame. |
override string | ToString() Returns a string representation of the object, providing a human-readable description that includes the object's name, class type, and device ID. |
Protected Functions inherited from Haply.Inverse.Unity.DeviceBehaviour
Name | |
---|---|
virtual void | Setup() This method is automatically called once the _performSetup flag is set to handle consuming calculations too heavy to be called on each frame. |
virtual void | Awake() |
void | OnEnable() |
void | OnDisable() |
void | OnDestroy() |
virtual void | FixedUpdate() |
Public Properties inherited from Haply.Inverse.Unity.DeviceBehaviour
Name | |
---|---|
int | SelectedDeviceId |
uint | DeviceId Gets the device ID. |
DeviceConnectionState | ConnectionState Gets or sets the current connection state of the device. |
bool | IsConnected Gets whether the device is connected. |
bool | IsOpened Gets whether the device is opened. |
bool | IsReady |
Protected Properties inherited from Haply.Inverse.Unity.DeviceBehaviour
Name | |
---|---|
bool | IsCursorSet Indicates whether the Cursor has been set. |
Public Attributes inherited from Haply.Inverse.Unity.DeviceBehaviour
Name | |
---|---|
const int | ANY_ID |
UnityEvent< DeviceBehaviour > | DeviceOpened Event triggered when the ConnectionState transitions to the DeviceConnectionState.Opened state. |
UnityEvent< DeviceBehaviour > | DeviceClosed Event triggered when the ConnectionState transitions to the DeviceConnectionState.Connected state. |
Protected Attributes inherited from Haply.Inverse.Unity.DeviceBehaviour
Name | |
---|---|
string | _objectName |
Public Events Documentation
event DeviceStateChanged
DeviceDelegate DeviceStateChanged()
Event triggered when the state of the VerseGrip device changes.
See: ClientConfiguration.HapticPollFrequency
This event is useful for responding to changes in the device's orientation or button presses in real-time. During this event, you can use properties such as LocalRotation, GetButton or IsAttached.
The frequency at which this event is triggered is determined by the haptic loop frequency, which can be configured via ClientConfiguration.HapticPollFrequency.
Public Functions Documentation
function DeviceDelegate
delegate void DeviceDelegate(
VerseGrip verseGrip
)
Delegate for handling VerseGrip state changes.
Parameters:
- verseGrip The VerseGrip device that triggered the event.
function GetButton
bool GetButton(
VerseGripButton button =VerseGripButton.Button0
)
Returns true while the user holds down the button.
Parameters:
- button The button to check.
Return: True if the button is pressed, false otherwise.
function GetButtonDown
bool GetButtonDown(
VerseGripButton button =VerseGripButton.Button0
)
Returns true during the frame when the user starts pressing the specified button.
Parameters:
- button The button to check.
See: ButtonDown, ButtonUp, DeviceStateChanged, GetButton, GetButtonUp
Return: True if the button is pressed this frame, false otherwise.
This method should be called within the DeviceStateChanged event callback to function correctly. Calling it from the main thread may miss the frame when the button state changes. For main thread usage, it is preferable to use the ButtonDown event.
function GetButtonUp
bool GetButtonUp(
VerseGripButton button =VerseGripButton.Button0
)
Returns true during the frame when the user starts releasing the specified button.
Parameters:
- button The button to check.
See: ButtonDown, ButtonUp, DeviceStateChanged, GetButton, GetButtonDown
Return: True if the button was released this frame, false otherwise.
This method should be called within the DeviceStateChanged event callback to function correctly. Calling it from the main thread may miss the frame when the button state changes. For main thread usage, it is preferable to use the ButtonUp event.
Public Property Documentation
property DeviceType
override DeviceType DeviceType;
property Cursor
override CursorBehaviour Cursor;
This property overrides the base DeviceBehaviour.Cursor property and can be safely cast to VerseGripCursor. Setting this property also updates the DeviceBehaviour._performSetup flag.
property LocalRotation
Quaternion LocalRotation;
property Orientation
Quaternion Orientation;
VerseGrip orientation.
The device DeviceBehaviour.ConnectionState must be DeviceConnectionState.Opened first to get a consistent value.
property IsAttached
bool IsAttached;
Indicates whether the VerseGrip is attached to the Inverse3.
Protected Property Documentation
property CoordinateConverter
override BaseCoordinateConverter CoordinateConverter;
Public Attributes Documentation
variable Attached
UnityEvent< VerseGrip > Attached;
Event triggered when the VerseGrip is attached to a device.
This event is dispatched on the main thread, allowing for safe interactions with Unity scene objects and UI elements. Note that the device state is updated on a separate high-frequency thread, so the state at the time of the event might differ slightly from the current state when handling the event.
variable Detached
UnityEvent< VerseGrip > Detached;
Event triggered when the VerseGrip is detached from a device.
This event is dispatched on the main thread, allowing for safe interactions with Unity scene objects and UI elements. Note that the device state is updated on a separate high-frequency thread, so the state at the time of the event might differ slightly from the current state when handling the event.
variable ButtonDown
UnityEvent< VerseGrip, VerseGripButton > ButtonDown;
Event triggered when a VerseGrip button is pressed down.
This event is dispatched on the main thread, allowing for safe interactions with Unity scene objects and UI elements. Note that the device state is updated on a separate high-frequency thread, so the state at the time of the event might differ slightly from the current state when handling the event.
variable ButtonUp
UnityEvent< VerseGrip, VerseGripButton > ButtonUp;
Event triggered when a VerseGrip button is released.
This event is dispatched on the main thread, allowing for safe interactions with Unity scene objects and UI elements. Note that the device state is updated on a separate high-frequency thread, so the state at the time of the event might differ slightly from the current state when handling the event.