Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Desktop Control Scheme #55

Merged
merged 5 commits into from
Aug 9, 2024
Merged

Desktop Control Scheme #55

merged 5 commits into from
Aug 9, 2024

Conversation

sebjf
Copy link
Member

@sebjf sebjf commented Aug 8, 2024

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).

@sebjf sebjf requested a review from bnco-dev August 8, 2024 11:20
@bnco-dev bnco-dev merged commit be85c78 into master Aug 9, 2024
1 check passed
@bnco-dev bnco-dev deleted the dev-desktopxrit branch August 9, 2024 10:16
@bnco-dev
Copy link
Contributor

bnco-dev commented Aug 9, 2024

Looks brilliant!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants