Skip to content
Snippets Groups Projects
Commit 8dd3010c authored by Kris Tabea Helwig's avatar Kris Tabea Helwig
Browse files

refactor(pawn): changes from a delegate approach to an interface approach

parent 892c6a26
No related branches found
No related tags found
2 merge requests!120Draft: UE5.4-2024.1,!115Feature/scaling
Pipeline #567491 failed
......@@ -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; }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment