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

Fix(Pawn): Fixed config interface casting

parent 58bd34f1
No related branches found
No related tags found
2 merge requests!120UE5.4-2024.1,!115Feature/scaling
Pipeline #569490 failed
......@@ -84,7 +84,6 @@ void ARWTHVRPawn::Tick(float DeltaSeconds)
*/
void ARWTHVRPawn::SetScale(float NewScale)
{
FVector OldScale = GetActorScale();
UniformScale = NewScale;
FVector NewScaleVector = FVector(UniformScale, UniformScale, UniformScale);
GetWorldSettings()->WorldToMeters = InitialWorldToMeters * UniformScale;
......@@ -92,11 +91,24 @@ void ARWTHVRPawn::SetScale(float NewScale)
#if PLATFORM_SUPPORTS_CLUSTER
const ARWTHVRPlayerState* State = GetPlayerState<ARWTHVRPlayerState>();
if (URWTHVRUtilities::IsHeadMountedMode() && State && State->GetCorrespondingClusterActor())
if (URWTHVRUtilities::IsRoomMountedMode() && State && State->GetCorrespondingClusterActor())
{
const auto ClusterRootActor = IDisplayCluster::Get().GetGameMgr()->GetRootActor();
IScalableConfigInterface* ConfigInterface = Cast<IScalableConfigInterface>(ClusterRootActor);
ConfigInterface->OnScaleChanged(NewScale);
if (const auto GameMgr = IDisplayCluster::Get().GetGameMgr())
{
if (const auto ClusterRootActor = GameMgr->GetRootActor())
{
if (ClusterRootActor->Implements<UScalableConfigInterface>())
{
IScalableConfigInterface::Execute_OnScaleChanged(ClusterRootActor, NewScale);
}
else
{
UE_LOGFMT(Toolkit, Warning,
"The ClusterRootActor {0} does not implement the ScalableConfigInterface. Scaling the Pawn on the cluster will lead to unintended behavior.",
ClusterRootActor->GetName());
}
}
}
}
#endif
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment