diff --git a/Content/CAVEOverlay/DoorOverlay.uasset b/Content/CAVEOverlay/DoorOverlay.uasset index 8e78c0e895f8b30376111b947b007dbdbc9d7d68..a5f77236ed84ef757a4d40f5dfc23acfe14e972c 100644 Binary files a/Content/CAVEOverlay/DoorOverlay.uasset and b/Content/CAVEOverlay/DoorOverlay.uasset differ diff --git a/RWTHVRToolkit.uplugin b/RWTHVRToolkit.uplugin index 690ed43563cb6a18ecc61882b4f323688117263a..8c94abd9cf56285d1b426766502ad364015852ec 100644 --- a/RWTHVRToolkit.uplugin +++ b/RWTHVRToolkit.uplugin @@ -1,40 +1,53 @@ { - "FileVersion": 3, - "Version": 1, - "VersionName": "1.0", - "FriendlyName": "RWTH VR Toolkit", - "Description": "", - "Category": "Other", - "CreatedBy": "", - "CreatedByURL": "", - "DocsURL": "", - "MarketplaceURL": "", - "SupportURL": "", - "CanContainContent": true, - "IsBetaVersion": false, - "Installed": false, - "EnabledByDefault": true, - "Modules": [ - { - "Name": "Calibratio", - "Type": "Runtime", - "LoadingPhase": "Default" - }, - { - "Name": "RWTHVRToolkit", - "Type": "Runtime", - "LoadingPhase": "Default" - }, - { - "Name": "RWTHVRToolkitEditor", - "Type": "Editor", - "LoadingPhase": "PostEngineInit" - } - ], - "Plugins": [ - { - "Name": "nDisplay", - "Enabled": true - } - ] + "FileVersion": 3, + "Version": 1, + "VersionName": "1.0", + "FriendlyName": "RWTH VR Toolkit", + "Description": "", + "Category": "Other", + "CreatedBy": "", + "CreatedByURL": "", + "DocsURL": "", + "MarketplaceURL": "", + "SupportURL": "", + "CanContainContent": true, + "IsBetaVersion": false, + "Installed": false, + "EnabledByDefault": true, + "Modules": [ + { + "Name": "Calibratio", + "Type": "Runtime", + "LoadingPhase": "Default", + "WhitelistPlatforms": [ + "Win64", + "Linux" + ] + }, + { + "Name": "RWTHVRCluster", + "Type": "Runtime", + "LoadingPhase": "Default", + "WhitelistPlatforms": [ + "Win64", + "Linux" + ] + }, + { + "Name": "RWTHVRToolkit", + "Type": "Runtime", + "LoadingPhase": "Default" + }, + { + "Name": "RWTHVRToolkitEditor", + "Type": "Editor", + "LoadingPhase": "PostEngineInit" + } + ], + "Plugins": [ + { + "Name": "nDisplay", + "Enabled": true + } + ] } \ No newline at end of file diff --git a/Source/Calibratio/Public/CalibratioActor.h b/Source/Calibratio/Public/CalibratioActor.h index a2bac0d157826ae3ff515032a5170a7704e40b08..bb59fb1553ec889a0cef8c888759f5f9725b88bc 100644 --- a/Source/Calibratio/Public/CalibratioActor.h +++ b/Source/Calibratio/Public/CalibratioActor.h @@ -62,7 +62,7 @@ private: FVector LastVisiblePosition = FVector(NAN, NAN, NAN); bool FirstPositionSet = false; uint32 AcceptedAbscenceTime = 500u; // in Milliseconds - UPROPERTY() UDisplayClusterSceneComponent* TrackedClusterComponent = nullptr; + UPROPERTY() USceneComponent* TrackedClusterComponent = nullptr; //Overlay TSubclassOf<class UCalibratioOverlay> Overlay_Class; diff --git a/Source/RWTHVRToolkit/Private/Cluster/CAVEOverlay/CAVEOverlay.cpp b/Source/RWTHVRCluster/Private/CAVEOverlay/CAVEOverlay.cpp similarity index 93% rename from Source/RWTHVRToolkit/Private/Cluster/CAVEOverlay/CAVEOverlay.cpp rename to Source/RWTHVRCluster/Private/CAVEOverlay/CAVEOverlay.cpp index 6d1aaf8bf75963433b6598d43a62beead95e0fbe..75db39b14032cff1b160f5a4fd093f0973ad3ba3 100644 --- a/Source/RWTHVRToolkit/Private/Cluster/CAVEOverlay/CAVEOverlay.cpp +++ b/Source/RWTHVRCluster/Private/CAVEOverlay/CAVEOverlay.cpp @@ -1,6 +1,6 @@ // Copyright 1998-2019 Epic Games, Inc. All Rights Reserved. -#include "Cluster/CAVEOverlay/CAVEOverlay.h" +#include "CAVEOverlay/CAVEOverlay.h" void FCAVEOverlay::Register() { diff --git a/Source/RWTHVRToolkit/Private/Cluster/CAVEOverlay/CAVEOverlayController.cpp b/Source/RWTHVRCluster/Private/CAVEOverlay/CAVEOverlayController.cpp similarity index 99% rename from Source/RWTHVRToolkit/Private/Cluster/CAVEOverlay/CAVEOverlayController.cpp rename to Source/RWTHVRCluster/Private/CAVEOverlay/CAVEOverlayController.cpp index 96b53f9733aecd65ab685348cb3aa1d35412f1ad..fe76403ae3cfc8015dbd0f8bf96177023624e310 100644 --- a/Source/RWTHVRToolkit/Private/Cluster/CAVEOverlay/CAVEOverlayController.cpp +++ b/Source/RWTHVRCluster/Private/CAVEOverlay/CAVEOverlayController.cpp @@ -1,6 +1,6 @@ -#include "Cluster/CAVEOverlay/CAVEOverlayController.h" +#include "CAVEOverlay/CAVEOverlayController.h" #include "CoreMinimal.h" -#include "Cluster/CAVEOverlay/DoorOverlayData.h" +#include "CAVEOverlay/DoorOverlayData.h" #include "IDisplayCluster.h" #include "IXRTrackingSystem.h" #include "Cluster/IDisplayClusterClusterManager.h" diff --git a/Source/RWTHVRToolkit/Private/Cluster/ClusterConsole.cpp b/Source/RWTHVRCluster/Private/ClusterConsole.cpp similarity index 95% rename from Source/RWTHVRToolkit/Private/Cluster/ClusterConsole.cpp rename to Source/RWTHVRCluster/Private/ClusterConsole.cpp index 55a3ad97794a59d04cd2e9fa9a8531152e39071a..7fe177c8de89500cc61651d6c91375e31259a95b 100644 --- a/Source/RWTHVRToolkit/Private/Cluster/ClusterConsole.cpp +++ b/Source/RWTHVRCluster/Private/ClusterConsole.cpp @@ -1,4 +1,4 @@ -#include "Cluster/ClusterConsole.h" +#include "ClusterConsole.h" #include "IDisplayCluster.h" #include "Cluster/DisplayClusterClusterEvent.h" diff --git a/Source/RWTHVRCluster/Private/RWTHVRCluster.cpp b/Source/RWTHVRCluster/Private/RWTHVRCluster.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6aa76eeb8d429ebda4b86675d5aba6ef4a240a35 --- /dev/null +++ b/Source/RWTHVRCluster/Private/RWTHVRCluster.cpp @@ -0,0 +1,18 @@ +#include "RWTHVRCluster.h" + +#define LOCTEXT_NAMESPACE "FRWTHVRClusterModule" + +void FRWTHVRClusterModule::StartupModule () +{ + ClusterConsole.Register(); + CAVEOverlay.Register(); +} +void FRWTHVRClusterModule::ShutdownModule() +{ + ClusterConsole.Unregister(); + CAVEOverlay.Unregister(); +} + +#undef LOCTEXT_NAMESPACE + +IMPLEMENT_MODULE(FRWTHVRClusterModule, RWTHVRCluster) \ No newline at end of file diff --git a/Source/RWTHVRToolkit/Public/Cluster/CAVEOverlay/CAVEOverlay.h b/Source/RWTHVRCluster/Public/CAVEOverlay/CAVEOverlay.h similarity index 75% rename from Source/RWTHVRToolkit/Public/Cluster/CAVEOverlay/CAVEOverlay.h rename to Source/RWTHVRCluster/Public/CAVEOverlay/CAVEOverlay.h index c84304d4a6283fc37459a830c27bdffe88904b94..daed234366ae2877aee0a0f43141f5540ae682bd 100644 --- a/Source/RWTHVRToolkit/Public/Cluster/CAVEOverlay/CAVEOverlay.h +++ b/Source/RWTHVRCluster/Public/CAVEOverlay/CAVEOverlay.h @@ -2,8 +2,8 @@ #include "CoreMinimal.h" #include "Engine/World.h" -#include "Cluster/CAVEOverlay/CAVEOverlaySettings.h" -#include "Cluster/CAVEOverlay/CAVEOverlayController.h" +#include "CAVEOverlay/CAVEOverlaySettings.h" +#include "CAVEOverlay/CAVEOverlayController.h" #include "Kismet/GameplayStatics.h" #include "CAVEOverlay.generated.h" @@ -11,7 +11,7 @@ * Adds the warning tape, which appears if the user gets too close to the wall for the aixCAVE */ USTRUCT() -struct RWTHVRTOOLKIT_API FCAVEOverlay +struct RWTHVRCLUSTER_API FCAVEOverlay { GENERATED_BODY() diff --git a/Source/RWTHVRToolkit/Public/Cluster/CAVEOverlay/CAVEOverlayController.h b/Source/RWTHVRCluster/Public/CAVEOverlay/CAVEOverlayController.h similarity index 95% rename from Source/RWTHVRToolkit/Public/Cluster/CAVEOverlay/CAVEOverlayController.h rename to Source/RWTHVRCluster/Public/CAVEOverlay/CAVEOverlayController.h index 74d41de0c152f32bf77282f3955074fcef553869..1ac575b661a8374e026d2b9c0031c7972fa73152 100644 --- a/Source/RWTHVRToolkit/Public/Cluster/CAVEOverlay/CAVEOverlayController.h +++ b/Source/RWTHVRCluster/Public/CAVEOverlay/CAVEOverlayController.h @@ -2,7 +2,7 @@ #include "CoreMinimal.h" #include "GameFramework/Actor.h" -#include "Cluster/CAVEOverlay/DoorOverlayData.h" +#include "CAVEOverlay/DoorOverlayData.h" #include "Cluster/IDisplayClusterClusterManager.h" #include "Cluster/DisplayClusterClusterEvent.h" #include "CAVEOverlayController.generated.h" @@ -10,7 +10,7 @@ DECLARE_LOG_CATEGORY_EXTERN(LogCAVEOverlay, Log, All); UCLASS() -class RWTHVRTOOLKIT_API ACAVEOverlayController : public AActor +class RWTHVRCLUSTER_API ACAVEOverlayController : public AActor { GENERATED_BODY() diff --git a/Source/RWTHVRToolkit/Public/Cluster/CAVEOverlay/CAVEOverlaySettings.h b/Source/RWTHVRCluster/Public/CAVEOverlay/CAVEOverlaySettings.h similarity index 89% rename from Source/RWTHVRToolkit/Public/Cluster/CAVEOverlay/CAVEOverlaySettings.h rename to Source/RWTHVRCluster/Public/CAVEOverlay/CAVEOverlaySettings.h index f086b9df45ad1f176c221de958e42eeda766330e..5c3a81dbaee9e282e9dd294ba45454d8fc8495d2 100644 --- a/Source/RWTHVRToolkit/Public/Cluster/CAVEOverlay/CAVEOverlaySettings.h +++ b/Source/RWTHVRCluster/Public/CAVEOverlay/CAVEOverlaySettings.h @@ -11,7 +11,7 @@ enum DefaultActivationType }; UCLASS(config=Game, defaultconfig, meta=(DisplayName="CAVE Overlay")) -class RWTHVRTOOLKIT_API UCAVEOverlaySettings : public UDeveloperSettings +class RWTHVRCLUSTER_API UCAVEOverlaySettings : public UDeveloperSettings { GENERATED_BODY() diff --git a/Source/RWTHVRToolkit/Public/Cluster/CAVEOverlay/DoorOverlayData.h b/Source/RWTHVRCluster/Public/CAVEOverlay/DoorOverlayData.h similarity index 88% rename from Source/RWTHVRToolkit/Public/Cluster/CAVEOverlay/DoorOverlayData.h rename to Source/RWTHVRCluster/Public/CAVEOverlay/DoorOverlayData.h index 56ca400a5b5039e72a51211e9990f3453a472a1f..a9d9d380e1560ac309f9c8d113636cf47d0450f0 100644 --- a/Source/RWTHVRToolkit/Public/Cluster/CAVEOverlay/DoorOverlayData.h +++ b/Source/RWTHVRCluster/Public/CAVEOverlay/DoorOverlayData.h @@ -12,7 +12,7 @@ * Used as a parent-class in the overlay widget. Like this we can access the UMG properties in C++ */ UCLASS() -class RWTHVRTOOLKIT_API UDoorOverlayData : public UUserWidget +class RWTHVRCLUSTER_API UDoorOverlayData : public UUserWidget { GENERATED_BODY() diff --git a/Source/RWTHVRToolkit/Public/Cluster/ClusterConsole.h b/Source/RWTHVRCluster/Public/ClusterConsole.h similarity index 91% rename from Source/RWTHVRToolkit/Public/Cluster/ClusterConsole.h rename to Source/RWTHVRCluster/Public/ClusterConsole.h index 700dceb5bc51d1e27db4d7714d20bce0d8f7aa2e..81faf82f283e4d8ad19fdf160e08fc5a0812bce1 100644 --- a/Source/RWTHVRToolkit/Public/Cluster/ClusterConsole.h +++ b/Source/RWTHVRCluster/Public/ClusterConsole.h @@ -12,7 +12,7 @@ * This class has to be registered and unregistered. This can easily be done in every StartupModule/ShutdownModule functions. */ USTRUCT() -struct RWTHVRTOOLKIT_API FClusterConsole +struct RWTHVRCLUSTER_API FClusterConsole { GENERATED_BODY() private: diff --git a/Source/RWTHVRToolkit/Public/Cluster/Events/DisplayClusterEventParameterHelper.h b/Source/RWTHVRCluster/Public/Events/DisplayClusterEventParameterHelper.h similarity index 100% rename from Source/RWTHVRToolkit/Public/Cluster/Events/DisplayClusterEventParameterHelper.h rename to Source/RWTHVRCluster/Public/Events/DisplayClusterEventParameterHelper.h diff --git a/Source/RWTHVRToolkit/Public/Cluster/Events/DisplayClusterEventWrapper.h b/Source/RWTHVRCluster/Public/Events/DisplayClusterEventWrapper.h similarity index 100% rename from Source/RWTHVRToolkit/Public/Cluster/Events/DisplayClusterEventWrapper.h rename to Source/RWTHVRCluster/Public/Events/DisplayClusterEventWrapper.h diff --git a/Source/RWTHVRCluster/Public/RWTHVRCluster.h b/Source/RWTHVRCluster/Public/RWTHVRCluster.h new file mode 100644 index 0000000000000000000000000000000000000000..55849a21459f647e222291723beed6950550b107 --- /dev/null +++ b/Source/RWTHVRCluster/Public/RWTHVRCluster.h @@ -0,0 +1,17 @@ +#pragma once + +#include "CoreMinimal.h" +#include "CAVEOverlay/CAVEOverlay.h" +#include "Modules/ModuleManager.h" +#include "ClusterConsole.h" + +class FRWTHVRClusterModule : public IModuleInterface +{ +public: + virtual void StartupModule () override; + virtual void ShutdownModule() override; + +private: + FClusterConsole ClusterConsole; + FCAVEOverlay CAVEOverlay; +}; diff --git a/Source/RWTHVRCluster/RWTHVRCluster.Build.cs b/Source/RWTHVRCluster/RWTHVRCluster.Build.cs new file mode 100644 index 0000000000000000000000000000000000000000..64f40ab0705ede4185c4f352e6ec5ba2090bf233 --- /dev/null +++ b/Source/RWTHVRCluster/RWTHVRCluster.Build.cs @@ -0,0 +1,41 @@ +using UnrealBuildTool; + +public class RWTHVRCluster : ModuleRules +{ + public RWTHVRCluster(ReadOnlyTargetRules Target) : base(Target) + { + PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; + + PublicIncludePaths.AddRange( + new string[]{} + ); + + PrivateIncludePaths.AddRange( + new string[]{} + ); + + PublicDependencyModuleNames.AddRange( + new string[] + { + "Core", + "CoreUObject", + "Engine", + "RWTHVRToolkit", + "DisplayCluster", + "DeveloperSettings", + "InputCore", + "UMG", + "Slate", + "SlateCore" + } + ); + + PrivateDependencyModuleNames.AddRange( + new string[]{} + ); + + DynamicallyLoadedModuleNames.AddRange( + new string[] { } + ); + } +} diff --git a/Source/RWTHVRToolkit/Private/RWTHVRToolkit.cpp b/Source/RWTHVRToolkit/Private/RWTHVRToolkit.cpp index bf76c57c0140c3239bac2d16e89ee351364e0849..10abfc9a1cb160e9ef3edb307019e5a9a28a9f33 100644 --- a/Source/RWTHVRToolkit/Private/RWTHVRToolkit.cpp +++ b/Source/RWTHVRToolkit/Private/RWTHVRToolkit.cpp @@ -4,14 +4,10 @@ void FRWTHVRToolkitModule::StartupModule () { - ClusterConsole.Register(); - CAVEOverlay.Register(); ConsoleActivation.Register(); } void FRWTHVRToolkitModule::ShutdownModule() { - ClusterConsole.Unregister(); - CAVEOverlay.Unregister(); ConsoleActivation.Unregister(); } diff --git a/Source/RWTHVRToolkit/Private/Utility/VirtualRealityUtilities.cpp b/Source/RWTHVRToolkit/Private/Utility/VirtualRealityUtilities.cpp index fc48ac373904099b200bec3676d162482ceb0843..f014c535b0b271782b1cf9fd29500408c497e010 100644 --- a/Source/RWTHVRToolkit/Private/Utility/VirtualRealityUtilities.cpp +++ b/Source/RWTHVRToolkit/Private/Utility/VirtualRealityUtilities.cpp @@ -1,23 +1,33 @@ #include "Utility/VirtualRealityUtilities.h" -#include "Cluster/IDisplayClusterClusterManager.h" -#include "Components/DisplayClusterCameraComponent.h" -#include "Config/IDisplayClusterConfigManager.h" -#include "DisplayClusterRootActor.h" -#include "DisplayClusterConfigurationTypes.h" +#if PLATFORM_SUPPORTS_NDISPLAY + #include "Cluster/IDisplayClusterClusterManager.h" + #include "Components/DisplayClusterCameraComponent.h" + #include "Config/IDisplayClusterConfigManager.h" + #include "DisplayClusterRootActor.h" + #include "DisplayClusterConfigurationTypes.h" + #include "Game/IDisplayClusterGameManager.h" + #include "IDisplayCluster.h" +#endif + #include "Engine/Engine.h" -#include "Game/IDisplayClusterGameManager.h" -#include "IDisplayCluster.h" #include "IXRTrackingSystem.h" +#include "IHeadMountedDisplay.h" bool UVirtualRealityUtilities::IsDesktopMode() { return !IsRoomMountedMode() && !IsHeadMountedMode(); } + bool UVirtualRealityUtilities::IsRoomMountedMode() { +#if PLATFORM_SUPPORTS_NDISPLAY return IDisplayCluster::Get().GetOperationMode() == EDisplayClusterOperationMode::Cluster; +#else + return false; +#endif } + bool UVirtualRealityUtilities::IsHeadMountedMode() { return GEngine->XRSystem.IsValid() && GEngine->XRSystem->IsHeadTrackingAllowed(); @@ -25,34 +35,47 @@ bool UVirtualRealityUtilities::IsHeadMountedMode() bool UVirtualRealityUtilities::IsCave() { +#if PLATFORM_SUPPORTS_NDISPLAY if(!IsRoomMountedMode()) return false; const UDisplayClusterConfigurationData* ClusterConfig = IDisplayCluster::Get().GetConfigMgr()->GetConfig(); return ClusterConfig->CustomParameters.Contains("Hardware_Platform") && ClusterConfig->CustomParameters.Find("Hardware_Platform")->Equals("aixcave", ESearchCase::IgnoreCase); +#else + return false; +#endif } bool UVirtualRealityUtilities::IsTdw() { +#if PLATFORM_SUPPORTS_NDISPLAY if(!IsRoomMountedMode()) return false; const UDisplayClusterConfigurationData* ClusterConfig = IDisplayCluster::Get().GetConfigMgr()->GetConfig(); return ClusterConfig->CustomParameters.Contains("Hardware_Platform") && ClusterConfig->CustomParameters.Find("Hardware_Platform")->Equals("TiledDisplayWall", ESearchCase::IgnoreCase); +#else + return false; +#endif } bool UVirtualRealityUtilities::IsRolv() { +#if PLATFORM_SUPPORTS_NDISPLAY if(!IsRoomMountedMode()) return false; const UDisplayClusterConfigurationData* ClusterConfig = IDisplayCluster::Get().GetConfigMgr()->GetConfig(); return ClusterConfig->CustomParameters.Contains("Hardware_Platform") && ClusterConfig->CustomParameters.Find("Hardware_Platform")->Equals("ROLV", ESearchCase::IgnoreCase); +#else + return false; +#endif } /* Return true on the Master in cluster mode and in a normal desktop session. Otherwise false */ bool UVirtualRealityUtilities::IsMaster() { +#if PLATFORM_SUPPORTS_NDISPLAY if (!IDisplayCluster::IsAvailable()) { return true; @@ -63,6 +86,9 @@ bool UVirtualRealityUtilities::IsMaster() return true; // if we are not in cluster mode, we are always the master } return Manager->IsMaster() || !Manager->IsSlave(); +#else + return true; +#endif } bool UVirtualRealityUtilities::IsSlave() @@ -72,27 +98,51 @@ bool UVirtualRealityUtilities::IsSlave() FString UVirtualRealityUtilities::GetNodeName() { +#if PLATFORM_SUPPORTS_NDISPLAY return IsRoomMountedMode() ? IDisplayCluster::Get().GetClusterMgr()->GetNodeId() : FString(TEXT("Localhost")); +#else + return FString(TEXT("Localhost")); +#endif } + float UVirtualRealityUtilities::GetEyeDistance() { - ADisplayClusterRootActor* RootActor = IDisplayCluster::Get().GetGameMgr()->GetRootActor(); - return (RootActor) ? RootActor->GetDefaultCamera()->GetInterpupillaryDistance() : 0; + if(IsHeadMountedMode()) + { + return GEngine->XRSystem->GetHMDDevice()->GetInterpupillaryDistance(); + } + else + { +#if PLATFORM_SUPPORTS_NDISPLAY + ADisplayClusterRootActor* RootActor = IDisplayCluster::Get().GetGameMgr()->GetRootActor(); + return (RootActor) ? RootActor->GetDefaultCamera()->GetInterpupillaryDistance() : 0.0f; +#else + return 0.0f; +#endif + } } -EDisplayClusterEyeStereoOffset UVirtualRealityUtilities::GetNodeEyeType() +EEyeStereoOffset UVirtualRealityUtilities::GetNodeEyeType() { +#if PLATFORM_SUPPORTS_NDISPLAY ADisplayClusterRootActor* RootActor = IDisplayCluster::Get().GetGameMgr()->GetRootActor(); - return (RootActor) ? RootActor->GetDefaultCamera()->GetStereoOffset() : EDisplayClusterEyeStereoOffset::None; + return static_cast<EEyeStereoOffset>((RootActor) ? RootActor->GetDefaultCamera()->GetStereoOffset() : EDisplayClusterEyeStereoOffset::None); +#else + return EDisplayClusterEyeStereoOffset::None; +#endif } -UDisplayClusterSceneComponent* UVirtualRealityUtilities::GetClusterComponent(const FString& Name) +USceneComponent* UVirtualRealityUtilities::GetClusterComponent(const FString& Name) { +#if PLATFORM_SUPPORTS_NDISPLAY ADisplayClusterRootActor* RootActor = IDisplayCluster::Get().GetGameMgr()->GetRootActor(); return (RootActor) ? RootActor->GetComponentById(Name) : nullptr; +#else + return nullptr; +#endif } -UDisplayClusterSceneComponent* UVirtualRealityUtilities::GetNamedClusterComponent(const ENamedClusterComponent& Component) +USceneComponent* UVirtualRealityUtilities::GetNamedClusterComponent(const ENamedClusterComponent& Component) { switch(Component) { @@ -107,7 +157,7 @@ UDisplayClusterSceneComponent* UVirtualRealityUtilities::GetNamedClusterComponen case ENamedClusterComponent::NCC_TDW_CENTER: return GetClusterComponent("tdw_center"); case ENamedClusterComponent::NCC_CALIBRATIO: return GetClusterComponent("calibratio"); case ENamedClusterComponent::NCC_TRACKING_ORIGIN: - UDisplayClusterSceneComponent* Result; + USceneComponent* Result; if((Result = GetClusterComponent("cave_origin"))) return Result; if((Result = GetClusterComponent("rolv_origin"))) return Result; if((Result = GetClusterComponent("tdw_origin_floor"))) return Result; diff --git a/Source/RWTHVRToolkit/Public/RWTHVRToolkit.h b/Source/RWTHVRToolkit/Public/RWTHVRToolkit.h index eb0b6662ae73da395fcd4c433b6ad601ca0c8ba1..56caf39bd46eafe702cbe60e8a986f8ba68f8fa6 100644 --- a/Source/RWTHVRToolkit/Public/RWTHVRToolkit.h +++ b/Source/RWTHVRToolkit/Public/RWTHVRToolkit.h @@ -1,12 +1,9 @@ #pragma once #include "CoreMinimal.h" -#include "Cluster/CAVEOverlay/CAVEOverlay.h" #include "Modules/ModuleManager.h" -#include "Cluster/ClusterConsole.h" #include "Fixes/ActivateConsoleInShipping.h" - class FRWTHVRToolkitModule : public IModuleInterface { public: @@ -14,7 +11,5 @@ public: virtual void ShutdownModule() override; private: - FClusterConsole ClusterConsole; - FCAVEOverlay CAVEOverlay; FActivateConsoleInShipping ConsoleActivation; }; diff --git a/Source/RWTHVRToolkit/Public/Utility/VirtualRealityUtilities.h b/Source/RWTHVRToolkit/Public/Utility/VirtualRealityUtilities.h index 19cb4f585bf479fdc09e71b00d6bbf911d0b6fba..7f262810e61cd6668a85192fc9c12b73d4c7e297 100644 --- a/Source/RWTHVRToolkit/Public/Utility/VirtualRealityUtilities.h +++ b/Source/RWTHVRToolkit/Public/Utility/VirtualRealityUtilities.h @@ -1,81 +1,89 @@ -#pragma once - -#include "Components/DisplayClusterCameraComponent.h" -#include "CoreMinimal.h" -#include "Kismet/BlueprintFunctionLibrary.h" -#include "VirtualRealityUtilities.generated.h" - -UENUM(BlueprintType) -enum class ENamedClusterComponent : uint8 -{ - /* CAVE Specific */ - NCC_CAVE_ORIGIN UMETA(DisplayName = "CAVE Origin"), - NCC_CAVE_CENTER UMETA(DisplayName = "CAVE Center"), - NCC_CAVE_LHT UMETA(DisplayName = "CAVE Left Hand Target"), - NCC_CAVE_RHT UMETA(DisplayName = "CAVE Right Hand Target"), - - /* ROLV Specific */ - NCC_ROLV_ORIGIN UMETA(DisplayName = "ROLV Origin"), - - /* TDW Specific */ - NCC_TDW_ORIGIN UMETA(DisplayName = "TDW Origin"), - NCC_TDW_CENTER UMETA(DisplayName = "TDW Center"), - - /* Non Specific */ - NCC_CALIBRATIO UMETA(DisplayName = "Calibratio Motion to Photon Measurement Device"), - NCC_SHUTTERGLASSES UMETA(DisplayName = "CAVE/ROLV/TDW Shutter Glasses"), - NCC_FLYSTICK UMETA(DisplayName = "CAVE/ROLV/TDW Flystick"), - NCC_TRACKING_ORIGIN UMETA(DisplayName = "CAVE/ROLV/TDW Origin") -}; - -UCLASS() -class RWTHVRTOOLKIT_API UVirtualRealityUtilities : public UBlueprintFunctionLibrary -{ - GENERATED_BODY() - -public: - UFUNCTION(BlueprintPure, Category = "DisplayCluster|Platform") static bool IsDesktopMode(); - UFUNCTION(BlueprintPure, Category = "DisplayCluster|Platform") static bool IsRoomMountedMode(); - UFUNCTION(BlueprintPure, Category = "DisplayCluster|Platform") static bool IsHeadMountedMode(); - UFUNCTION(BlueprintPure, Category = "DisplayCluster|Platform") static bool IsCave(); - UFUNCTION(BlueprintPure, Category = "DisplayCluster|Platform") static bool IsTdw(); - UFUNCTION(BlueprintPure, Category = "DisplayCluster|Platform") static bool IsRolv(); - - UFUNCTION(BlueprintPure, Category = "DisplayCluster") static bool IsMaster(); - UFUNCTION(BlueprintPure, Category = "DisplayCluster") static bool IsSlave(); - - UFUNCTION(BlueprintPure, Category = "DisplayCluster") static FString GetNodeName(); - UFUNCTION(BlueprintPure, Category = "DisplayCluster") static float GetEyeDistance(); - - UFUNCTION(BlueprintPure, Category = "DisplayCluster") static EDisplayClusterEyeStereoOffset GetNodeEyeType(); - - //Get Compenent of Display Cluster by it's name, which is specified in the nDisplay config - UFUNCTION(BlueprintPure, BlueprintCallable, Category = "DisplayCluster") static UDisplayClusterSceneComponent* GetClusterComponent(const FString& Name); - UFUNCTION(BlueprintPure, BlueprintCallable, Category = "DisplayCluster") static UDisplayClusterSceneComponent* GetNamedClusterComponent(const ENamedClusterComponent& Component); - - /* Load and create an Object from an asset path. This only works in the constructor */ - template <class T> - static bool LoadAsset(const FString& Path, T*& Result); - - /* Finds and returns a class of an asset. This only works in the constructor */ - template <class T> - static bool LoadClass(const FString& Path, TSubclassOf<T>& Result); -}; - -template <typename T> -bool UVirtualRealityUtilities::LoadAsset(const FString& Path, T* & Result) -{ - ConstructorHelpers::FObjectFinder<T> Loader(*Path); - Result = Loader.Object; - if (!Loader.Succeeded()) UE_LOG(LogTemp, Error, TEXT("Could not find %s. Have you renamed it?"), *Path); - return Loader.Succeeded(); -} - -template <typename T> -bool UVirtualRealityUtilities::LoadClass(const FString& Path, TSubclassOf<T> & Result) -{ - ConstructorHelpers::FClassFinder<T> Loader(*Path); - Result = Loader.Class; - if (!Loader.Succeeded()) UE_LOG(LogTemp, Error, TEXT("Could not find %s. Have you renamed it?"), *Path); - return Loader.Succeeded(); -} \ No newline at end of file +#pragma once + +#include "CoreMinimal.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "VirtualRealityUtilities.generated.h" + +UENUM(BlueprintType) +enum class ENamedClusterComponent : uint8 +{ + /* CAVE Specific */ + NCC_CAVE_ORIGIN UMETA(DisplayName = "CAVE Origin"), + NCC_CAVE_CENTER UMETA(DisplayName = "CAVE Center"), + NCC_CAVE_LHT UMETA(DisplayName = "CAVE Left Hand Target"), + NCC_CAVE_RHT UMETA(DisplayName = "CAVE Right Hand Target"), + + /* ROLV Specific */ + NCC_ROLV_ORIGIN UMETA(DisplayName = "ROLV Origin"), + + /* TDW Specific */ + NCC_TDW_ORIGIN UMETA(DisplayName = "TDW Origin"), + NCC_TDW_CENTER UMETA(DisplayName = "TDW Center"), + + /* Non Specific */ + NCC_CALIBRATIO UMETA(DisplayName = "Calibratio Motion to Photon Measurement Device"), + NCC_SHUTTERGLASSES UMETA(DisplayName = "CAVE/ROLV/TDW Shutter Glasses"), + NCC_FLYSTICK UMETA(DisplayName = "CAVE/ROLV/TDW Flystick"), + NCC_TRACKING_ORIGIN UMETA(DisplayName = "CAVE/ROLV/TDW Origin") +}; + +UENUM() +enum class EEyeStereoOffset +{ + None, + Left, + Right +}; + +UCLASS() +class RWTHVRTOOLKIT_API UVirtualRealityUtilities : public UBlueprintFunctionLibrary +{ + GENERATED_BODY() + +public: + UFUNCTION(BlueprintPure, Category = "DisplayCluster|Platform") static bool IsDesktopMode(); + UFUNCTION(BlueprintPure, Category = "DisplayCluster|Platform") static bool IsRoomMountedMode(); + UFUNCTION(BlueprintPure, Category = "DisplayCluster|Platform") static bool IsHeadMountedMode(); + UFUNCTION(BlueprintPure, Category = "DisplayCluster|Platform") static bool IsCave(); + UFUNCTION(BlueprintPure, Category = "DisplayCluster|Platform") static bool IsTdw(); + UFUNCTION(BlueprintPure, Category = "DisplayCluster|Platform") static bool IsRolv(); + + UFUNCTION(BlueprintPure, Category = "DisplayCluster") static bool IsMaster(); + UFUNCTION(BlueprintPure, Category = "DisplayCluster") static bool IsSlave(); + + UFUNCTION(BlueprintPure, Category = "DisplayCluster") static FString GetNodeName(); + /* Distance in meters */ + UFUNCTION(BlueprintPure, Category = "DisplayCluster") static float GetEyeDistance(); + + UFUNCTION(BlueprintPure, Category = "DisplayCluster") static EEyeStereoOffset GetNodeEyeType(); + + //Get Component of Display Cluster by it's name, which is specified in the nDisplay config + UFUNCTION(BlueprintPure, BlueprintCallable, Category = "DisplayCluster") static USceneComponent* GetClusterComponent(const FString& Name); + UFUNCTION(BlueprintPure, BlueprintCallable, Category = "DisplayCluster") static USceneComponent* GetNamedClusterComponent(const ENamedClusterComponent& Component); + + /* Load and create an Object from an asset path. This only works in the constructor */ + template <class T> + static bool LoadAsset(const FString& Path, T*& Result); + + /* Finds and returns a class of an asset. This only works in the constructor */ + template <class T> + static bool LoadClass(const FString& Path, TSubclassOf<T>& Result); +}; + +template <typename T> +bool UVirtualRealityUtilities::LoadAsset(const FString& Path, T* & Result) +{ + ConstructorHelpers::FObjectFinder<T> Loader(*Path); + Result = Loader.Object; + if (!Loader.Succeeded()) UE_LOG(LogTemp, Error, TEXT("Could not find %s. Have you renamed it?"), *Path); + return Loader.Succeeded(); +} + +template <typename T> +bool UVirtualRealityUtilities::LoadClass(const FString& Path, TSubclassOf<T> & Result) +{ + ConstructorHelpers::FClassFinder<T> Loader(*Path); + Result = Loader.Class; + if (!Loader.Succeeded()) UE_LOG(LogTemp, Error, TEXT("Could not find %s. Have you renamed it?"), *Path); + return Loader.Succeeded(); +} diff --git a/Source/RWTHVRToolkit/RWTHVRToolkit.Build.cs b/Source/RWTHVRToolkit/RWTHVRToolkit.Build.cs index c2703457413cc20fb359f66262c73e04294b4b29..8326044abdc7d5befc32b973a65af29133cf3346 100644 --- a/Source/RWTHVRToolkit/RWTHVRToolkit.Build.cs +++ b/Source/RWTHVRToolkit/RWTHVRToolkit.Build.cs @@ -2,57 +2,50 @@ using UnrealBuildTool; public class RWTHVRToolkit : ModuleRules { - public RWTHVRToolkit(ReadOnlyTargetRules Target) : base(Target) - { - PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; - - PublicIncludePaths.AddRange( - new string[] - { - - } - ); - - - PrivateIncludePaths.AddRange( - new string[] - { - - } - ); - - - PublicDependencyModuleNames.AddRange( - new string[] - { - "Core", - "CoreUObject", - "DisplayCluster", - "Engine", - "HeadMountedDisplay", - "InputCore", - "UMG", - "Slate", - "SlateCore", - "DeveloperSettings", - "Http" - } - ); - - - PrivateDependencyModuleNames.AddRange( - new string[] - { - - } - ); - - - DynamicallyLoadedModuleNames.AddRange( - new string[] - { - - } - ); - } + public RWTHVRToolkit(ReadOnlyTargetRules Target) : base(Target) + { + PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; + + PublicIncludePaths.AddRange( + new string[]{} + ); + + PrivateIncludePaths.AddRange( + new string[]{} + ); + + PublicDependencyModuleNames.AddRange( + new string[] + { + "Core", + "CoreUObject", + "Engine", + "HeadMountedDisplay", + "InputCore", + "UMG", + "Slate", + "SlateCore", + "DeveloperSettings", + "Http" + } + ); + + PrivateDependencyModuleNames.AddRange( + new string[]{} + ); + + DynamicallyLoadedModuleNames.AddRange( + new string[]{} + ); + + if(Target.Platform == UnrealTargetPlatform.Win64 || Target.Platform == UnrealTargetPlatform.Linux) + { + PublicDependencyModuleNames.Add("DisplayCluster"); + PublicDefinitions.Add("PLATFORM_SUPPORTS_NDISPLAY=1"); + } + else + { + PublicDefinitions.Add("PLATFORM_SUPPORTS_NDISPLAY=0"); + } + } } diff --git a/Source/RWTHVRToolkitEditor/RWTHVRToolkitEditor.Build.cs b/Source/RWTHVRToolkitEditor/RWTHVRToolkitEditor.Build.cs index f2b52dc9f12da22f9ae1408f9a80139fd9fb654a..a1e2b6c35cb009d4cd98f0050d317e5d9941879e 100644 --- a/Source/RWTHVRToolkitEditor/RWTHVRToolkitEditor.Build.cs +++ b/Source/RWTHVRToolkitEditor/RWTHVRToolkitEditor.Build.cs @@ -11,7 +11,6 @@ public class RWTHVRToolkitEditor : ModuleRules { "Core", "CoreUObject", - "DisplayCluster", "Engine", "UnrealEd", "ComponentVisualizers",