Skip to content
Snippets Groups Projects
Commit 54667ec4 authored by Sebastian Pape's avatar Sebastian Pape
Browse files

Implemented the ROLV mode, switched to Unreal CreateProc instead of system,...

Implemented the ROLV mode, switched to Unreal CreateProc instead of system, added minimizing and maximizing to the editor
parent e1b271e9
No related branches found
No related tags found
No related merge requests found
#####################################################################
# nDisplay config file for aixCAVE
#####################################################################
#####################################################################
# Config info
#********************************************************************
# This is a config file header.
#
# Properties:
# version - specifies the version of the configuration file (UE4.xx)
#********************************************************************
[info] version=22
#####################################################################
# Cluster nodes
#********************************************************************
# Cluster node is an application instance. It's allowed to use
# multiple instances on the same PC. Sometimes its necessary.
#
# Properties:
# id - Unique node name
# window - Window ID
# addr - Network address (IPv4 only)
# master - Specifies if current node is master; default is 'false'
# port_cs - Cluster Synchronization port (required on master node only)
# port_ss - Swap Synchronization port (required on master node only)
# port_ce - Cluster Events port (required on master node only)
#
# Optional properties:
# eye_swap - Swap eyes for this node; default is 'false'
# sound - turns on/off sound for this application instance; default is 'false'
#********************************************************************
[cluster_node] id=node_floor addr=127.0.0.1 window=wnd_floor port_cs=41001 port_ss=41002 port_ce=41003 master=true sound=true
[cluster_node] id=node_front addr=127.0.0.1 window=wnd_front
[cluster_node] id=node_left addr=127.0.0.1 window=wnd_left
[cluster_node] id=node_right addr=127.0.0.1 window=wnd_right
[cluster_node] id=node_back addr=127.0.0.1 window=wnd_back
#####################################################################
# Application windows
#********************************************************************
# The window entitty defines properties of application's game window.
#
# Properties:
# id - Unique window name
# fullscreen - Fullscreen or windowed mode
# winx - X location
# winy - Y location
# resx - Width
# resy - Height
# viewports - Array of viewports
#********************************************************************
[window] id=wnd_floor viewports=vp_floor
[window] id=wnd_front viewports=vp_front
[window] id=wnd_left viewports=vp_left
[window] id=wnd_right viewports=vp_right
[window] id=wnd_back viewports=vp_back
#####################################################################
# Projection screens
#********************************************************************
# Projection screen is a rectangle which determines the camera frustum.
# Usually the projection screen has the same dimensions as an output
# display but in some cases it may differ.
#
# Properties:
# id - unique projection screen name
# loc - relative location to the parent component. Location is relative
# to the VR root if no parent specified. The pivot is a screen's
# center and the values are in meters.
# rot - relative rotation to the parent component. Rotation is relative
# to the VR root if no parent specified. The pivot is a screen's
# center and the values are in degrees.
# size - width (X) and height (Y) of the screen. Values are in meters.
#
# Optional properties:
# parent - ID of parent component in VR hierarchy; default is VR root.
# tracker_id - ID of tracking device; no tracking by default.
# tracker_ch - ID of tracking device's channel; no tracking by default.
#********************************************************************
[screen] id=screen_floor loc="X=0,Y=0,Z=0" rot="P=0,Y=0,R=0" size="X=5.25,Y=5.25" parent=loc_floor
[screen] id=screen_front loc="X=0,Y=0,Z=0" rot="P=0,Y=0,R=0" size="X=5.25,Y=3.3" parent=loc_front
[screen] id=screen_left loc="X=0,Y=0,Z=0" rot="P=0,Y=0,R=0" size="X=3.3,Y=5.25" parent=loc_left
[screen] id=screen_right loc="X=0,Y=0,Z=0" rot="P=0,Y=0,R=0" size="X=3.3,Y=5.25" parent=loc_right
[screen] id=screen_back loc="X=0,Y=0,Z=0" rot="P=0,Y=0,R=0" size="X=5.25,Y=3.3" parent=loc_back
#####################################################################
# Viewports
#********************************************************************
# Viewport is a rectangle area of game window where rendered frame is
# mapped. Usually the viewport starts at 0:0 and has the same size as
# its parent window but in some cases these settings may differ.
#
# Properties:
# id - unique viewport name
# x - X coordinate of viewport's top left corner
# y - Y coordinate of viewport's top left corner
# width - width of viewport in pixels
# height - height of viewport in pixels
#********************************************************************
[viewport] id=vp_floor screen=screen_floor x=0 y=0 width=480 height=480
[viewport] id=vp_front screen=screen_front x=0 y=0 width=480 height=300
[viewport] id=vp_left screen=screen_left x=0 y=0 width=300 height=480
[viewport] id=vp_right screen=screen_right x=0 y=0 width=300 height=480
[viewport] id=vp_back screen=screen_back x=0 y=0 width=480 height=300
#####################################################################
# Cameras
#********************************************************************
# Camera is a predefined point frome where the stereoscopic view built.
# It's possible to define multiple cameras and swith the active one
# during runtime. You're free to attach any camera to a tracking device
# for head tracking. Consider a camera as a viewer's head.
#
# Properties:
# id - unique camera name
# loc - relative location to the parent component. Location is relative
# to the VR root if no parent specified.
# rot - relative rotation to the parent component. Rotation is relative
# to the VR root if no parent specified.
#
# Optional properties:
# parent - ID of parent component in VR hierarchy; default is VR root.
# tracker_id - ID of tracking device; no tracking by default.
# tracker_ch - ID of tracking device's channel; no tracking by default.
#********************************************************************
[camera] id=camera_dynamic loc="X=0,Y=0,Z=0" parent=shutter_glasses
#####################################################################
# Scene nodes (hierarchy transforms)
#********************************************************************
# Scene node is an actor component which is basically a transformation
# matrix. Scene nodes can be helpful to build a component hierarchy, to
# define some special places (like a socket) within VR space.
#
# It might be difficult to understand what VR space origin is. Consider
# it as a point in space where VR space starts. Any componenent listed
# in this config file is relative to its parent or this origin.
#
# Properties:
# id - unique scene node name
# loc - relative location to the parent component. Location is relative
# to the VR root if no parent specified.
# rot - relative rotation to the parent component. Rotation is relative
# to the VR root if no parent specified.
#
# Optional properties:
# parent - ID of parent component in VR hierarchy; default is VR root.
# tracker_id - ID of tracking device; no tracking by default.
# tracker_ch - ID of tracking device's channel; no tracking by default.
#********************************************************************
[scene_node] id=cave_origin loc="X=0,Y=0,Z=0" rot="P=0,Y=0,R=0"
[scene_node] id=cave_center loc="X=0,Y=0,Z=1.65" rot="P=0,Y=0,R=0" parent=cave_origin
[scene_node] id=flystick loc="X=0,Y=0,Z=0" rot="P=0,Y=0,R=0" parent=cave_origin
[scene_node] id=shutter_glasses loc="X=0,Y=0,Z=1.65" rot="P=0,Y=0,R=0" parent=cave_origin
[scene_node] id=angle_front loc="X=0,Y=0,Z=0" rot="P=0,Y=0,R=0" parent=cave_center
[scene_node] id=angle_left loc="X=0,Y=0,Z=0" rot="P=0,Y=-90,R=90" parent=cave_center
[scene_node] id=angle_right loc="X=0,Y=0,Z=0" rot="P=0,Y=90,R=-90" parent=cave_center
[scene_node] id=angle_back loc="X=0,Y=0,Z=0" rot="P=0,Y=180,R=180" parent=cave_center
[scene_node] id=angle_floor loc="X=0,Y=0,Z=0" rot="P=-90,Y=0,R=0" parent=cave_origin
[scene_node] id=loc_front loc="X=2.625,Y=0.01,Z=0.01" rot="P=0,Y=0,R=0" parent=angle_front
[scene_node] id=loc_left loc="X=2.625,Y=0.01,Z=0.01" rot="P=0,Y=0,R=0" parent=angle_left
[scene_node] id=loc_right loc="X=2.625,Y=0.01,Z=0.01" rot="P=0,Y=0,R=0" parent=angle_right
[scene_node] id=loc_back loc="X=2.625,Y=0.01,Z=0.01" rot="P=0,Y=0,R=0" parent=angle_back
[scene_node] id=loc_floor loc="X=0.001,Y=0.01,Z=0.01" rot="P=0,Y=0,R=0" parent=angle_floor
#####################################################################
# Input devices
#********************************************************************
# Input devices are VRPN devices. The nDisplay supports the following
# types: analog, button and tracker. Many of physical input devices
# can be connected via VRPN.
#
# Properties:
# id - nique device name
# type - VRPN type (analog, button or tracker).
# addr - address of a VRPN server which handles this particular device.
# The value must match the following format: DEVICENAME@SERVER_ADDRESS
# where DEVICENAME is a VRPN name of this device and SERVER_ADDRESS
# is IPv4 address of VRPN server.
# loc - relative location to the parent component. Location is relative
# to the VR root if no parent specified.
# rot - relative rotation to the parent component. Rotation is relative
# to the VR root if no parent specified.
#
# front (tracker only) - mapping of a tracking system axis to X axis of VR origin
# right (tracker only) - mapping of a tracking system axis to Y axis of VR origin
# up (tracker only) - mapping of a tracking system axis to Z axis of VR origin
# * The following values are allowed for axes mapping: X, -X, Y, -Y, Z, -Z
#
# Optional properties:
# remap - VRPN device channel remapping. Value format is: "from0:to0,from1:to1,...,fromN:toN".
# For example: remap="0:3,1:4,5:2"
#********************************************************************
#####################################################################
# Stereoscopic settings
#********************************************************************
# Properties:
# eye_dist - interoccular distance in meters
[stereo] eye_dist=0.064
#####################################################################
# General settings
#********************************************************************
# Properties:
# swap_sync_policy - swap synchronization policy
# - 0 - no synchronization
# - 1 - software swap synchronization
# - 2 - NV swap lock (Nvidia cards only, OpenGL only)
[general] swap_sync_policy=1
#####################################################################
# Network settings
#********************************************************************
# Optional properties:
# cln_conn_tries_amount - how many times a client tries to connect to a server
# cln_conn_retry_delay - delay before next client connection try (milliseconds)
# game_start_timeout - timeout before all data is loaded and game started (milliseconds)
# barrier_wait_timeout - barrier timeout for both game and render threads (milliseconds)
[network] cln_conn_tries_amount=300 cln_conn_retry_delay=1000 game_start_timeout=60000 barrier_wait_timeout=60000
#####################################################################
# Custom arguments
#********************************************************************
# Any custom arguments available in runtime can be specified here.
# Format: ARG_NAME=ARG_VAL
[custom] Hardware_Platform=VirtualCAVE
File moved
Resources/Icon128.png

