Skip to content

Commit

Permalink
Merge branch 'feature/pawn_cluster_sync' into 'dev/5.3'
Browse files Browse the repository at this point in the history
add sync component to pawn

See merge request vr-vis/VR-Group/unreal-development/plugins/rwth-vr-toolkit!61
  • Loading branch information
Jonathan Ehret committed Nov 30, 2023
2 parents 0917d8d + e31ba9f commit a44b940
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Source/RWTHVRToolkit/Private/Pawn/RWTHVRPawn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ ARWTHVRPawn::ARWTHVRPawn(const FObjectInitializer& ObjectInitializer) : Super(Ob

LeftHand = CreateDefaultSubobject<UReplicatedMotionControllerComponent>(TEXT("Left Hand MCC"));
LeftHand->SetupAttachment(RootComponent);

// Add an nDisplay Parent Sync Component. It syncs the parent's transform from master to clients.
// This is required because for collision based movement, it can happen that the physics engine
// for some reason acts different on the nodes, therefore leading to a potential desync when
// e.g. colliding with an object while moving.
SyncComponent =
CreateDefaultSubobject<UDisplayClusterSceneComponentSyncParent>(TEXT("Parent Display Cluster Sync Component"));
SyncComponent->SetupAttachment(RootComponent);
}

void ARWTHVRPawn::Tick(float DeltaSeconds)
Expand Down
6 changes: 6 additions & 0 deletions Source/RWTHVRToolkit/Public/Pawn/RWTHVRPawn.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -48,6 +51,9 @@ class RWTHVRTOOLKIT_API ARWTHVRPawn : public APawn
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*/
Expand Down

0 comments on commit a44b940

Please sign in to comment.