Skip to content
Snippets Groups Projects
Commit 4799a526 authored by David Gilbert's avatar David Gilbert :bug:
Browse files

Merge branch 'dev/5.4' into '5.4'

New attachment process and multiple clusters

See merge request !4
parents c4155879 5c91c1b4
No related branches found
No related tags found
1 merge request!4New attachment process and multiple clusters
Pipeline #492048 passed
File deleted
{
"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
File added
...@@ -8,7 +8,8 @@ ...@@ -8,7 +8,8 @@
{ {
"bFollowLocalPlayerCamera": false, "bFollowLocalPlayerCamera": false,
"bExitOnEsc": true, "bExitOnEsc": true,
"bOverrideViewportsFromExternalConfig": true "bOverrideViewportsFromExternalConfig": true,
"bOverrideTransformsFromExternalConfig": false
}, },
"scene": "scene":
{ {
......
No preview for this file type
// Fill out your copyright notice in the Description page of Project Settings. // 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 "Logging/StructuredLog.h"
#include "Utility/RWTHVRClusterUtilities.h" #include "Utility/RWTHVRClusterUtilities.h"
// Sets default values UCaveSetupComponent::UCaveSetupComponent()
ACaveSetup::ACaveSetup()
{ {
PrimaryActorTick.bCanEverTick = false; PrimaryComponentTick.bCanEverTick = false;
SetActorEnableCollision(false); SetIsReplicatedByDefault(false);
// Actor needs to replicate, as it is attached to the pawn on the server.
bReplicates = true;
} }
// Called when the game starts or when spawned void UCaveSetupComponent::BeginPlay()
void ACaveSetup::BeginPlay()
{ {
Super::BeginPlay(); Super::BeginPlay();
if (!URWTHVRClusterUtilities::IsRoomMountedMode()) if (!URWTHVRClusterUtilities::IsRoomMountedMode())
{ {
UE_LOGFMT(RWTHVRCluster, Display, "CaveSetup: Not in RoomMountedMode, doing nothing."); UE_LOGFMT(RWTHVRCluster, Display, "CaveSetup: Not in RoomMountedMode, doing nothing.");
...@@ -33,7 +29,7 @@ void ACaveSetup::BeginPlay() ...@@ -33,7 +29,7 @@ void ACaveSetup::BeginPlay()
if (const auto World = GetWorld()) if (const auto World = GetWorld())
{ {
const auto Actor = World->SpawnActor(ActorClass); 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.", UE_LOGFMT(RWTHVRCluster, Display, "CaveSetup: Spawned Actor {Actor} on the Cave and attached it.",
Actor->GetName()); Actor->GetName());
} }
......
...@@ -70,43 +70,3 @@ EDisplayClusterEyeStereoOffset URWTHVRClusterUtilities::GetNodeEyeType() ...@@ -70,43 +70,3 @@ EDisplayClusterEyeStereoOffset URWTHVRClusterUtilities::GetNodeEyeType()
const ADisplayClusterRootActor* RootActor = IDisplayCluster::Get().GetGameMgr()->GetRootActor(); const ADisplayClusterRootActor* RootActor = IDisplayCluster::Get().GetGameMgr()->GetRootActor();
return (RootActor) ? RootActor->GetDefaultCamera()->GetStereoOffset() : EDisplayClusterEyeStereoOffset::None; 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;
}
}
...@@ -3,23 +3,20 @@ ...@@ -3,23 +3,20 @@
#pragma once #pragma once
#include "CoreMinimal.h" #include "CoreMinimal.h"
#include "LiveLinkPreset.h"
#include "GameFramework/Actor.h" #include "CaveSetupComponent.generated.h"
#include "CaveSetup.generated.h"
class ULiveLinkPreset;
/**
* Simple Actor that needs to be added to the level which spawns Cave-related actors UCLASS(ClassGroup = (Custom), meta = (BlueprintSpawnableComponent),
* such as the CaveOverlay. hideCategories = (Rendering, Input, Actor, Base, Collision, Shape, Physics, HLOD))
* It attaches itself to the Primary Node's Pawn and then replicates on the server. class RWTHVRCLUSTER_API UCaveSetupComponent : public UActorComponent
*/
UCLASS(hideCategories = (Rendering, Input, Actor, Base, Collision, Shape, Physics, HLOD))
class RWTHVRCLUSTER_API ACaveSetup : public AActor
{ {
GENERATED_BODY() GENERATED_BODY()
public: public:
ACaveSetup(); // Sets default values for this component's properties
UCaveSetupComponent();
UPROPERTY(EditAnywhere) UPROPERTY(EditAnywhere)
TArray<UClass*> ActorsToSpawnOnCave; TArray<UClass*> ActorsToSpawnOnCave;
...@@ -28,6 +25,6 @@ public: ...@@ -28,6 +25,6 @@ public:
ULiveLinkPreset* LiveLinkPresetToApplyOnCave; ULiveLinkPreset* LiveLinkPresetToApplyOnCave;
protected: protected:
// Called when the game starts or when spawned // Called when the game starts
virtual void BeginPlay() override; virtual void BeginPlay() override;
}; };
...@@ -58,13 +58,4 @@ public: ...@@ -58,13 +58,4 @@ public:
UFUNCTION(BlueprintPure, Category = "RWTHVRCluster") UFUNCTION(BlueprintPure, Category = "RWTHVRCluster")
static EDisplayClusterEyeStereoOffset GetNodeEyeType(); 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);
}; };
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment