Skip to content

V1_ExPresS XR Rig

eisclimber edited this page Jan 19, 2024 · 1 revision

(V1) ExPresS XR Rig

class in ExPresSXR.Rig / Extends MonoBehavior
GameObject instantiable via ExPress XR/XR Rig/...

Description

Attention: Obsolete, Replaced with a new version

The main configurable GameObject for XR, having all necessary components for any form of interaction as children of this one GameObject.

The rig supports two 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.

Movement is dependent on the selected Input Method. While HeadGaze only allows for no movement or teleportation, controllers allow possibilities:

  • 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- and TeleportationAnchor-Component. Note: In case of HeadGaze the ray will not be rendered, only the reticle will be shown.
  • 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.
  • No Movement: If nothing is enabled the rig won't move, but the whole rig itself can still be moved externally.

Per default the controls are split between hands in a way known from gamepads or most common VR games. For a detailed description on the controls please check the docs at Workflow/MovementAndControls.md.

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

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.

Members

Public Properties

  • InputMethodType inputMethod: How the rig is controlled, either per controller or only via Head Gaze.
  • bool teleportationEnabled: If enabled, the player can teleport. It is usually recommended to also enable snapTurnEnabled if controllers are used.
  • bool joystickMovementEnabled: If enabled, the player can move with the right joystick and look around (smoothly) with the left joystick. Might cause motion sickness.
  • bool snapTurnEnabled: If enabled, the camera can be turned around the vertical axis in 45 degree steps. Does require joystickMovementEnabled to be disabled and is usually used with teleportationEnabled enabled.
  • HandModelMode handModelMode: The Hand Model shown as controller by the AutoHandModel.
  • HandCombinations interactHands: The hands that can be used for interaction.
  • HandCombinations teleportHands: The hands that can be used for teleportation.
  • bool headCollisionEnabled: If enabled, the PlayerHeadCollider will collide with other objects and push the player back.
  • bool showCollisionVignetteEffect: If enabled, the PlayerHeadCollider will show the vignette effect of ScreenCollisionIndicator when colliding.
  • bool showPlayAreaBounds: If enabled, the PlayAreaBounds will be highlighted when getting to close. If the VR is configured for standing position (via the VR's software, e.g. Steam VR) useCustomPlayAreaMaterial must be enabled to show the bounds.
  • bool useCustomPlayAreaMaterial: If enabled, the PlayAreaBounds will be highlighted with a custom material set to PlayerHeadCollider.
  • bool headGazeCanReselect: If enabled and inputMethod = HeadGaze, the HeadGazeController can reselect interactors without them having to leave focus.
  • float headGazeTimeToSelect: If enabled and inputMethod = HeadGaze, the time in seconds the HeadGazeController takes to select an object.
  • HeadGazeReticle headGazeReticle: A reference to the rig's HeadGazeReticle. Should be a child
  • HandController leftHandController: A reference to the rig's left HandController.
  • HandController rightHandController: A reference to the rig's right HandController.
  • HeadGazeController headGazeController: A reference to the rig's HeadGazeController.
  • LocomotionSystem locomotionSystem: A reference to the rig's LocomotionSystem.
  • PlayerHeadCollider playerHeadCollider: A reference to the rig's PlayerHeadCollider.
  • ScreenCollisionIndicator screenCollisionIndicator: A reference to the rig's ScreenCollisionIndicator.
  • PlayAreaBoundingBox playAreaBoundingBox: A reference to the rig's PlayAreaBoundingBox. It should be a child of the hud.
  • Canvas hud: The canvas containing all HUD elements. It has it's rendering layer set to UI always on top and it's rendering mode set to Camera - Overlay to ensure it is displayed correctly.
  • FadeRect fadeRect: A FadeRect that is used to fade the whole screen to black. It should be a child of the hud.

Public Methods

  • void FadeToColor(bool instant = false): Public wrapper function that calls FadeToColor() on the FadeRect if the reference was set.
  • void FadeToClear(bool instant = false): Public wrapper function that calls FadeToClear() on the FadeRect if the reference was set.
  • void ChangeSceneWithFade(int sceneIdx): Changes a scene whilst faded out. Scenes must be added to the list in the build setting to have a sceneIdx. Supports 'DontDestroyOnLoad()' if enabled on the rig.

Enums

  • InputMethodType: Used to reference the input method type. Either with controllers or head gaze.
  • HandCombinations: Flags field for referencing any combination combination of hands.

ExPresS XR Wiki

Tutorial Pages

Code Documentation

Clone this wiki locally