Skip to content

Commit a44b940

Browse files
author
Jonathan Ehret
committed
Merge branch 'feature/pawn_cluster_sync' into 'dev/5.3'
add sync component to pawn See merge request vr-vis/VR-Group/unreal-development/plugins/rwth-vr-toolkit!61
2 parents 0917d8d + e31ba9f commit a44b940

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

Source/RWTHVRToolkit/Private/Pawn/RWTHVRPawn.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@ ARWTHVRPawn::ARWTHVRPawn(const FObjectInitializer& ObjectInitializer) : Super(Ob
3535

3636
LeftHand = CreateDefaultSubobject<UReplicatedMotionControllerComponent>(TEXT("Left Hand MCC"));
3737
LeftHand->SetupAttachment(RootComponent);
38+
39+
// Add an nDisplay Parent Sync Component. It syncs the parent's transform from master to clients.
40+
// This is required because for collision based movement, it can happen that the physics engine
41+
// for some reason acts different on the nodes, therefore leading to a potential desync when
42+
// e.g. colliding with an object while moving.
43+
SyncComponent =
44+
CreateDefaultSubobject<UDisplayClusterSceneComponentSyncParent>(TEXT("Parent Display Cluster Sync Component"));
45+
SyncComponent->SetupAttachment(RootComponent);
3846
}
3947

4048
void ARWTHVRPawn::Tick(float DeltaSeconds)

Source/RWTHVRToolkit/Public/Pawn/RWTHVRPawn.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
#include "CoreMinimal.h"
66
#include "LiveLinkRole.h"
77
#include "Pawn/Navigation/CollisionHandlingMovement.h"
8+
9+
#include "Components/DisplayClusterSceneComponentSyncParent.h"
10+
811
#include "RWTHVRPawn.generated.h"
912

1013
class UInputMappingContext;
@@ -48,6 +51,9 @@ class RWTHVRTOOLKIT_API ARWTHVRPawn : public APawn
4851
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Pawn|Camera")
4952
UCameraComponent* HeadCameraComponent;
5053

54+
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Pawn|Camera")
55+
UDisplayClusterSceneComponentSyncParent* SyncComponent;
56+
5157
// LiveLink functionality
5258

5359
/* Set whether nDisplay should disable LiveLink tracking*/

0 commit comments

Comments
 (0)