Developing for the Pro
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
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.
Play the Demo
First open the control screen window from the drop down menu
Next, click HoloPlay Play Button, then play the game by clicking the standard Play button
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.
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.
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.
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.
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.
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.
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.
- Create Widget - Create the widget you would like to present
- Create HoloPlay Pro Widget - Initialize HoloPlay Pro viewport
- Add to Viewport - Add to HoloPlay Pro Screen
Remove Widget from Secondary Display
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.
Setting Defaults
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