14.1 KiB

Resources/ROLVIcon_40x.png

710 B

// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
#include "CAVELaunchButton.h"
#include <stdlib.h>
#include "CAVELaunchButtonStyle.h"
#include "CAVELaunchButtonSettings.h"
#include "CAVELaunchButtonCommands.h"
#include "Misc/MessageDialog.h"
#include "Framework/MultiBox/MultiBoxBuilder.h"
#include "IPluginManager.h"
#include "Misc/EngineVersion.h"
#include "LevelEditor.h"
......@@ -49,12 +50,42 @@ void FCAVELaunchButtonModule::ShutdownModule()
void FCAVELaunchButtonModule::PluginButtonClicked()
{
int result = system("C:\\test.bat");
// minimize the root window to provide max performance for the preview.
TSharedPtr<SWindow> RootWindow = FGlobalTabmanager::Get()->GetRootWindow();
if (RootWindow.IsValid()) RootWindow->Minimize();
#if PLATFORM_WINDOWS
const UCAVELaunchButtonSettings* Settings = GetDefault<UCAVELaunchButtonSettings>();
if (Settings->StartROLVInsteadOfCAVE) {
UE_LOG(LogTemp, Log, TEXT("This would launch ROLV!"));
} else {
FString Config = IPluginManager::Get().FindPlugin("CAVELaunchButton")->GetBaseDir() + "/LaunchConfig/minicave.cfg";
FString EditorExecutable = "UE4Editor.exe"; //FPaths::ConvertRelativePathToFull(FPaths::EngineDir()) + "/Binaries/Win64/UE4Editor.exe";
FString Parameters = "\"" + FPaths::GetProjectFilePath() + "\" -game -windowed -fixedseed -notexturestreaming -opengl4 dc_cfg=\"" + Config + "\" -dc_cluster -dc_dev_mono";
const int num_nodes = 5;
FString Windows_Node_Specific_Commands[num_nodes] = {
"dc_node=node_floor WinX=720 WinY=300 ResX=480 ResY=480 -log ABSLOG=" + FPaths::ProjectDir() + "\\MiniCaveMulti.log " + Settings->AdditionalParameters + " " + Settings->AdditionalParametersMaster,
"dc_node=node_front WinX=720 WinY=0 ResX=480 ResY=300 " + Settings->AdditionalParameters,
"dc_node=node_left WinX=420 WinY=300 ResX=300 ResY=480 " + Settings->AdditionalParameters,
"dc_node=node_right WinX=1200 WinY=300 ResX=300 ResY=480 " + Settings->AdditionalParameters,
"dc_node=node_back WinX=720 WinY=780 ResX=480 ResY=300 " + Settings->AdditionalParameters
};
FProcHandle processes[num_nodes];
for(int i = 0; i < num_nodes; i++){
processes[i] = FPlatformProcess::CreateProc(*EditorExecutable, *(Parameters + " " + Windows_Node_Specific_Commands[i]), true, false, false, NULL, 0, NULL, NULL);
}
FPlatformProcess::WaitForProc(processes[num_nodes - 1]);
}
#elif PLATFORM_LINUX
FProcHandle process = FPlatformProcess::CreateProc(*FString("/home/av006de/demos_UNREAL/.misc/scripts/cave/launch_aixcave_editor.sh"), *("\"" + (FPaths::ConvertRelativePathToFull(FPaths::EngineDir()) + "\\Binaries\\Linux\\UE4Editor\" ") + FPaths::GetProjectFilePath() + " " + FEngineVersion::Current().GetMajor() + FEngineVersion::Current().GetMinor()), true, false, false, NULL, 0, NULL, NULL);
FPlatformProcess::WaitForProc(process);
#endif
void FCAVELaunchButtonModule::AddMenuExtension(FMenuBuilder& Builder)
{
Builder.AddMenuEntry(FCAVELaunchButtonCommands::Get().PluginAction);
if (RootWindow.IsValid()) RootWindow->Maximize();
}
void FCAVELaunchButtonModule::AddToolbarExtension(FToolBarBuilder& Builder)
......
// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
#include "CAVELaunchButtonCommands.h"
#include "CAVELaunchButtonSettings.h"
#define LOCTEXT_NAMESPACE "FCAVELaunchButtonModule"
void FCAVELaunchButtonCommands::RegisterCommands()
{
if(GetDefault<UCAVELaunchButtonSettings>()->StartROLVInsteadOfCAVE)
{
UI_COMMAND(PluginAction, "PlayOnROLV", "Launch current project on ROLV", EUserInterfaceActionType::Button, FInputGesture());
}else
{
UI_COMMAND(PluginAction, "PlayInCAVE", "Launch current project in CAVE", EUserInterfaceActionType::Button, FInputGesture());
}
}
#undef LOCTEXT_NAMESPACE
......@@ -6,6 +6,7 @@
#include "Styling/SlateStyleRegistry.h"
#include "Slate/SlateGameResources.h"
#include "Interfaces/IPluginManager.h"
#include "CAVELaunchButtonSettings.h"
TSharedPtr< FSlateStyleSet > FCAVELaunchButtonStyle::StyleInstance = NULL;
......@@ -46,7 +47,13 @@ TSharedRef< FSlateStyleSet > FCAVELaunchButtonStyle::Create()
TSharedRef< FSlateStyleSet > Style = MakeShareable(new FSlateStyleSet("CAVELaunchButtonStyle"));
Style->SetContentRoot(IPluginManager::Get().FindPlugin("CAVELaunchButton")->GetBaseDir() / TEXT("Resources"));
Style->Set("CAVELaunchButton.PluginAction", new IMAGE_BRUSH(TEXT("ButtonIcon_40x"), Icon40x40));
if (GetDefault<UCAVELaunchButtonSettings>()->StartROLVInsteadOfCAVE)
{
Style->Set("CAVELaunchButton.PluginAction", new IMAGE_BRUSH(TEXT("ROLVIcon_40x"), Icon40x40));
}else
{
Style->Set("CAVELaunchButton.PluginAction", new IMAGE_BRUSH(TEXT("CAVEIcon_40x"), Icon40x40));
}
return Style;
}
......
......@@ -8,6 +8,7 @@
class FToolBarBuilder;
class FMenuBuilder;
class FCAVELaunchButtonModule : public IModuleInterface
{
public:
......@@ -22,7 +23,6 @@ public:
private:
void AddToolbarExtension(FToolBarBuilder& Builder);
void AddMenuExtension(FMenuBuilder& Builder);
private:
TSharedPtr<class FUICommandList> PluginCommands;
......
#pragma once
#include "CoreMinimal.h"
#include "Engine/DeveloperSettings.h"
#include "CAVELaunchButtonSettings.generated.h"
UCLASS(config=Engine, defaultconfig, meta=(DisplayName="nDisplay Launch Button"))
class UCAVELaunchButtonSettings : public UDeveloperSettings
{
GENERATED_BODY()
public:
UPROPERTY(EditAnywhere, config, Category = LaunchParametersWindows)
FString AdditionalParameters = "";
UPROPERTY(EditAnywhere, config, Category = LaunchParametersWindows)
FString AdditionalParametersMaster = "";
UPROPERTY(EditAnywhere, config, Category = Platform, meta = (ConfigRestartRequired = true))
bool StartROLVInsteadOfCAVE = false;
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment