Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds the Desktop Control Scheme for the XRIT, and replaces the Device Simulator as the default keyboard and mouse interface for the XRIT Demo scene.
The scheme is implemented by creating a dedicated RayInteractor that is driven by the Main Camera. It is associated with an XR Controller instance, that isn't actually attached to a controller, but associated with a dedicated set of Action Maps that read typical FPS keyboard and mouse controls. On top of this a Canvas drives a cursor based on the state of the ray interactor, and presents some hints to encourage users to discover the controls. Locomotion is provided by a ContinuousMoveProviderBase subclass, and camera control with the mouse is facilitated by applying the Yaw to the XR Origin and Pitch to the Camera Offset.
This requires notifications for when the headset is added or removed, so the pitch can be reset. Common Notifications are defined in the XRNotification static class, and driven by the appropriate subsystem (for example, for WebXR the notifications are invoked in UbiqWebXRInitOnWebGL.cs
The Control Scheme is implemented as a single Prefab that can be dragged into any XR Interaction Setup hierarchy under the Camera Offset GameObject. References to the XR Origin and other systems are found automatically, so there is no setup. The scheme does not conflict with actual XR devices, so users do not need to turn it on or off.
The Control Scheme is delivered as part of the XRIT Samples - the only thing outside this that this PR touches is for the notifications, so once this PR is in, users can tweak things like the action maps and hints as they like, and we can more easily make changes too.
The Device Simulator has been removed from the XRIT Demo Scene, so that users are no longer required to import it when installing the XRIT.
(The Desktop Control Scheme interoperates with the Device Simulator however, just as it does actual XR devices, if users do want to import it).