expressxrrig - eisclimber/ExPresS-XR GitHub Wiki
Class in ExPresSXR.Rig
Inherits from UnityEngine.MonoBehaviour
The main configurable GameObject for XR, having all necessary components for any form of interaction as children of this one GameObject.
The rig supports three different types of input methods:
- Controller: Used with a complete VR Headset and controllers. Using this allows for the most immersive XR experience.
- Head Gaze: Used with for Smartphone applications but also compatible with VR headsets without requiring controllers.
- Eye Gaze: Used with for Smartphone applications but also compatible with VR headsets without requiring controllers. (As we do not have a compatible headset we are unable to test it. It is included as it is part of Unity's samples and was not changed by ExPresS XR.)
Movement is dependent on the pselected Input Method. While Head- and Eye-Gaze only allow for teleportation or no movement, there are the following possibilities when using controllers:
- Teleportation: Casts a ray and teleports the rig to the target position of the ray. At the end of the ray is a visual indicator (reticle) that highlight teleportation targets. These targets are defined by the GameObjects with a
TeleportationArea- andTeleportationAnchor-Component. Note: In case of HeadGaze the ray will not be rendered, only the reticle will be shown. The reticles must be added to the teleportation areas and anchors as otherwise they will be shown with all interactions). - Continuous Move: Moves the rig continuous as if the user would move in a video game. This might cause motion sickness for some people!
- Continuous Turn: Turns the rig continuous in the direction the direction the joystick was moved. This can not be combined with Snap Turn and is usually paired with Continuous Move.
- Snap Turn: Turns the rig in 45 degree (can be changed) steps in the direction the joystick was moved. This can not be combined with Continuous Turn and is usually paired with Teleportation.
- (Single Hand) Grab Motion: Users can grab the air and pull the world towards them.
- (Two Handed) Grab Motion / Grab Manipulation: Expansion of "Single Hand Grab Motion"-Movement but both controllers can be used together to rotate and scale the environment.
- No Movement: If nothing is enabled the rig won't move, but the whole rig itself can still be moved externally.
These movement options can be configured by selecting one of the rig's Movement Presets. Per default the controls are split between hands in a way known from gamepads or most common VR games (e.g. turn with the right joystick and move with the left). For a detailed description on the controls please check the docs at Workflow/MovementAndControls.md.
Choosing Custom allows for full control over the underlying HandControllers to create a custom behavior.
The application will be rendered directly to the VR headset via Unity's XROrigin. There is an additional (UI-)Camera for rendering anything that should be rendered as overlay, most commonly the some sort of HUD.
It is also possible to create and save a custom XR Rig as a prefab.
After editing an XR Rig to you your likings the Save as Custom XR Rig-Button in the inspector can be pressed.
This will save (and override) the Custom XR Rig making it instantiable via ExPresS XR/XR Rig/Custom (Saved).
Hint: For further descriptions of the components have a look at the documentation of the properties in this document, the components from ExPresS XR and Unity XR.
public class ExPresSXRRig : MonoBehaviour| Name | Description |
|---|---|
| ApplyConfigValues(InputMethod,MovementPreset,MovementOptions,InteractionOptions) | Silently applies the general config values avoiding the getters and setters. |
| EditorRevalidate() | Used internally for applying changes made in the inspector. |
| FadeToClear() | Fades the view to black. Proxy function for the FadeRect of the rig. |
| FadeToClearInstant() | Fades the view to black instantly. Proxy function for the FadeRect of the rig. |
| FadeToColor() | Fades the view to black. Proxy function for the FadeRect of the rig. |
| FadeToColorInstant() | Fades the view to black instantly. Proxy function for the FadeRect of the rig. |
| SetControllerInputEnabled(bool) | Temporarily enables/disables controller input by switching the input method. |
| Name | Description |
|---|---|
| CurrentConfigData | Object containing all necessary references for configuration |
| FadeRect | Reference to the fadeRect of the ExPresS XR Rig. |
| GameTabDisplayMode | The way the 'Game'-view displays the rig's camera when entering play mode. Can be changed at runtime at the top right in the 'Game'-tab. |
| HandModelCollisions | Enables or disables physical collisions of the controllers/hands with other objects in the VR. |
| HandModelMode | Determines how the controllers/hands are rendered in the VR. |
| HeadCollisionPushback | Prevents the players Camera from clipping through Objects and looking inside them by actively pushing the player back. |
| HeadGazeCanReselect | Allow reselection of currently hovered Interactable with HeadGaze. |
| HeadGazeController | Reference to the HeadGazeController of the ExPresS XR Rig. |
| HeadGazeReticle | Reference to the HeadGazeReticle that is displayed as interaction indicator and crosshair for Head Gaze. |
| HeadGazeTimeToSelect | Determines how long in seconds the head must be kept focussed on an interaction for it to be (re-)selected. |
| Hud | Canvas that acts as a hud for the rig. |
| HudCamera | The camera that renders the hud. Should be configured as overlay for the Main Camera of the XR Rig. |
| InputMethod | How the rig is controlled, either per controller, via Head Gaze or Eye Gaze. |
| InteractionOptions | Flags for enabling different interaction options with controllers. |
| LeftAutoHand | Reference to the left AutoHandModel of the ExPresS XR Rig. |
| LeftHandController | Reference to the left HandControllerManager of the ExPresS XR Rig. |
| LocomotionMediator | Reference to the LocomotionMediator of the ExPresS XR Rig. |
| MovementOptions | Flags for enabling different movement options. |
| MovementPreset | Presets of how the player can move through space. |
| PlayerHeadCollider | Must be a PlayerHeadCollider-Component attached to the Main Camera GameObject. |
| RightAutoHand | Reference to the right AutoHandModel of the ExPresS XR Rig. |
| RightHandController | Reference to the right HandControllerManager of the ExPresS XR Rig. |
| ScreenCollisionIndicator | Must be a ScreenCollisionIndicator-Component attached to the Hud. |
| ShowCollisionVignetteEffect | Shows a vignette effect (corners get blurry) if the players Camera is clipping through Objects and looking inside them. |
| Does not require headCollisionPushback to be enabled to work. | |
| TeleportInvalidReticle | Prefab that will be displayed when teleporting to an invalid location. Will be overwritten by the teleportation area/anchors reticle. |
| TeleportValidReticle | Prefab that will be displayed when teleporting to a valid location. Will be overwritten by the teleportation area/anchors reticle. |