skip to Main Content

Virtual Reality (VR)

Basic VR Usage

World Political Map Globe Edition works great in VR. When using it with a VR headset, two different modes can be used:

  • Inverted Mode” which sits you at the center of the globe and it rotates around you. This option is located under the Earth style in the inspector and automatically enables VR compatibility (you don’t need to configure anything else). Note that this option is not available for all Earth styles.

  • Normal Mode”. This is the mode where you see the entire Earth in front of you. In this case you need to verify that the “VR Enabled” parameter is checked (located at bottom of inspector).

To enable VR raycasting support, check the VR Enable toggle under Devices section of WPM Globe inspector.

This is enough to support basic virtual reality platforms such us Google VR compatible devices, Gear VR, and others.

Custom Gazes & Pointers

Unity’s VR Samples Gaze & VREyeRayCast

WPM Globe Edition also supports gaze selections through VREyeRayCast, included in Unity VR Samples. With VREyeRayCast, WPM Globe will properly hide current selection if the gaze is over a interactable element (like a menu). To support VREyeRayCast, you need to import these VR scripts from Unity and also edit WPMInternal.cs and uncomment the line that reads:

//#define VR_EYE_RAY_CAST_SUPPORT

Google VR Pointer & Controller Touch

To enable country selection and globe interaction using controller touch edit WPMInternal.cs and uncomment the line that reads:

//#define VR_GOOGLE

Samsung Gear VR Pointer (old API)

To enable country selection and globe interaction using Samsung Gear VR pointer (laser) uncomment the line that reads:

//#define VR_SAMSUNG_GEAR_CONTROLLER

Oculus Plugin Integration (Go / Quest) Controllers

To enable globe interaction using Go/Quest controllers, uncomment the line in WPMInternal.cs script that reads:

//#define VR_OCULUS

Important! Make sure the Oculus plugin is present in your project (install it from Asset Store or from the Oculus developer site).

This enables integration with the controllers:

  • The Earth cursor will move according to the controller direction (Note: no laser is drawn).
  • Dragging over the touchpad (Go) or with Thumbstick (Quest) will rotate the Earth.
  • Clicking the touchpad (Go) will center the Earth on the current country/province.
  • Pulling the controller trigger will raise a normal click (as with mouse).
  • Zoom in/out can be performed on the Quest controller by holding the primary hand trigger while moving up/down the thumbstick

Trouble shooting

If you have rendering issues using Oculus Plugin:

  • v18 of Oculus Plugin has some issues with Unity 2018.4 and later. Try downloading v17 from Oculus website.
  • Select OVRCameraRig and disable “Use Recommended MSAA Level” in the OVRManager script.

Test/Walk-through with Oculus Quest

  1. Create an empty project. Switch to Android.
  1. Configure project for VR. Go to Project Settings and under XR, install the XR Management Plugin. Also install the Oculus support in the Android tab under the XR Management section.
  1. Import World Political Map Globe Edition asset.
  1. Import Oculus Plugin from the Asset Store.
  1. If you receive any message to upgrade, click “Yes” (upgrade).
  1. Open demo scene 1 of the globe asset.
    – Remove the camera and drag & drop the OVRCameraRig from the Oculus/VR/Prefabs folder.
    – Unselect “Use Recommended MSAA level” in the OVR Manager script.
  1. Select the WorldMapGlobe gameobject and move it a bit forward to position (0,0,10) so it appears full in front of the camera. Scroll down and select:
    – Allow User Rotation / Mode = Earth Rotates
    – Allow User Zoom / Mode = Earth Moves
    – Distance Max = 20
  2. As explained above, edit WPMInternal.cs and uncomment the #define VR_OCULUS macro.
  3. Build the app. Go to Player settings and switch Android minimum API version to 7 at least. You may want to remove many of the 8K/16K textures included in the globe / Resources / Textures folder to speed up the build process.
  4. Run the app on the Oculus Quest.

On the Oculus Quest using the right hand controller you will be able to control the pointer. Use the thumbstick to rotate the Earth. Hold the lateral button and move the thumbstick up/down to control zoom.

Back To Top