From 609a157a6d97265a359fa83be3b1b49b86c321c7 Mon Sep 17 00:00:00 2001
From: jehret <ehret@vr.rwth-aachen.de>
Date: Wed, 29 Nov 2023 16:41:54 +0100
Subject: [PATCH] fix(pawn): add sync component to pawn

---
 Source/RWTHVRToolkit/Private/Pawn/RWTHVRPawn.cpp | 6 ++++++
 Source/RWTHVRToolkit/Public/Pawn/RWTHVRPawn.h    | 6 ++++++
 2 files changed, 12 insertions(+)

diff --git a/Source/RWTHVRToolkit/Private/Pawn/RWTHVRPawn.cpp b/Source/RWTHVRToolkit/Private/Pawn/RWTHVRPawn.cpp
index ee080a87..3af65be4 100644
--- a/Source/RWTHVRToolkit/Private/Pawn/RWTHVRPawn.cpp
+++ b/Source/RWTHVRToolkit/Private/Pawn/RWTHVRPawn.cpp
@@ -35,6 +35,12 @@ ARWTHVRPawn::ARWTHVRPawn(const FObjectInitializer& ObjectInitializer) : Super(Ob
 
 	LeftHand = CreateDefaultSubobject<UReplicatedMotionControllerComponent>(TEXT("Left Hand MCC"));
 	LeftHand->SetupAttachment(RootComponent);
+
+	// add a nDisplay
+	SyncComponent =
+		CreateDefaultSubobject<UDisplayClusterSceneComponentSyncParent>(TEXT("Parent Display Cluster Sync Component"));
+	SyncComponent->SetupAttachment(RootComponent);
+
 }
 
 void ARWTHVRPawn::Tick(float DeltaSeconds)
diff --git a/Source/RWTHVRToolkit/Public/Pawn/RWTHVRPawn.h b/Source/RWTHVRToolkit/Public/Pawn/RWTHVRPawn.h
index 20011926..9cf9340a 100644
--- a/Source/RWTHVRToolkit/Public/Pawn/RWTHVRPawn.h
+++ b/Source/RWTHVRToolkit/Public/Pawn/RWTHVRPawn.h
@@ -5,6 +5,9 @@
 #include "CoreMinimal.h"
 #include "LiveLinkRole.h"
 #include "Pawn/Navigation/CollisionHandlingMovement.h"
+
+#include "Components/DisplayClusterSceneComponentSyncParent.h"
+
 #include "RWTHVRPawn.generated.h"
 
 class UInputMappingContext;
@@ -48,6 +51,9 @@ public:
 	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Pawn|Camera")
 	UCameraComponent* HeadCameraComponent;
 
+	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Pawn|Camera")
+	UDisplayClusterSceneComponentSyncParent* SyncComponent;
+
 	// LiveLink functionality
 
 	/* Set whether nDisplay should disable LiveLink tracking*/
-- 
GitLab