Skip to content
Snippets Groups Projects
Commit 77a8e0b4 authored by Jonathan Ehret's avatar Jonathan Ehret
Browse files

add convenience functions to get IsMaster

parent 13607574
No related branches found
No related tags found
No related merge requests found
......@@ -20,6 +20,20 @@ bool UVirtualRealityUtilities::IsHeadMountedMode()
return GEngine->XRSystem.IsValid() && GEngine->XRSystem->IsHeadTrackingAllowed();
}
UFUNCTION(BlueprintPure, Category = "DisplayCluster") bool UVirtualRealityUtilities::IsMaster()
{
IDisplayClusterClusterManager* manager = IDisplayCluster::Get().GetClusterMgr();
if (manager == nullptr) // no manager means we are not in clustermode and therefore master
return true;
return manager->IsMaster();
}
UFUNCTION(BlueprintPure, Category = "DisplayCluster") bool UVirtualRealityUtilities::IsSlave()
{
return !IsMaster();
}
FString UVirtualRealityUtilities::GetNodeName()
{
return IsRoomMountedMode() ? IDisplayCluster::Get().GetClusterMgr()->GetNodeId() : FString(TEXT("Localhost"));
......
......@@ -23,6 +23,9 @@ public:
UFUNCTION(BlueprintPure, Category = "DisplayCluster") static bool IsRoomMountedMode();
UFUNCTION(BlueprintPure, Category = "DisplayCluster") static bool IsHeadMountedMode();
UFUNCTION(BlueprintPure, Category = "DisplayCluster") static bool IsMaster();
UFUNCTION(BlueprintPure, Category = "DisplayCluster") static bool IsSlave();
UFUNCTION(BlueprintPure, Category = "DisplayCluster") static FString GetNodeName();
UFUNCTION(BlueprintPure, Category = "DisplayCluster") static float GetEyeDistance();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment