Desktop Focus Mode
Given the very significant difference in interaction capabilities between a VR headset and a mouse-driven 3D computer application, it can be complicated to develop a tool or a user interface that works well in both cases. To facilitate prototyping, the "Desktop Focus" module enables the user interface to be switched to a mode optimized for mouse control.
Desktop Focus Manager
DesktopFocusManager is in charge to manage focus requests from objects in the scene.
It provides a public
GiveFocus method that is called by
DesktopFocus objects when they need the focus.
If an object already had the focus, it loses it and the focus is allocated to the new requester.
When the focus is assigned, desktop rig camera is disabled, the
focusCamera camera child object is activated and moved to the position specified by the requester thanks to the
Also, if the
DesktopFocus object defines a specific UI (i.e. canvas), it is enabled.
Finally, desktop rig control elements are deactivated (
mouseTeleport) in order to use the
DesktopFocus object UI properly.
DesktopFocus objects search for the
When the focus mode is activated :
CameraAnchoris used to define the camera position,
- a list of canvas to be displayed can be specified,
- a list of renderers to be hidden can be specified,
In this way, the UI interface can be optimized for each tool.
It is also possible to define a previous/next
DesktopFocus object: indeed, in some use cases, it can be usefull to chain focus objects so that the user can navigate between
DesktopFocus objects without returning to the normal mode.
A demo scene can be found in
The scene contains 3 panels.
Each panel contains a
DesktopFocus component, while a
DesktopFocusManager and a
FocusCamera are located under the
The focus mode can be activated using the button under each panel.
When the focus mode is activated, the player can see the other panels by using the left or right arrow keys on the keyboard.
Focus mode can be deactivated using the "Esc" key.
This addon latest version is included into the addon project
- shared mode
- Version 1.0.2: Namespace modification
- Version 1.0.1: Add demo scene + Fix typo + add a context menu for ToggleFocus + add namespace
- Version 1.0.0: First release