Skip to content
Snippets Groups Projects
Commit 0f95bcd7 authored by David Gilbert's avatar David Gilbert :bug:
Browse files

fix(utilities): Fixes problem with check for HMD, now using new Unreal internal function.

parent 83371cec
No related branches found
No related tags found
2 merge requests!120Draft: UE5.4-2024.1,!113Pull dev/5.4 changes into dev/5.5
Pipeline #525667 failed
#include "Utility/RWTHVRUtilities.h" #include "Utility/RWTHVRUtilities.h"
#include "AudioDevice.h" #include "AudioDevice.h"
#include "HeadMountedDisplayFunctionLibrary.h"
#include "IHeadMountedDisplay.h" #include "IHeadMountedDisplay.h"
#include "IXRTrackingSystem.h" #include "IXRTrackingSystem.h"
#include "Engine/Engine.h" #include "Engine/Engine.h"
...@@ -18,9 +19,7 @@ bool URWTHVRUtilities::IsDesktopMode() { return !IsRoomMountedMode() && !IsHeadM ...@@ -18,9 +19,7 @@ bool URWTHVRUtilities::IsDesktopMode() { return !IsRoomMountedMode() && !IsHeadM
bool URWTHVRUtilities::IsHeadMountedMode() bool URWTHVRUtilities::IsHeadMountedMode()
{ {
// In editor builds: checks for EdEngine->IsVRPreviewActive() return UHeadMountedDisplayFunctionLibrary::IsHeadMountedDisplayEnabled();
// In packaged builds: checks for `-vr` in commandline or bStartInVR in UGeneralProjectSettings
return FAudioDevice::CanUseVRAudioDevice();
} }
bool URWTHVRUtilities::IsRoomMountedMode() bool URWTHVRUtilities::IsRoomMountedMode()
......
...@@ -38,7 +38,7 @@ public class RWTHVRToolkit : ModuleRules ...@@ -38,7 +38,7 @@ public class RWTHVRToolkit : ModuleRules
PrivateDependencyModuleNames.AddRange( PrivateDependencyModuleNames.AddRange(
new string[] new string[]
{ {
"NetCore" "NetCore", "XRBase"
} }
); );
if (Target.bBuildEditor == true) if (Target.bBuildEditor == true)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment