-
Notifications
You must be signed in to change notification settings - Fork 162
Input Modules꞉ OculusTouch
This module converts various positions on the Oculus Touch controllers into cursors. The module's main component provides several per-cursor properties to configure positional offsets, the ability to follow "avatar" (OvrAvatar) transforms, and options for trigger/size input sources.
📷 Default cursor positions for the Oculus Touch controllers
This animation shows all the available cursors enabled simultaneously. A more common usage would be to enable only one or two cursors per controller. The "Pinky" cursors, which are placed on the "inside edge" of both controllers, are pre-configured for use with the Hovercast interface. This includes the use of a "push thumbstick to the outer edge" gesture for engaging the Hovercast "back" button.
This input module is compatible with Oculus Utilities for Unity 5, and includes optional support for the Oculus "Avatar" SDK.
Important note: The default "Avatar" hand and controller materials always render on top of transparent Hover UI items. This can be resolved by making a simple shader file change, and then applying a non-transparent material to the hand models. See these detailed instructions.
The input module scene is named HoverInputModule-OculusTouch, located in the /Assets/Hover/InputModules/OculusTouch/Scenes
folder.
See the Input Modules page for details about loading input module scenes and defining symbols. To install this input module via its pre-built scene:
- Attach the
HoverSceneLoader
component to an object.- For the "Scene Folder Path" and "Scene Name" properties, replace the "NAME" placeholder text with "OculusTouch".
- To load the scene before runtime, click the "Reload Scene" button.
- Define the
HOVER_INPUT_OCULUSTOUCH
symbol.
To install this module manually:
- Add the OVRCameraRig prefab to the scene.
- Add the LocalAvatar prefab to your scene (optional).
- Attach the
HoverInputOculusTouch
component to the OVRCameraRig prefab's root object. - Define the
HOVER_INPUT_OCULUSTOUCH
symbol.
📷 The
HoverInputOculusTouch
component, with per-cursor properties
- The "Cursor Data Provider" property will automatically attempt to find the
HoverCursorDataProvider
component (in the HoverKit prefab). - The "Avatar" and "Look Cursor Transform" properties will be set automatically.
- The per-cursor property groups (like "Left Palm" or "Right Index") are pre-configured with default values.
The following properties can be set independently for each cursor:
Property | Description |
---|---|
Local Position/Rotation | Applied to the cursor as local offsets from the controller center. |
Should Follow Avatar Element | Uses an OvrAvatar transform to set cursor position/rotation (ignoring the local offsets). By default, this is used for "index" and "thumb" cursors, since the OvrAvatar hand models move those two fingers based on the current pose. |
Avatar Element Name | The name of the desired OvrAvatar transform to follow. Oculus Touch generates these transforms at runtime, so they must be found via name. |
Trigger Strength Input | The axis/button that controls the cursor's "Trigger Strength". |
Cursor Size Input | The axis/button that controls the cursor's "Size". |
Min/Max Size | The cursor's size boundaries. By default, the cursor is sized via the midpoint between these two values. |
The two "Input" properties allow the following selections:
Option | Description |
---|---|
None | Ignores input, defaults to 0% (trigger strength) or 50% (cursor size). |
Index Trigger | Uses the index-finger trigger's linear value. |
Hand Trigger | Uses the hand/squeeze trigger's linear value. |
Button 1 Press | Uses the first ("A" or "X") button's boolean value. |
Button 2 Press | Uses the second ("B" or "Y") button's boolean value. |
Start Press | Uses the third button's boolean value (only works for the left controller). |
Thumbstick Press | Uses the thumbstick button's boolean value. |
Thumbstick Y | Uses the thumbstick's linear value from down to up. |
Thumbstick Up | Uses the thumbstick's linear value from center to up. |
Thumbstick Down | Uses the thumbstick's linear value from center to down. |
Thumbstick X | Uses the thumbstick's linear value from left to right. |
Thumbstick Left | Uses the thumbstick's linear value from center to left. |
Thumbstick Right | Uses the thumbstick's linear value from center to right. |
📷 All cursors set to "Is Raycast" mode
This animation shows all the available cursors projecting raycast lines. Typically, a scene the requires raycast functionality would enable only one cursor per controller.
General
Features
Modules
Other