diff --git a/Source/RWTHVRToolkit/Private/Pawn/RWTHVRPawn.cpp b/Source/RWTHVRToolkit/Private/Pawn/RWTHVRPawn.cpp index dc9c9022a86fc6e57b1dd6e19927519bca283161..31874d9f9a2892ff586b3983858798fdb484d085 100644 --- a/Source/RWTHVRToolkit/Private/Pawn/RWTHVRPawn.cpp +++ b/Source/RWTHVRToolkit/Private/Pawn/RWTHVRPawn.cpp @@ -18,6 +18,10 @@ #include "Utility/RWTHVRUtilities.h" #if PLATFORM_SUPPORTS_CLUSTER +#include "DisplayClusterRootActor.h" +#include "ScalableConfigInterface.h" +#include "IDisplayCluster.h" +#include "Game/IDisplayClusterGameManager.h" #include "Components/DisplayClusterSceneComponentSyncParent.h" #endif @@ -85,7 +89,16 @@ void ARWTHVRPawn::SetScale(float NewScale) FVector NewScaleVector = FVector(UniformScale, UniformScale, UniformScale); GetWorldSettings()->WorldToMeters = InitialWorldToMeters * UniformScale; SetActorRelativeScale3D(NewScaleVector); - OnScaleChanged.Broadcast(OldScale, NewScale); + +#if PLATFORM_SUPPORTS_CLUSTER + const ARWTHVRPlayerState* State = GetPlayerState<ARWTHVRPlayerState>(); + if (URWTHVRUtilities::IsHeadMountedMode() && State && State->GetCorrespondingClusterActor()) + { + const auto ClusterRootActor = IDisplayCluster::Get().GetGameMgr()->GetRootActor(); + IScalableConfigInterface* ConfigInterface = Cast<IScalableConfigInterface>(ClusterRootActor); + ConfigInterface->OnScaleChanged(NewScale); + } +#endif } float ARWTHVRPawn::GetScale() { return UniformScale; }