diff --git a/Content/BP_CaveSetup.uasset b/Content/BP_CaveSetup.uasset deleted file mode 100644 index e460e3d99b640f1e6996f0f243a89a6e2b4900cf..0000000000000000000000000000000000000000 Binary files a/Content/BP_CaveSetup.uasset and /dev/null differ diff --git a/Content/Config/ExampleConfigs/NDC_CaveSmall.ndisplay b/Content/Config/ExampleConfigs/NDC_CaveSmall.ndisplay new file mode 100644 index 0000000000000000000000000000000000000000..4a16f45e48d97358caedf54742aff25f9f204464 --- /dev/null +++ b/Content/Config/ExampleConfigs/NDC_CaveSmall.ndisplay @@ -0,0 +1,464 @@ +{ + "nDisplay": + { + "description": "nDisplay configuration", + "version": "5.00", + "assetPath": "/RWTHVRCluster/Config/ExampleConfigs/NDC_CaveSmall.NDC_CaveSmall", + "misc": + { + "bFollowLocalPlayerCamera": false, + "bExitOnEsc": true, + "bOverrideViewportsFromExternalConfig": true, + "bOverrideTransformsFromExternalConfig": false + }, + "scene": + { + "xforms": + { + "cave_origin": + { + "parentId": "", + "location": + { + "x": 0, + "y": 0, + "z": 10 + }, + "rotation": + { + "pitch": 0, + "yaw": 0, + "roll": 0 + } + }, + "cave_center": + { + "parentId": "cave_origin", + "location": + { + "x": 0, + "y": 0, + "z": 100 + }, + "rotation": + { + "pitch": 0, + "yaw": 0, + "roll": 0 + } + }, + "display_floor": + { + "parentId": "cave_center", + "location": + { + "x": 0, + "y": 0, + "z": -100 + }, + "rotation": + { + "pitch": -90, + "yaw": 0, + "roll": -0 + } + }, + "angle_left": + { + "parentId": "cave_center", + "location": + { + "x": 150, + "y": -150, + "z": 0 + }, + "rotation": + { + "pitch": -0, + "yaw": -89.999992370605469, + "roll": 0 + } + }, + "display_left": + { + "parentId": "angle_left", + "location": + { + "x": -1.52587890625e-05, + "y": -149.99996948242188, + "z": 0 + }, + "rotation": + { + "pitch": 0, + "yaw": 0, + "roll": 0 + } + }, + "angle_right": + { + "parentId": "cave_center", + "location": + { + "x": 150, + "y": 150, + "z": 0 + }, + "rotation": + { + "pitch": 0, + "yaw": 89.999992370605469, + "roll": -0 + } + }, + "display_right": + { + "parentId": "angle_right", + "location": + { + "x": 0, + "y": 150, + "z": 0 + }, + "rotation": + { + "pitch": 0, + "yaw": 0, + "roll": 0 + } + } + }, + "cameras": + { + "DefaultViewPoint": + { + "interpupillaryDistance": 6.4000000953674316, + "swapEyes": false, + "stereoOffset": "none", + "parentId": "", + "location": + { + "x": 0, + "y": 0, + "z": 50 + }, + "rotation": + { + "pitch": 0, + "yaw": 0, + "roll": 0 + } + } + }, + "screens": + { + "scr_left": + { + "size": + { + "width": 300, + "height": 200 + }, + "parentId": "display_left", + "location": + { + "x": 0, + "y": 0, + "z": 0 + }, + "rotation": + { + "pitch": 0, + "yaw": 0, + "roll": 0 + } + }, + "scr_right": + { + "size": + { + "width": 300, + "height": 200 + }, + "parentId": "display_right", + "location": + { + "x": 0, + "y": 0, + "z": 0 + }, + "rotation": + { + "pitch": 0, + "yaw": 0, + "roll": 0 + } + }, + "scr_floor": + { + "size": + { + "width": 300, + "height": 300 + }, + "parentId": "display_floor", + "location": + { + "x": 0, + "y": 0, + "z": 0 + }, + "rotation": + { + "pitch": 0, + "yaw": 0, + "roll": 0 + } + } + } + }, + "cluster": + { + "primaryNode": + { + "id": "node_left", + "ports": + { + "ClusterSync": 41001, + "ClusterEventsJson": 41003, + "ClusterEventsBinary": 41004 + } + }, + "sync": + { + "renderSyncPolicy": + { + "type": "ethernet", + "parameters": + { + } + }, + "inputSyncPolicy": + { + "type": "ReplicatePrimary", + "parameters": + { + } + } + }, + "network": + { + "ConnectRetriesAmount": "300", + "ConnectRetryDelay": "1000", + "GameStartBarrierTimeout": "18000000", + "FrameStartBarrierTimeout": "1800000", + "FrameEndBarrierTimeout": "1800000", + "RenderSyncBarrierTimeout": "1800000" + }, + "failover": + { + "failoverPolicy": "Disabled" + }, + "nodes": + { + "node_left": + { + "host": "127.0.0.1", + "sound": true, + "fullScreen": false, + "renderHeadless": false, + "graphicsAdapter": -1, + "textureShare": false, + "window": + { + "x": 120, + "y": 680, + "w": 600, + "h": 400 + }, + "postprocess": + { + }, + "viewports": + { + "vp_left": + { + "camera": "DefaultViewPoint", + "bufferRatio": 1, + "gPUIndex": -1, + "allowCrossGPUTransfer": false, + "isShared": false, + "overscan": + { + "bEnabled": false, + "mode": "percent", + "left": 0, + "right": 0, + "top": 0, + "bottom": 0, + "oversize": true + }, + "region": + { + "x": 0, + "y": 8, + "w": 600, + "h": 400 + }, + "projectionPolicy": + { + "type": "simple", + "parameters": + { + "screen": "scr_left" + } + } + } + }, + "outputRemap": + { + "bEnable": false, + "dataSource": "mesh", + "staticMeshAsset": "", + "externalFile": "" + } + }, + "node_right": + { + "host": "127.0.0.1", + "sound": false, + "fullScreen": false, + "renderHeadless": false, + "graphicsAdapter": -1, + "textureShare": false, + "window": + { + "x": 1320, + "y": 680, + "w": 600, + "h": 400 + }, + "postprocess": + { + }, + "viewports": + { + "vp_right": + { + "camera": "DefaultViewPoint", + "bufferRatio": 1, + "gPUIndex": -1, + "allowCrossGPUTransfer": false, + "isShared": false, + "overscan": + { + "bEnabled": false, + "mode": "percent", + "left": 0, + "right": 0, + "top": 0, + "bottom": 0, + "oversize": true + }, + "region": + { + "x": 0, + "y": 0, + "w": 600, + "h": 400 + }, + "projectionPolicy": + { + "type": "simple", + "parameters": + { + "screen": "scr_right" + } + } + } + }, + "outputRemap": + { + "bEnable": false, + "dataSource": "mesh", + "staticMeshAsset": "", + "externalFile": "" + } + }, + "node_floor": + { + "host": "127.0.0.1", + "sound": false, + "fullScreen": false, + "renderHeadless": false, + "graphicsAdapter": -1, + "textureShare": false, + "window": + { + "x": 720, + "y": 480, + "w": 600, + "h": 600 + }, + "postprocess": + { + }, + "viewports": + { + "vp_floor": + { + "camera": "DefaultViewPoint", + "bufferRatio": 1, + "gPUIndex": -1, + "allowCrossGPUTransfer": false, + "isShared": false, + "overscan": + { + "bEnabled": false, + "mode": "percent", + "left": 0, + "right": 0, + "top": 0, + "bottom": 0, + "oversize": true + }, + "region": + { + "x": 0, + "y": 0, + "w": 600, + "h": 600 + }, + "projectionPolicy": + { + "type": "simple", + "parameters": + { + "screen": "scr_floor" + } + } + } + }, + "outputRemap": + { + "bEnable": false, + "dataSource": "mesh", + "staticMeshAsset": "", + "externalFile": "" + } + } + } + }, + "customParameters": + { + "SampleArg1": "SampleVal1", + "SampleArg2": "SampleVal2" + }, + "diagnostics": + { + "simulateLag": false, + "minLagTime": 0.0099999997764825821, + "maxLagTime": 0.5 + } + } +} \ No newline at end of file diff --git a/Content/Config/ExampleConfigs/NDC_CaveSmall.uasset b/Content/Config/ExampleConfigs/NDC_CaveSmall.uasset new file mode 100644 index 0000000000000000000000000000000000000000..554f3730d3b8cf04627b71be986a2a0682eb0a81 Binary files /dev/null and b/Content/Config/ExampleConfigs/NDC_CaveSmall.uasset differ diff --git a/Content/Config/ExampleConfigs/NDC_CaveUnwrap.ndisplay b/Content/Config/ExampleConfigs/NDC_CaveUnwrap.ndisplay index 72f605563e2f335dfbb27c6b83dcd378062fe453..76f41033352e2a62a07198def9a74a0fbb1e8669 100644 --- a/Content/Config/ExampleConfigs/NDC_CaveUnwrap.ndisplay +++ b/Content/Config/ExampleConfigs/NDC_CaveUnwrap.ndisplay @@ -8,7 +8,8 @@ { "bFollowLocalPlayerCamera": false, "bExitOnEsc": true, - "bOverrideViewportsFromExternalConfig": true + "bOverrideViewportsFromExternalConfig": true, + "bOverrideTransformsFromExternalConfig": false }, "scene": { diff --git a/Content/Config/aixcave.uasset b/Content/Config/aixcave.uasset index 14b3a291ae507cbd495770b0d5c3e24777756ca2..65937f62a73760ab23516ebb89cda72c808f22aa 100644 Binary files a/Content/Config/aixcave.uasset and b/Content/Config/aixcave.uasset differ diff --git a/Source/RWTHVRCluster/Private/CaveSetup.cpp b/Source/RWTHVRCluster/Private/CaveSetupComponent.cpp similarity index 73% rename from Source/RWTHVRCluster/Private/CaveSetup.cpp rename to Source/RWTHVRCluster/Private/CaveSetupComponent.cpp index 369f4e998f801a5638b02ac41ed79fb92fc61c89..9688e36d93c1be44597328a166a66e8b5ba3edd2 100644 --- a/Source/RWTHVRCluster/Private/CaveSetup.cpp +++ b/Source/RWTHVRCluster/Private/CaveSetupComponent.cpp @@ -1,26 +1,22 @@ // Fill out your copyright notice in the Description page of Project Settings. -#include "CaveSetup.h" - +#include "CaveSetupComponent.h" +#include "LiveLinkPreset.h" #include "Logging/StructuredLog.h" #include "Utility/RWTHVRClusterUtilities.h" -// Sets default values -ACaveSetup::ACaveSetup() +UCaveSetupComponent::UCaveSetupComponent() { - PrimaryActorTick.bCanEverTick = false; - SetActorEnableCollision(false); - - // Actor needs to replicate, as it is attached to the pawn on the server. - bReplicates = true; + PrimaryComponentTick.bCanEverTick = false; + SetIsReplicatedByDefault(false); } -// Called when the game starts or when spawned -void ACaveSetup::BeginPlay() +void UCaveSetupComponent::BeginPlay() { Super::BeginPlay(); + if (!URWTHVRClusterUtilities::IsRoomMountedMode()) { UE_LOGFMT(RWTHVRCluster, Display, "CaveSetup: Not in RoomMountedMode, doing nothing."); @@ -33,7 +29,7 @@ void ACaveSetup::BeginPlay() if (const auto World = GetWorld()) { const auto Actor = World->SpawnActor(ActorClass); - Actor->AttachToActor(this, FAttachmentTransformRules::SnapToTargetNotIncludingScale); + Actor->AttachToActor(GetOwner(), FAttachmentTransformRules::SnapToTargetNotIncludingScale); UE_LOGFMT(RWTHVRCluster, Display, "CaveSetup: Spawned Actor {Actor} on the Cave and attached it.", Actor->GetName()); } diff --git a/Source/RWTHVRCluster/Private/Utility/RWTHVRClusterUtilities.cpp b/Source/RWTHVRCluster/Private/Utility/RWTHVRClusterUtilities.cpp index 28934758424630e5498f3d90d14f980cb1bf225b..49760e953659eb468879cb23c0e71532a6d2207b 100644 --- a/Source/RWTHVRCluster/Private/Utility/RWTHVRClusterUtilities.cpp +++ b/Source/RWTHVRCluster/Private/Utility/RWTHVRClusterUtilities.cpp @@ -70,43 +70,3 @@ EDisplayClusterEyeStereoOffset URWTHVRClusterUtilities::GetNodeEyeType() const ADisplayClusterRootActor* RootActor = IDisplayCluster::Get().GetGameMgr()->GetRootActor(); return (RootActor) ? RootActor->GetDefaultCamera()->GetStereoOffset() : EDisplayClusterEyeStereoOffset::None; } - -USceneComponent* URWTHVRClusterUtilities::GetClusterComponent(const FString& Name) -{ - const ADisplayClusterRootActor* RootActor = IDisplayCluster::Get().GetGameMgr()->GetRootActor(); - return (RootActor) ? RootActor->GetComponentByName<USceneComponent>(Name) : nullptr; -} - -USceneComponent* URWTHVRClusterUtilities::GetNamedClusterComponent(const ENamedClusterComponent& Component) -{ - switch (Component) - { - case ENamedClusterComponent::NCC_CAVE_ORIGIN: - return GetClusterComponent("cave_origin"); - case ENamedClusterComponent::NCC_CAVE_CENTER: - return GetClusterComponent("cave_center"); - case ENamedClusterComponent::NCC_CAVE_LHT: - return GetClusterComponent("left_hand_target"); - case ENamedClusterComponent::NCC_CAVE_RHT: - return GetClusterComponent("right_hand_target"); - case ENamedClusterComponent::NCC_SHUTTERGLASSES: - return GetClusterComponent("shutter_glasses"); - case ENamedClusterComponent::NCC_ROLV_ORIGIN: - return GetClusterComponent("rolv_origin"); - case ENamedClusterComponent::NCC_FLYSTICK: - return GetClusterComponent("flystick"); - case ENamedClusterComponent::NCC_CALIBRATIO: - return GetClusterComponent("calibratio"); - case ENamedClusterComponent::NCC_TRACKING_ORIGIN: - USceneComponent* Result; - if ((Result = GetClusterComponent("cave_origin"))) - return Result; - if ((Result = GetClusterComponent("rolv_origin"))) - return Result; - if ((Result = GetClusterComponent("tdw_origin_floor"))) - return Result; - return nullptr; - default: - return nullptr; - } -} diff --git a/Source/RWTHVRCluster/Public/CaveSetup.h b/Source/RWTHVRCluster/Public/CaveSetup.h deleted file mode 100644 index 793d72c9ff419ce35aade0784a2d076cbff3a37e..0000000000000000000000000000000000000000 --- a/Source/RWTHVRCluster/Public/CaveSetup.h +++ /dev/null @@ -1,33 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - -#pragma once - -#include "CoreMinimal.h" -#include "LiveLinkPreset.h" -#include "GameFramework/Actor.h" -#include "CaveSetup.generated.h" - -/** - * Simple Actor that needs to be added to the level which spawns Cave-related actors - * such as the CaveOverlay. - * It attaches itself to the Primary Node's Pawn and then replicates on the server. - */ - -UCLASS(hideCategories = (Rendering, Input, Actor, Base, Collision, Shape, Physics, HLOD)) -class RWTHVRCLUSTER_API ACaveSetup : public AActor -{ - GENERATED_BODY() - -public: - ACaveSetup(); - - UPROPERTY(EditAnywhere) - TArray<UClass*> ActorsToSpawnOnCave; - - UPROPERTY(EditAnywhere, BlueprintReadWrite) - ULiveLinkPreset* LiveLinkPresetToApplyOnCave; - -protected: - // Called when the game starts or when spawned - virtual void BeginPlay() override; -}; diff --git a/Source/RWTHVRCluster/Public/CaveSetupComponent.h b/Source/RWTHVRCluster/Public/CaveSetupComponent.h new file mode 100644 index 0000000000000000000000000000000000000000..8e2e30ebf6a31cc337fb76fba5a70794190dc199 --- /dev/null +++ b/Source/RWTHVRCluster/Public/CaveSetupComponent.h @@ -0,0 +1,30 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" + +#include "CaveSetupComponent.generated.h" + +class ULiveLinkPreset; + +UCLASS(ClassGroup = (Custom), meta = (BlueprintSpawnableComponent), + hideCategories = (Rendering, Input, Actor, Base, Collision, Shape, Physics, HLOD)) +class RWTHVRCLUSTER_API UCaveSetupComponent : public UActorComponent +{ + GENERATED_BODY() + +public: + // Sets default values for this component's properties + UCaveSetupComponent(); + + UPROPERTY(EditAnywhere) + TArray<UClass*> ActorsToSpawnOnCave; + + UPROPERTY(EditAnywhere, BlueprintReadWrite) + ULiveLinkPreset* LiveLinkPresetToApplyOnCave; + +protected: + // Called when the game starts + virtual void BeginPlay() override; +}; diff --git a/Source/RWTHVRCluster/Public/Utility/RWTHVRClusterUtilities.h b/Source/RWTHVRCluster/Public/Utility/RWTHVRClusterUtilities.h index 0ead84a997d31bafc12f76475a8917943534f39b..ded7d9d2728685d745b2705817e8d25616c85e4d 100644 --- a/Source/RWTHVRCluster/Public/Utility/RWTHVRClusterUtilities.h +++ b/Source/RWTHVRCluster/Public/Utility/RWTHVRClusterUtilities.h @@ -58,13 +58,4 @@ public: UFUNCTION(BlueprintPure, Category = "RWTHVRCluster") static EDisplayClusterEyeStereoOffset GetNodeEyeType(); - - // Get Component of Display Cluster by it's name, which is specified in the nDisplay config - UE_DEPRECATED(5.4, "GetClusterComponent has been removed because it is obsolete.") - UFUNCTION(BlueprintPure, BlueprintCallable, Category = "RWTHVRCluster", meta = (DeprecatedFunction)) - static USceneComponent* GetClusterComponent(const FString& Name); - - UE_DEPRECATED(5.4, "GetNamedClusterComponent has been removed because it is obsolete.") - UFUNCTION(BlueprintPure, BlueprintCallable, Category = "RWTHVRCluster", meta = (DeprecatedFunction)) - static USceneComponent* GetNamedClusterComponent(const ENamedClusterComponent& Component); };