Skip to content
Snippets Groups Projects

Improved join/attachment logic for clusters to support multi-cluster connections at some point

Merged David Gilbert requested to merge feature/multiple_clusters into dev/5.4
2 files
+ 19
14
Compare changes
  • Side-by-side
  • Inline

Files

@@ -2,15 +2,17 @@
@@ -2,15 +2,17 @@
#include "Pawn/ClusterRepresentationActor.h"
#include "Pawn/ClusterRepresentationActor.h"
 
#include "Core/RWTHVRPlayerState.h"
 
#include "Kismet/GameplayStatics.h"
 
#include "Logging/StructuredLog.h"
 
#include "Utility/RWTHVRUtilities.h"
 
#if PLATFORM_SUPPORTS_CLUSTER
#include "DisplayClusterRootActor.h"
#include "DisplayClusterRootActor.h"
#include "IDisplayCluster.h"
#include "IDisplayCluster.h"
#include "Config/IDisplayClusterConfigManager.h"
#include "Config/IDisplayClusterConfigManager.h"
#include "Core/RWTHVRPlayerState.h"
#include "Game/IDisplayClusterGameManager.h"
#include "Game/IDisplayClusterGameManager.h"
#include "Kismet/GameplayStatics.h"
#endif
#include "Logging/StructuredLog.h"
#include "Utility/RWTHVRUtilities.h"
// Sets default values
// Sets default values
AClusterRepresentationActor::AClusterRepresentationActor()
AClusterRepresentationActor::AClusterRepresentationActor()
@@ -41,6 +43,8 @@ void AClusterRepresentationActor::AttachDCRAIfRequired(const ARWTHVRPlayerState*
@@ -41,6 +43,8 @@ void AClusterRepresentationActor::AttachDCRAIfRequired(const ARWTHVRPlayerState*
// - If we are a client, this actor has been spawned on the server only. Therefore I assume that if we
// - If we are a client, this actor has been spawned on the server only. Therefore I assume that if we
// have replicated this actor to our client, we're good to go.
// have replicated this actor to our client, we're good to go.
 
#if PLATFORM_SUPPORTS_CLUSTER
 
if (!URWTHVRUtilities::IsRoomMountedMode())
if (!URWTHVRUtilities::IsRoomMountedMode())
return;
return;
@@ -82,17 +86,12 @@ void AClusterRepresentationActor::AttachDCRAIfRequired(const ARWTHVRPlayerState*
@@ -82,17 +86,12 @@ void AClusterRepresentationActor::AttachDCRAIfRequired(const ARWTHVRPlayerState*
bIsAttached = AttachDCRA();
bIsAttached = AttachDCRA();
}
}
 
#endif
}
}
 
#if PLATFORM_SUPPORTS_CLUSTER
bool AClusterRepresentationActor::AttachDCRA()
bool AClusterRepresentationActor::AttachDCRA()
{
{
#if PLATFORM_SUPPORTS_CLUSTER
// 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.
if (URWTHVRUtilities::IsRoomMountedMode())
if (URWTHVRUtilities::IsRoomMountedMode())
{
{
UE_LOGFMT(Toolkit, Display, "{Name}: Trying to attach DCRA", GetName());
UE_LOGFMT(Toolkit, Display, "{Name}: Trying to attach DCRA", GetName());
@@ -125,7 +124,6 @@ bool AClusterRepresentationActor::AttachDCRA()
@@ -125,7 +124,6 @@ bool AClusterRepresentationActor::AttachDCRA()
DCRA->SetActorEnableCollision(false);
DCRA->SetActorEnableCollision(false);
}
}
#endif
return true;
return true;
}
}
@@ -158,4 +156,6 @@ ADisplayClusterRootActor* AClusterRepresentationActor::SpawnDCRA()
@@ -158,4 +156,6 @@ ADisplayClusterRootActor* AClusterRepresentationActor::SpawnDCRA()
}
}
}
}
return RootActor;
return RootActor;
}
}
\ No newline at end of file
 
#endif
Loading