XRSPACE Developer Console

Sample - Hello XR

Introduction

In this sample, we will demonstrate our VR features with our SDK including controllers, Hand Motion / Gesture, Headset 6DoF pose.

This sample have some features as below:

  • Hand click/drag UI

  • Hand grab object

  • Controller click/drag UI

  • Hand/Controller Teleport to anywhere in scene

  • IME Keyboard(headset only)

How to Use Handler

Handler description of use.

Handler - Hand

  • Teleport

    ../_images/Sample-HelloXR-Teleport-Gif.gif
    • Use HandGesture Index to find the way you want to teleport.

    • Then use HandActionGesture IndexDown to trigger teleport.

  • Click

    ../_images/Sample-HelloXR-Click-Gif.gif
    • Hand click/drag UI

    • Use Index to point on the button you want to click.

    • Then use IndexDown to press the botton.

  • Drag

    ../_images/Sample-HelloXR-Drag-Gif.gif
    • Use Index to point on the button you want to drag.

    • Then use IndexDown to drag.

  • Grab

    ../_images/Sample-HelloXR-Grab-Gif.gif
    • Use Open to select the object.

    • Then use HandActionGesture Grab to grab the object.

Controller

  • Teleport

    ../_images/Sample-HelloXR-Controller-Teleport-Gif.gif
    • Move controller to find the way you want to teleport.

    • Press TouchPad to teleport.

  • Click&Drag

    ../_images/Sample-HelloXR-Controller-Click&Drag-Gif.gif
    • Press TouchPad to click or drag the button.

Note

For more information about Handler, please visit Sample - Handler.

How to Use Tracker

The IK feature is not ready. PunchGame.cs is disable now, we will open it when the feature is ready.

We provide the raw data of Tracker and IK for develpoer to use, and it will show the sample in PunchGame.cs.

../_images/Hierarchy-PunchGame.png

Tracker need to pair by the app XRSPACE, you can vibrate the tracker by the app after paired.

And the pair sequence is: Right Foot → Left Foor → Right Wrist → Left Wrist → Right Arm → Left Arm

../_images/TrackerPairSequence1.png

If user want to know which part has been paired with tracker:

  • We provide the vibrate tracker feature in sample HelloXR.

    ../_images/Sample-VibrateTrackerFeature.png
  • Call API in app that you build.

    • XRInputManager.Instance.Vibrate(XRDeviceType type, int duration = 1000)

How to Use IME

  • IME Keyboard

    ../_images/Sample-HelloXR-IME-Gif.gif
    • Use Index to point on the inputfield, and IndexDown to open the keyboard.

    • Then use IndexDown to click the keyboard.

Note

We provide API for developer to implement their own keyboard. For more information about IME, please visit Sample - IME.

How to build a new scene

Prefabs and Scripts in the sample.

If user want to create scene by self, the prefab XRManager must to be add in scene.

And if user want to use controller or hand in their scene, the prefab XRHandler need to be add in scene.

../_images/Sample-HelloXR-AddPrefab.png

Using Prefab - XRManager

Main feature: VR Render

../_images/Hierarchy-XRManager.png

A singleton that exposes the VR configuration and status to Unity. Perform head tracking and stereo rendering.

Using two virtual cameras to simulate the field of view by each eye, the left and right views are separated on the display.

../_images/EyeFocusArea.png ../_images/XRManager-vision.png

The XR-SDK dose Lens Distortion Correction (LDC) and Chromatic Aberration Correction (CAC) to eliminate the problem of lens distortion.

  • Lens distortion correction

../_images/LensDistortionCorrection.png
  • Chromatic aberration correction

../_images/ChromaticAberrationCorrection.png

Note

Note that HDR must be disabled on the XRManager for anti-aliased eye buffers to be properly created.

../_images/Inspector-CameraHDRSetting.png

Using Prefab - XRHandler

Main feature: Hands and controllers pose tracker

../_images/XRHandler.png

XRHandler can automatically detects hand or controller status and event callback.

../_images/Prefab-XRHandler.png

Note

For more information about IME, please visit Sample - Handler.