Skip to content

Developing for the Pro

only available for v1.2.1 or greater

Overview

The HoloPlayPro UE4 plugin is an extension upon the standard HoloPlay UE4 Plugin. All usage and documentation is relevant with a few additions as described below. For standard HoloPlay usage, please see the “UE4 Looking Glass Plugin” documentation.

Setup

First, download and run the UE4 Pro Demo.

If you need help with initial project setup, please follow the setup process.

Getting Started With Demo

Open Looking Glass Pro Map

Open the Looking Glass Pro map located at HoloPlayProContent -> Maps -> HoloPlayProDefaultMap found in the Content Browser.

Note: Make sure you have enabled “Show Plugin Content” in your View Options.

img

Play the Demo

First open the control screen window from the drop down menu

img

Next, click HoloPlay Play Button, then play the game by clicking the standard Play button

img

img

Controls

  • Tap the buttons on the UI Screen to toggle the visibility of objects in the scene.
  • Tap and drag on the main display to orbit around the objects in the scene.
  • Double Tap the main display to reset the view
  • Tap and pinch two fingers on the main display to zoom in and out (select between zoom and rotation using the external window)

Code Examples

To see an example of the input control code you can open up the BP_3DInteractionManager blueprint.

img

img

Add Into Existing Project

Download the Plugin and copy the plugin to your “Plugins” folder contained in your project root folder.

For further setup instructions please see the “For Existing Projects” in the Setting Up guide.

Touch Input

For code references, you can view the BP_3DInteraction Manager for code for zoom, rotate, double tap, and single tap.

Location: HoloPlayProContent -> Blueprints -> BP_3DInteractionManager

Single Tap

Right click the event graph and search for the “Touch” event.

img

You can read more about this event here in the Unreal Engine Documentation

Right click the event graph and search for “DoubleTap”. You will be presented with two event options.

img

HoloPlay ViewPort Gesture DoubleTap

Triggered only when the main Looking Glass Display is double tapped.

Global Gesture DoubleTap

Triggered when any display is double tapped. If you need to detect a double tap on the external workstation display use this event.

Pinch

Right click the event graph and search for the “Pinch” event. Triggered when two fingers touch screen.

img

If you would like to make your own gestures like zoom or rotate you can get the location of each finger press by getting the player controller and checking the touch state. This will return X and Y locations which you can then use to make your own input gestures. An example can be seen below.

img

If you would like to view the full code for zoom and rotate you can view the code in BP_3DInteractionManager found in:

HoloPlayProContent -> Blueprints -> BP_3DInteractionManager

UI for Secondary Display

Create Widget

Widgets for the secondary display can be created using the standard UE4 UMG Designer tool built into Unreal Engine. To learn more about how to create UI elements you can visit the UE4 UMG UI Designer User Guide

For an example of an interactive widget that can be used on the secondary display you can look at the “WBP_ProWidget” found in the sample project at HoloPlayProContent -> UMG -> WBP_ProWidget.

img

Add Widget to Secondary Display

Once you have created the widget you would like to show on your secondary screen you can present it the display by adding it to the HoloPlay Viewport in three steps.

  1. Create Widget - Create the widget you would like to present
  2. Create HoloPlay Pro Widget - Initialize HoloPlay Pro viewport
  3. Add to Viewport - Add to HoloPlay Pro Screen

img

Remove Widget from Secondary Display

img

C++ Usage

To present a widget to the screen through C++ you can follow this tutorial from the Unreal Engine documentation website but substitute the associated items for the HoloPlay Widget items listed below.

Add Module Name “HoloPlayPro”

PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "HoloPlayPro" });

Include Interface and HoloPlayProViewportClient.h

#include "IHoloPlayProRuntime.h"
#include "Slate/HoloPlayProViewportClient.h"

Add Widget to HoloPlayProViewportClient

IHoloPlayProRuntime::Get().GetHoloPlayProViewportClient()
IHoloPlayProRuntime::Get().GetHoloPlayProViewportClient()->AddViewportWidgetContent(
    SNew(MyWidgetPtr.ToSharedRef())
);

Remove Widget from HoloPlayProViewportClient

IHoloPlayProRuntime::Get().GetHoloPlayProViewportClient()->RemoveViewportWidgetContent(
    SNew(MyWidgetPtr.ToSharedRef())
);
IHoloPlayProRuntime::Get().GetHoloPlayProViewportClient()->RemoveAllViewportWidgets();

Extra Settings

If you would like to have more control over the secondary display on the Looking Glass Pro Workstation you can view the settings found in the dropdown under the HoloPlay Play Button.

img

Setting Defaults

img

Is Most Right Auto Placement - Auto places widget in the rightmost screen, in this case the secondary display.

Is Enabled in Standalone - Secondary screen enabled in Standalone Mode

Client Size - Size of texture sent to screen (resolution of secondary screen)

Screen Position - Location to place the window. (Overridden if Is Most Right Auto Placement is true)

Window Type - How to display the window on the secondary screen