30 XrInstance XRInstance = pOpenXRHMD->GetInstance();
31 XrSystemId XRSysID = pOpenXRHMD->GetSystem();
33 if (XRSysID && XRInstance)
35 XrSystemProperties systemProperties{ XR_TYPE_SYSTEM_PROPERTIES };
36 systemProperties.next =
nullptr;
38 if (xrGetSystemProperties(XRInstance, XRSysID, &systemProperties) == XR_SUCCESS)
40 XrSession XRSesh = pOpenXRHMD->GetSession();
45 XrResult PathResult = xrStringToPath(XRInstance,
"/user/hand/left", &myPath);
46 XrInteractionProfileState interactionProfile{ XR_TYPE_INTERACTION_PROFILE_STATE };
47 interactionProfile.next =
nullptr;
49 XrResult QueryResult = xrGetCurrentInteractionProfile(XRSesh, myPath, &interactionProfile);
50 if (QueryResult == XR_SUCCESS)
52 char myPathy[XR_MAX_SYSTEM_NAME_SIZE];
54 xrPathToString(XRInstance, interactionProfile.interactionProfile, XR_MAX_SYSTEM_NAME_SIZE, &outputsize, myPathy);
59 FString InteractionName(ANSI_TO_TCHAR(myPathy));
60 if (InteractionName.Len() < 1)
95 if (InteractionName.Find(
"touch_controller", ESearchCase::IgnoreCase) != INDEX_NONE)
99 else if (InteractionName.Contains(
"index_controller", ESearchCase::IgnoreCase))
103 else if (InteractionName.Find(
"vive_controller", ESearchCase::IgnoreCase) != INDEX_NONE)
107 else if (InteractionName.Find(
"vive_pro", ESearchCase::IgnoreCase) != INDEX_NONE)
111 else if (InteractionName.Find(
"simple_controller", ESearchCase::IgnoreCase) != INDEX_NONE)
115 else if (InteractionName.Find(
"daydream_controller", ESearchCase::IgnoreCase) != INDEX_NONE)
119 else if (InteractionName.Find(
"motion_controller", ESearchCase::IgnoreCase) != INDEX_NONE)
123 else if (InteractionName.Find(
"xbox_controller", ESearchCase::IgnoreCase) != INDEX_NONE)
127 else if (InteractionName.Find(
"go_controller", ESearchCase::IgnoreCase) != INDEX_NONE)
133 UE_LOG(OpenXRExpansionFunctionLibraryLog,
Warning, TEXT(
"UNKNOWN OpenXR Interaction profile detected!!!: %s"), *InteractionName);
140 TrackingSystemName = FString(ANSI_TO_TCHAR(systemProperties.systemName));
148 TrackingSystemName.Empty();
static void GetXRMotionControllerType(FString &TrackingSystemName, EBPOpenXRControllerDeviceType &DeviceType, EBPXRResultSwitch &Result)
UFUNCTION(BlueprintCallable, Category = "VRExpansionFunctions|OpenXR", meta = (bIgnoreSelf = "true",...