V1_ExPresS XR Rig - eisclimber/ExPresS-XR GitHub Wiki
class in ExPresSXR.Rig / Extends MonoBehavior
GameObject instantiable via ExPress XR/XR Rig/...
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 aTeleportationArea- andTeleportationAnchor-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.
-
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 enablesnapTurnEnabledif 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 requirejoystickMovementEnabledto be disabled and is usually used withteleportationEnabledenabled. -
HandModelMode handModelMode: The Hand Model shown as controller by theAutoHandModel. -
HandCombinations interactHands: The hands that can be used for interaction. -
HandCombinations teleportHands: The hands that can be used for teleportation. -
bool headCollisionEnabled: If enabled, thePlayerHeadColliderwill collide with other objects and push the player back. -
bool showCollisionVignetteEffect: If enabled, thePlayerHeadColliderwill show the vignette effect ofScreenCollisionIndicatorwhen colliding. -
bool showPlayAreaBounds: If enabled, thePlayAreaBoundswill be highlighted when getting to close. If the VR is configured for standing position (via the VR's software, e.g. Steam VR)useCustomPlayAreaMaterialmust be enabled to show the bounds. -
bool useCustomPlayAreaMaterial: If enabled, thePlayAreaBoundswill be highlighted with a custom material set toPlayerHeadCollider. -
bool headGazeCanReselect: If enabled andinputMethod = HeadGaze, theHeadGazeControllercan reselect interactors without them having to leave focus. -
float headGazeTimeToSelect: If enabled andinputMethod = HeadGaze, the time in seconds theHeadGazeControllertakes to select an object. -
HeadGazeReticle headGazeReticle: A reference to the rig'sHeadGazeReticle. Should be a child -
HandController leftHandController: A reference to the rig's leftHandController. -
HandController rightHandController: A reference to the rig's rightHandController. -
HeadGazeController headGazeController: A reference to the rig'sHeadGazeController. -
LocomotionSystem locomotionSystem: A reference to the rig'sLocomotionSystem. -
PlayerHeadCollider playerHeadCollider: A reference to the rig'sPlayerHeadCollider. -
ScreenCollisionIndicator screenCollisionIndicator: A reference to the rig'sScreenCollisionIndicator. -
PlayAreaBoundingBox playAreaBoundingBox: A reference to the rig'sPlayAreaBoundingBox. It should be a child of the hud. -
Canvas hud: The canvas containing all HUD elements. It has it's rendering layer set toUI always on topand it's rendering mode set toCamera - Overlayto ensure it is displayed correctly. -
FadeRect fadeRect: AFadeRectthat is used to fade the whole screen to black. It should be a child of the hud.
-
void FadeToColor(bool instant = false): Public wrapper function that callsFadeToColor()on theFadeRectif the reference was set. -
void FadeToClear(bool instant = false): Public wrapper function that callsFadeToClear()on theFadeRectif 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.
-
InputMethodType: Used to reference the input method type. Either with controllers or head gaze. -
HandCombinations: Flags field for referencing any combination combination of hands.