Architecture Overview
If you haven’t worked with a tool like Interaction SDK before, there are many concepts and patterns that will be new to you. This high-level overview will explain what happens before, during, and after an interaction (which is an action, like a grab or teleport) so you’re aware of the concepts and patterns you’ll encounter in the SDK.
Your input method (hands, controllers, or both) rely on tracking data from your headset’s cameras and controllers to interact with the virtual environment. Although this is listed as Stage 1, Interaction SDK is
always processing input. For an overview of how the SDK gets tracking data from the headset, modifies it (if you desire), and then sends it to your hands or controllers, see
Input Data Overview.
Data flowing from the headset to the controllers and hands.
Stage 2: Interactor looks for interactable
After getting the data from your headset, Interaction SDK knows where your hand or controller is positioned, so as you move your hand or controller around, the
interactor attached to it will search the scene for a matching
interactable. Each interactor only looks for interactables that match its type (ex. a
Grab interactor will only look for a
Grab interactable). To learn how to add interactors to your hand or controller, see the
Tutorials section in the sidebar.
Interactors on the active input method (controllers or hands) looking for matching interactables.
Stage 3: Interactor detects an interactable
- If you’re using hands, your hands must match that action’s unique Pose (ex. For a poke, the pointer finger is extended).
- If you’re using controllers, you must be partially pressing the button that performs that action (ex. For a grab, you partially pull the trigger).
- Your hand or controller are close enough to the interactable.
- No other Interactors on the same hand or controller are currently selecting. This is because only one Interactor per hand can be selecting at a time.
If those conditions are true and there’s only one interactor on your hand or controller, then the interactor enters the
Hover state. If the hand or controller has multiple interactors, then an
Interactor Group decides which interactor enters the
Hover state.
A snap interactor on the active input method (controllers or hands) finding a matching interactable.
An example of how the interactor must meet the conditions specified above in order to successfully detect an interactable. Here, a hand with a Poke interactor is trying to interact with a panel. At first, the pose is correct, but the hand isn’t close enough to the interactable. Then the hand is close enough, but the pose is incorrect (the pointer finger isn’t extended). Finally, the pose is correct and the hand is close enough, so the Poke interactor enters a Hover state, indicated by the button glowing light grey.
Stage 4: Interactor selects interactable
Once an interactor is in the Hover state, it can go to the Select state by completing the action. For example, poking a button or grabbing an object instead of just hovering over it.
A hand selecting a button and grabbing a cube. In both cases, the hand’s interactor is already in the Hover state and so it transitions to the Select state.
Stage 5: Selected interactable moves
Although the interactor is in the
Select state, it doesn’t cause the interactable to move. Movement is handled behind the scenes by other components, like
Grabbable.
Stage 6: Interactor deselects interactable
Once you release the object, the interactor transitions back to a Hover state and then the Normal (default) state.