Files
UnrealEngineUWP/Engine/Plugins/Runtime/WindowsMixedReality/Source/WindowsMixedRealityHMD/Private/WindowsMixedRealityFunctionLibrary.cpp

238 lines
7.0 KiB
C++
Raw Normal View History

Copying //UE4/Dev-VR to //UE4/Dev-Main (Source: //UE4/Dev-VR @ 4296730) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3775128 by Nick.Atamas Merging //UE4/Partner-Google-VR @ CL 3770408 to Dev-VR (//UE4/Dev-VR) Change 4166311 by Jason.Bestimt #DEV-VR - Merge from //UE4/Dev-MagicLeap/... @ CL 4136411 Change 4185551 by Joe.Graf Added support to query and specify the desired video format for an AR session Change 4269190 by Ethan.Geller [Dev-VR] #jira UE-62644 Deescalate resampling logs to display, and make sure that Lumin does not get Resampling settings from Android runtime settings. Change 4269386 by Ryan.Vance #jira UE-62274 We need to recompute the view frustum and related distances if the projection matrix is changed. Change 4269401 by Ryan.Vance #jira UE-62155 Debug canvas layer fixes Change 4270710 by Chance.Ivey Merging //UE4/Dev-Partner-MagicLeap-4.20 to Dev-VR (//UE4/Dev-VR) - 4262963 - 4261100 - 4261103 - 4265565 Change 4270822 by Ryan.Vance #jira UE-61462 Work around for csm shadow culling bug on Lumiun Change 4271396 by Jason.Bestimt #DEV-VR - Saving off original MLSDK variable for future editor "restarts" within the same process #JIRA: UE-58634 Change 4271402 by Jason.Bestimt #DEV-VR - Making bUseMobileRendering non-editable for binary builds #JIRA: UE-60956 Change 4271454 by Jason.Bestimt #DEV-VR - Integrating CL 4239939, 4236178 and 4269702 from Partners-Google-VR Change 4272387 by Ryan.Vance #jira UEVR-1281 Oculus 1.28 Plugin changes Change 4273410 by Jason.Bestimt #DEV-VR - Fixing MagicLeapSDK Settings to be globaluserconfig (by removing the defaultconfig). #JIRA: UE-62092 Change 4273929 by Ryan.Vance #jira UE-62744 Fixing missing includes.. Change 4274147 by Kyle.Fung Round-robin occlusion queries for stereoscopic rendering With the vr.RoundRobinOcclusion flag turned on, each frame will only render occlusion queries for one eye with an alternating scheme (ie odd frames only left eye, even frames only right eye). Additionally, the interface for class FPrimitiveOcclusionHistory has been changed along with a slight modification in its implementation. With round-robin occlusion, when extracing history entries we perform a search through the entire history to look for the oldest entry in a primitive's occlusion history. #jira UEVR-1289 Change 4274206 by Kyle.Fung Fixed some compiler warnings #jira UEVR-1289 Change 4275212 by Jason.Bestimt #DEV-VR - Fixing CIS error (forcing value to bool) Change 4275973 by Jason.Bestimt #DEV-VR - Merging CL 4275879 from Partner-Google-VR GoogleVR 1.170 Release Update. - Removed reference to GetHMDDeviceType. - Updated to final version of SDK libraries. Change 4276154 by Jason.Bestimt #DEV-VR - fix for CIS warning about PngPtr being used before it is checked Change 4277171 by Jeff.Fisher UE-62399 Graphical corruption when opening the debug console -Switched from the fast hardware clear to the slower shader clear because the slower one works. Perhaps a better fix exists that would make the faster clear work? Costs 60us when debug ui is up, but only when rendering debug to a stereo layer (vr/ar). #jira UE-62399 #review-4277026 Change 4277633 by Joe.Conley #jira UE-54565 - "Packaged game/Editor with Stereo Layers crashes when exiting game through steam VR overlay" Don't call GetStereoLayers if stereo is not enabled. Change 4277723 by Ryan.Vance #jira UE-62776 Cleaning up questionable partner code found by SA. I'm pretty confident the SA warning is a false positive, but there was a lot to fix here regardless. Change 4280289 by Joe.Graf Added some "Ignored by ARCore" comments Google requested Change 4280479 by Joe.Graf Fixed a member copy step in AppleARKitFrame::operator= that Wanghao reported Change 4280824 by Jason.Bestimt #DEV-VR - removing stale comment about ML SDK Settings using defaultengine.ini Change 4281117 by Jason.Bestimt #DEV-VR - Removing warnings on LUMIN from trying to load missing modules #JIRA: UE-62748 Change 4281514 by Jason.Bestimt #DEV-VR - Moving FunctionalTesting dependency under bCompileAgainstEngine Change 4281847 by Joe.Graf Added a UPL file to AppleARKit that modifies the plist to include the requirement of ARKit and request for camera access #jira: UE-60050, UE-62837 Change 4281945 by Joe.Graf Removed the ensures from the ARBlueprintLibrary code since the code handles the failure cases properly #jira: UE-61845, UE-61846 Change 4282098 by Ethan.Geller #jira UE-62863 fix audio on lumin #rb none Change 4283974 by Joe.Graf Deprecated bIsTracked on tracked images and face geo per Google API reunification feedback Change 4284118 by Jason.Bestimt #DEV-VR - Moving FunctionalTest dependency to be both non-shipping and CompileAgainstEngine. Allowing FunctionalTesting to be compiled in binary build Change 4285339 by Ethan.Geller #jira UE-62087 Whitelist AudioCapture module for mac while not whitelisting the AudioCaptureEditor module, which should only work on Windows. Change 4286024 by Ryan.Vance Copying //UE4/Partner-Microsoft-XR to Dev-VR (//UE4/Dev-VR) Windows mixed reality integration. Disabled by default Change 4289812 by Jason.Bestimt #DEV-VR - Fix for non-unity build issue with windows header Change 4296399 by Jason.Bestimt RSync fixes for xml files #JIRA: UE-62994 Change 4296679 by Jason.Bestimt #DEV-VR - Fixing remote iOS compile issue with BP projects that require plugins #JIRA: UE-62967 [CL 4299100 by Jason Bestimt in Main branch]
2018-08-17 19:56:07 -04:00
// Copyright (c) Microsoft Corporation. All rights reserved.
#include "WindowsMixedRealityFunctionLibrary.h"
#include "EngineGlobals.h"
#include "Engine/Engine.h"
#include "WindowsMixedRealityHMD.h"
#if WITH_WINDOWS_MIXED_REALITY
#include "MixedRealityInterop.h"
#include "WindowsMixedRealityInteropUtility.h"
#endif
#include <functional>
UDEPRECATED_WindowsMixedRealityFunctionLibrary::UDEPRECATED_WindowsMixedRealityFunctionLibrary(const FObjectInitializer& ObjectInitializer)
Copying //UE4/Dev-VR to //UE4/Dev-Main (Source: //UE4/Dev-VR @ 4296730) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3775128 by Nick.Atamas Merging //UE4/Partner-Google-VR @ CL 3770408 to Dev-VR (//UE4/Dev-VR) Change 4166311 by Jason.Bestimt #DEV-VR - Merge from //UE4/Dev-MagicLeap/... @ CL 4136411 Change 4185551 by Joe.Graf Added support to query and specify the desired video format for an AR session Change 4269190 by Ethan.Geller [Dev-VR] #jira UE-62644 Deescalate resampling logs to display, and make sure that Lumin does not get Resampling settings from Android runtime settings. Change 4269386 by Ryan.Vance #jira UE-62274 We need to recompute the view frustum and related distances if the projection matrix is changed. Change 4269401 by Ryan.Vance #jira UE-62155 Debug canvas layer fixes Change 4270710 by Chance.Ivey Merging //UE4/Dev-Partner-MagicLeap-4.20 to Dev-VR (//UE4/Dev-VR) - 4262963 - 4261100 - 4261103 - 4265565 Change 4270822 by Ryan.Vance #jira UE-61462 Work around for csm shadow culling bug on Lumiun Change 4271396 by Jason.Bestimt #DEV-VR - Saving off original MLSDK variable for future editor "restarts" within the same process #JIRA: UE-58634 Change 4271402 by Jason.Bestimt #DEV-VR - Making bUseMobileRendering non-editable for binary builds #JIRA: UE-60956 Change 4271454 by Jason.Bestimt #DEV-VR - Integrating CL 4239939, 4236178 and 4269702 from Partners-Google-VR Change 4272387 by Ryan.Vance #jira UEVR-1281 Oculus 1.28 Plugin changes Change 4273410 by Jason.Bestimt #DEV-VR - Fixing MagicLeapSDK Settings to be globaluserconfig (by removing the defaultconfig). #JIRA: UE-62092 Change 4273929 by Ryan.Vance #jira UE-62744 Fixing missing includes.. Change 4274147 by Kyle.Fung Round-robin occlusion queries for stereoscopic rendering With the vr.RoundRobinOcclusion flag turned on, each frame will only render occlusion queries for one eye with an alternating scheme (ie odd frames only left eye, even frames only right eye). Additionally, the interface for class FPrimitiveOcclusionHistory has been changed along with a slight modification in its implementation. With round-robin occlusion, when extracing history entries we perform a search through the entire history to look for the oldest entry in a primitive's occlusion history. #jira UEVR-1289 Change 4274206 by Kyle.Fung Fixed some compiler warnings #jira UEVR-1289 Change 4275212 by Jason.Bestimt #DEV-VR - Fixing CIS error (forcing value to bool) Change 4275973 by Jason.Bestimt #DEV-VR - Merging CL 4275879 from Partner-Google-VR GoogleVR 1.170 Release Update. - Removed reference to GetHMDDeviceType. - Updated to final version of SDK libraries. Change 4276154 by Jason.Bestimt #DEV-VR - fix for CIS warning about PngPtr being used before it is checked Change 4277171 by Jeff.Fisher UE-62399 Graphical corruption when opening the debug console -Switched from the fast hardware clear to the slower shader clear because the slower one works. Perhaps a better fix exists that would make the faster clear work? Costs 60us when debug ui is up, but only when rendering debug to a stereo layer (vr/ar). #jira UE-62399 #review-4277026 Change 4277633 by Joe.Conley #jira UE-54565 - "Packaged game/Editor with Stereo Layers crashes when exiting game through steam VR overlay" Don't call GetStereoLayers if stereo is not enabled. Change 4277723 by Ryan.Vance #jira UE-62776 Cleaning up questionable partner code found by SA. I'm pretty confident the SA warning is a false positive, but there was a lot to fix here regardless. Change 4280289 by Joe.Graf Added some "Ignored by ARCore" comments Google requested Change 4280479 by Joe.Graf Fixed a member copy step in AppleARKitFrame::operator= that Wanghao reported Change 4280824 by Jason.Bestimt #DEV-VR - removing stale comment about ML SDK Settings using defaultengine.ini Change 4281117 by Jason.Bestimt #DEV-VR - Removing warnings on LUMIN from trying to load missing modules #JIRA: UE-62748 Change 4281514 by Jason.Bestimt #DEV-VR - Moving FunctionalTesting dependency under bCompileAgainstEngine Change 4281847 by Joe.Graf Added a UPL file to AppleARKit that modifies the plist to include the requirement of ARKit and request for camera access #jira: UE-60050, UE-62837 Change 4281945 by Joe.Graf Removed the ensures from the ARBlueprintLibrary code since the code handles the failure cases properly #jira: UE-61845, UE-61846 Change 4282098 by Ethan.Geller #jira UE-62863 fix audio on lumin #rb none Change 4283974 by Joe.Graf Deprecated bIsTracked on tracked images and face geo per Google API reunification feedback Change 4284118 by Jason.Bestimt #DEV-VR - Moving FunctionalTest dependency to be both non-shipping and CompileAgainstEngine. Allowing FunctionalTesting to be compiled in binary build Change 4285339 by Ethan.Geller #jira UE-62087 Whitelist AudioCapture module for mac while not whitelisting the AudioCaptureEditor module, which should only work on Windows. Change 4286024 by Ryan.Vance Copying //UE4/Partner-Microsoft-XR to Dev-VR (//UE4/Dev-VR) Windows mixed reality integration. Disabled by default Change 4289812 by Jason.Bestimt #DEV-VR - Fix for non-unity build issue with windows header Change 4296399 by Jason.Bestimt RSync fixes for xml files #JIRA: UE-62994 Change 4296679 by Jason.Bestimt #DEV-VR - Fixing remote iOS compile issue with BP projects that require plugins #JIRA: UE-62967 [CL 4299100 by Jason Bestimt in Main branch]
2018-08-17 19:56:07 -04:00
: Super(ObjectInitializer)
{
}
WindowsMixedReality::FWindowsMixedRealityHMD* GetWindowsMixedRealityHMD() noexcept
{
if (GEngine->XRSystem.IsValid() && (GEngine->XRSystem->GetSystemName() == FName("WindowsMixedRealityHMD")))
{
return static_cast<WindowsMixedReality::FWindowsMixedRealityHMD*>(GEngine->XRSystem.Get());
}
return nullptr;
}
FString UDEPRECATED_WindowsMixedRealityFunctionLibrary::GetVersionString()
Copying //UE4/Dev-VR to //UE4/Dev-Main (Source: //UE4/Dev-VR @ 4296730) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3775128 by Nick.Atamas Merging //UE4/Partner-Google-VR @ CL 3770408 to Dev-VR (//UE4/Dev-VR) Change 4166311 by Jason.Bestimt #DEV-VR - Merge from //UE4/Dev-MagicLeap/... @ CL 4136411 Change 4185551 by Joe.Graf Added support to query and specify the desired video format for an AR session Change 4269190 by Ethan.Geller [Dev-VR] #jira UE-62644 Deescalate resampling logs to display, and make sure that Lumin does not get Resampling settings from Android runtime settings. Change 4269386 by Ryan.Vance #jira UE-62274 We need to recompute the view frustum and related distances if the projection matrix is changed. Change 4269401 by Ryan.Vance #jira UE-62155 Debug canvas layer fixes Change 4270710 by Chance.Ivey Merging //UE4/Dev-Partner-MagicLeap-4.20 to Dev-VR (//UE4/Dev-VR) - 4262963 - 4261100 - 4261103 - 4265565 Change 4270822 by Ryan.Vance #jira UE-61462 Work around for csm shadow culling bug on Lumiun Change 4271396 by Jason.Bestimt #DEV-VR - Saving off original MLSDK variable for future editor "restarts" within the same process #JIRA: UE-58634 Change 4271402 by Jason.Bestimt #DEV-VR - Making bUseMobileRendering non-editable for binary builds #JIRA: UE-60956 Change 4271454 by Jason.Bestimt #DEV-VR - Integrating CL 4239939, 4236178 and 4269702 from Partners-Google-VR Change 4272387 by Ryan.Vance #jira UEVR-1281 Oculus 1.28 Plugin changes Change 4273410 by Jason.Bestimt #DEV-VR - Fixing MagicLeapSDK Settings to be globaluserconfig (by removing the defaultconfig). #JIRA: UE-62092 Change 4273929 by Ryan.Vance #jira UE-62744 Fixing missing includes.. Change 4274147 by Kyle.Fung Round-robin occlusion queries for stereoscopic rendering With the vr.RoundRobinOcclusion flag turned on, each frame will only render occlusion queries for one eye with an alternating scheme (ie odd frames only left eye, even frames only right eye). Additionally, the interface for class FPrimitiveOcclusionHistory has been changed along with a slight modification in its implementation. With round-robin occlusion, when extracing history entries we perform a search through the entire history to look for the oldest entry in a primitive's occlusion history. #jira UEVR-1289 Change 4274206 by Kyle.Fung Fixed some compiler warnings #jira UEVR-1289 Change 4275212 by Jason.Bestimt #DEV-VR - Fixing CIS error (forcing value to bool) Change 4275973 by Jason.Bestimt #DEV-VR - Merging CL 4275879 from Partner-Google-VR GoogleVR 1.170 Release Update. - Removed reference to GetHMDDeviceType. - Updated to final version of SDK libraries. Change 4276154 by Jason.Bestimt #DEV-VR - fix for CIS warning about PngPtr being used before it is checked Change 4277171 by Jeff.Fisher UE-62399 Graphical corruption when opening the debug console -Switched from the fast hardware clear to the slower shader clear because the slower one works. Perhaps a better fix exists that would make the faster clear work? Costs 60us when debug ui is up, but only when rendering debug to a stereo layer (vr/ar). #jira UE-62399 #review-4277026 Change 4277633 by Joe.Conley #jira UE-54565 - "Packaged game/Editor with Stereo Layers crashes when exiting game through steam VR overlay" Don't call GetStereoLayers if stereo is not enabled. Change 4277723 by Ryan.Vance #jira UE-62776 Cleaning up questionable partner code found by SA. I'm pretty confident the SA warning is a false positive, but there was a lot to fix here regardless. Change 4280289 by Joe.Graf Added some "Ignored by ARCore" comments Google requested Change 4280479 by Joe.Graf Fixed a member copy step in AppleARKitFrame::operator= that Wanghao reported Change 4280824 by Jason.Bestimt #DEV-VR - removing stale comment about ML SDK Settings using defaultengine.ini Change 4281117 by Jason.Bestimt #DEV-VR - Removing warnings on LUMIN from trying to load missing modules #JIRA: UE-62748 Change 4281514 by Jason.Bestimt #DEV-VR - Moving FunctionalTesting dependency under bCompileAgainstEngine Change 4281847 by Joe.Graf Added a UPL file to AppleARKit that modifies the plist to include the requirement of ARKit and request for camera access #jira: UE-60050, UE-62837 Change 4281945 by Joe.Graf Removed the ensures from the ARBlueprintLibrary code since the code handles the failure cases properly #jira: UE-61845, UE-61846 Change 4282098 by Ethan.Geller #jira UE-62863 fix audio on lumin #rb none Change 4283974 by Joe.Graf Deprecated bIsTracked on tracked images and face geo per Google API reunification feedback Change 4284118 by Jason.Bestimt #DEV-VR - Moving FunctionalTest dependency to be both non-shipping and CompileAgainstEngine. Allowing FunctionalTesting to be compiled in binary build Change 4285339 by Ethan.Geller #jira UE-62087 Whitelist AudioCapture module for mac while not whitelisting the AudioCaptureEditor module, which should only work on Windows. Change 4286024 by Ryan.Vance Copying //UE4/Partner-Microsoft-XR to Dev-VR (//UE4/Dev-VR) Windows mixed reality integration. Disabled by default Change 4289812 by Jason.Bestimt #DEV-VR - Fix for non-unity build issue with windows header Change 4296399 by Jason.Bestimt RSync fixes for xml files #JIRA: UE-62994 Change 4296679 by Jason.Bestimt #DEV-VR - Fixing remote iOS compile issue with BP projects that require plugins #JIRA: UE-62967 [CL 4299100 by Jason Bestimt in Main branch]
2018-08-17 19:56:07 -04:00
{
WindowsMixedReality::FWindowsMixedRealityHMD* hmd = GetWindowsMixedRealityHMD();
if (hmd == nullptr)
{
return FString();
}
return hmd->GetVersionString();
}
void UDEPRECATED_WindowsMixedRealityFunctionLibrary::ToggleImmersive(bool immersive)
Copying //UE4/Dev-VR to //UE4/Dev-Main (Source: //UE4/Dev-VR @ 4296730) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3775128 by Nick.Atamas Merging //UE4/Partner-Google-VR @ CL 3770408 to Dev-VR (//UE4/Dev-VR) Change 4166311 by Jason.Bestimt #DEV-VR - Merge from //UE4/Dev-MagicLeap/... @ CL 4136411 Change 4185551 by Joe.Graf Added support to query and specify the desired video format for an AR session Change 4269190 by Ethan.Geller [Dev-VR] #jira UE-62644 Deescalate resampling logs to display, and make sure that Lumin does not get Resampling settings from Android runtime settings. Change 4269386 by Ryan.Vance #jira UE-62274 We need to recompute the view frustum and related distances if the projection matrix is changed. Change 4269401 by Ryan.Vance #jira UE-62155 Debug canvas layer fixes Change 4270710 by Chance.Ivey Merging //UE4/Dev-Partner-MagicLeap-4.20 to Dev-VR (//UE4/Dev-VR) - 4262963 - 4261100 - 4261103 - 4265565 Change 4270822 by Ryan.Vance #jira UE-61462 Work around for csm shadow culling bug on Lumiun Change 4271396 by Jason.Bestimt #DEV-VR - Saving off original MLSDK variable for future editor "restarts" within the same process #JIRA: UE-58634 Change 4271402 by Jason.Bestimt #DEV-VR - Making bUseMobileRendering non-editable for binary builds #JIRA: UE-60956 Change 4271454 by Jason.Bestimt #DEV-VR - Integrating CL 4239939, 4236178 and 4269702 from Partners-Google-VR Change 4272387 by Ryan.Vance #jira UEVR-1281 Oculus 1.28 Plugin changes Change 4273410 by Jason.Bestimt #DEV-VR - Fixing MagicLeapSDK Settings to be globaluserconfig (by removing the defaultconfig). #JIRA: UE-62092 Change 4273929 by Ryan.Vance #jira UE-62744 Fixing missing includes.. Change 4274147 by Kyle.Fung Round-robin occlusion queries for stereoscopic rendering With the vr.RoundRobinOcclusion flag turned on, each frame will only render occlusion queries for one eye with an alternating scheme (ie odd frames only left eye, even frames only right eye). Additionally, the interface for class FPrimitiveOcclusionHistory has been changed along with a slight modification in its implementation. With round-robin occlusion, when extracing history entries we perform a search through the entire history to look for the oldest entry in a primitive's occlusion history. #jira UEVR-1289 Change 4274206 by Kyle.Fung Fixed some compiler warnings #jira UEVR-1289 Change 4275212 by Jason.Bestimt #DEV-VR - Fixing CIS error (forcing value to bool) Change 4275973 by Jason.Bestimt #DEV-VR - Merging CL 4275879 from Partner-Google-VR GoogleVR 1.170 Release Update. - Removed reference to GetHMDDeviceType. - Updated to final version of SDK libraries. Change 4276154 by Jason.Bestimt #DEV-VR - fix for CIS warning about PngPtr being used before it is checked Change 4277171 by Jeff.Fisher UE-62399 Graphical corruption when opening the debug console -Switched from the fast hardware clear to the slower shader clear because the slower one works. Perhaps a better fix exists that would make the faster clear work? Costs 60us when debug ui is up, but only when rendering debug to a stereo layer (vr/ar). #jira UE-62399 #review-4277026 Change 4277633 by Joe.Conley #jira UE-54565 - "Packaged game/Editor with Stereo Layers crashes when exiting game through steam VR overlay" Don't call GetStereoLayers if stereo is not enabled. Change 4277723 by Ryan.Vance #jira UE-62776 Cleaning up questionable partner code found by SA. I'm pretty confident the SA warning is a false positive, but there was a lot to fix here regardless. Change 4280289 by Joe.Graf Added some "Ignored by ARCore" comments Google requested Change 4280479 by Joe.Graf Fixed a member copy step in AppleARKitFrame::operator= that Wanghao reported Change 4280824 by Jason.Bestimt #DEV-VR - removing stale comment about ML SDK Settings using defaultengine.ini Change 4281117 by Jason.Bestimt #DEV-VR - Removing warnings on LUMIN from trying to load missing modules #JIRA: UE-62748 Change 4281514 by Jason.Bestimt #DEV-VR - Moving FunctionalTesting dependency under bCompileAgainstEngine Change 4281847 by Joe.Graf Added a UPL file to AppleARKit that modifies the plist to include the requirement of ARKit and request for camera access #jira: UE-60050, UE-62837 Change 4281945 by Joe.Graf Removed the ensures from the ARBlueprintLibrary code since the code handles the failure cases properly #jira: UE-61845, UE-61846 Change 4282098 by Ethan.Geller #jira UE-62863 fix audio on lumin #rb none Change 4283974 by Joe.Graf Deprecated bIsTracked on tracked images and face geo per Google API reunification feedback Change 4284118 by Jason.Bestimt #DEV-VR - Moving FunctionalTest dependency to be both non-shipping and CompileAgainstEngine. Allowing FunctionalTesting to be compiled in binary build Change 4285339 by Ethan.Geller #jira UE-62087 Whitelist AudioCapture module for mac while not whitelisting the AudioCaptureEditor module, which should only work on Windows. Change 4286024 by Ryan.Vance Copying //UE4/Partner-Microsoft-XR to Dev-VR (//UE4/Dev-VR) Windows mixed reality integration. Disabled by default Change 4289812 by Jason.Bestimt #DEV-VR - Fix for non-unity build issue with windows header Change 4296399 by Jason.Bestimt RSync fixes for xml files #JIRA: UE-62994 Change 4296679 by Jason.Bestimt #DEV-VR - Fixing remote iOS compile issue with BP projects that require plugins #JIRA: UE-62967 [CL 4299100 by Jason Bestimt in Main branch]
2018-08-17 19:56:07 -04:00
{
WindowsMixedReality::FWindowsMixedRealityHMD* hmd = GetWindowsMixedRealityHMD();
if (hmd == nullptr)
{
return;
}
hmd->EnableStereo(immersive);
}
bool UDEPRECATED_WindowsMixedRealityFunctionLibrary::IsCurrentlyImmersive()
Copying //UE4/Dev-VR to //UE4/Dev-Main (Source: //UE4/Dev-VR @ 4296730) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3775128 by Nick.Atamas Merging //UE4/Partner-Google-VR @ CL 3770408 to Dev-VR (//UE4/Dev-VR) Change 4166311 by Jason.Bestimt #DEV-VR - Merge from //UE4/Dev-MagicLeap/... @ CL 4136411 Change 4185551 by Joe.Graf Added support to query and specify the desired video format for an AR session Change 4269190 by Ethan.Geller [Dev-VR] #jira UE-62644 Deescalate resampling logs to display, and make sure that Lumin does not get Resampling settings from Android runtime settings. Change 4269386 by Ryan.Vance #jira UE-62274 We need to recompute the view frustum and related distances if the projection matrix is changed. Change 4269401 by Ryan.Vance #jira UE-62155 Debug canvas layer fixes Change 4270710 by Chance.Ivey Merging //UE4/Dev-Partner-MagicLeap-4.20 to Dev-VR (//UE4/Dev-VR) - 4262963 - 4261100 - 4261103 - 4265565 Change 4270822 by Ryan.Vance #jira UE-61462 Work around for csm shadow culling bug on Lumiun Change 4271396 by Jason.Bestimt #DEV-VR - Saving off original MLSDK variable for future editor "restarts" within the same process #JIRA: UE-58634 Change 4271402 by Jason.Bestimt #DEV-VR - Making bUseMobileRendering non-editable for binary builds #JIRA: UE-60956 Change 4271454 by Jason.Bestimt #DEV-VR - Integrating CL 4239939, 4236178 and 4269702 from Partners-Google-VR Change 4272387 by Ryan.Vance #jira UEVR-1281 Oculus 1.28 Plugin changes Change 4273410 by Jason.Bestimt #DEV-VR - Fixing MagicLeapSDK Settings to be globaluserconfig (by removing the defaultconfig). #JIRA: UE-62092 Change 4273929 by Ryan.Vance #jira UE-62744 Fixing missing includes.. Change 4274147 by Kyle.Fung Round-robin occlusion queries for stereoscopic rendering With the vr.RoundRobinOcclusion flag turned on, each frame will only render occlusion queries for one eye with an alternating scheme (ie odd frames only left eye, even frames only right eye). Additionally, the interface for class FPrimitiveOcclusionHistory has been changed along with a slight modification in its implementation. With round-robin occlusion, when extracing history entries we perform a search through the entire history to look for the oldest entry in a primitive's occlusion history. #jira UEVR-1289 Change 4274206 by Kyle.Fung Fixed some compiler warnings #jira UEVR-1289 Change 4275212 by Jason.Bestimt #DEV-VR - Fixing CIS error (forcing value to bool) Change 4275973 by Jason.Bestimt #DEV-VR - Merging CL 4275879 from Partner-Google-VR GoogleVR 1.170 Release Update. - Removed reference to GetHMDDeviceType. - Updated to final version of SDK libraries. Change 4276154 by Jason.Bestimt #DEV-VR - fix for CIS warning about PngPtr being used before it is checked Change 4277171 by Jeff.Fisher UE-62399 Graphical corruption when opening the debug console -Switched from the fast hardware clear to the slower shader clear because the slower one works. Perhaps a better fix exists that would make the faster clear work? Costs 60us when debug ui is up, but only when rendering debug to a stereo layer (vr/ar). #jira UE-62399 #review-4277026 Change 4277633 by Joe.Conley #jira UE-54565 - "Packaged game/Editor with Stereo Layers crashes when exiting game through steam VR overlay" Don't call GetStereoLayers if stereo is not enabled. Change 4277723 by Ryan.Vance #jira UE-62776 Cleaning up questionable partner code found by SA. I'm pretty confident the SA warning is a false positive, but there was a lot to fix here regardless. Change 4280289 by Joe.Graf Added some "Ignored by ARCore" comments Google requested Change 4280479 by Joe.Graf Fixed a member copy step in AppleARKitFrame::operator= that Wanghao reported Change 4280824 by Jason.Bestimt #DEV-VR - removing stale comment about ML SDK Settings using defaultengine.ini Change 4281117 by Jason.Bestimt #DEV-VR - Removing warnings on LUMIN from trying to load missing modules #JIRA: UE-62748 Change 4281514 by Jason.Bestimt #DEV-VR - Moving FunctionalTesting dependency under bCompileAgainstEngine Change 4281847 by Joe.Graf Added a UPL file to AppleARKit that modifies the plist to include the requirement of ARKit and request for camera access #jira: UE-60050, UE-62837 Change 4281945 by Joe.Graf Removed the ensures from the ARBlueprintLibrary code since the code handles the failure cases properly #jira: UE-61845, UE-61846 Change 4282098 by Ethan.Geller #jira UE-62863 fix audio on lumin #rb none Change 4283974 by Joe.Graf Deprecated bIsTracked on tracked images and face geo per Google API reunification feedback Change 4284118 by Jason.Bestimt #DEV-VR - Moving FunctionalTest dependency to be both non-shipping and CompileAgainstEngine. Allowing FunctionalTesting to be compiled in binary build Change 4285339 by Ethan.Geller #jira UE-62087 Whitelist AudioCapture module for mac while not whitelisting the AudioCaptureEditor module, which should only work on Windows. Change 4286024 by Ryan.Vance Copying //UE4/Partner-Microsoft-XR to Dev-VR (//UE4/Dev-VR) Windows mixed reality integration. Disabled by default Change 4289812 by Jason.Bestimt #DEV-VR - Fix for non-unity build issue with windows header Change 4296399 by Jason.Bestimt RSync fixes for xml files #JIRA: UE-62994 Change 4296679 by Jason.Bestimt #DEV-VR - Fixing remote iOS compile issue with BP projects that require plugins #JIRA: UE-62967 [CL 4299100 by Jason Bestimt in Main branch]
2018-08-17 19:56:07 -04:00
{
WindowsMixedReality::FWindowsMixedRealityHMD* hmd = GetWindowsMixedRealityHMD();
if (hmd == nullptr)
{
return false;
}
return hmd->IsCurrentlyImmersive();
}
bool UDEPRECATED_WindowsMixedRealityFunctionLibrary::IsDisplayOpaque()
{
WindowsMixedReality::FWindowsMixedRealityHMD* hmd = GetWindowsMixedRealityHMD();
if (hmd == nullptr)
{
return true;
}
return hmd->IsDisplayOpaque();
}
void UDEPRECATED_WindowsMixedRealityFunctionLibrary::LockMouseToCenter(bool locked)
{
WindowsMixedReality::FWindowsMixedRealityHMD* hmd = GetWindowsMixedRealityHMD();
if (hmd == nullptr)
{
return;
}
hmd->LockMouseToCenter(locked);
}
bool UDEPRECATED_WindowsMixedRealityFunctionLibrary::IsTrackingAvailable()
{
#if WITH_WINDOWS_MIXED_REALITY
WindowsMixedReality::FWindowsMixedRealityHMD* hmd = GetWindowsMixedRealityHMD();
if (hmd == nullptr)
{
return false;
}
return hmd->IsTrackingAvailable();
#else
return false;
#endif
}
FPointerPoseInfo UDEPRECATED_WindowsMixedRealityFunctionLibrary::GetPointerPoseInfo(EControllerHand hand)
{
FPointerPoseInfo info;
info.TrackingStatus = GetControllerTrackingStatus(hand);
#if WITH_WINDOWS_MIXED_REALITY
WindowsMixedReality::FWindowsMixedRealityHMD* hmd = GetWindowsMixedRealityHMD();
if (hmd == nullptr)
{
return info;
}
WindowsMixedReality::PointerPoseInfo p;
hmd->GetPointerPose(hand, p);
info.Origin = FVector(p.origin.x, p.origin.y, p.origin.z);
info.Direction = FVector(p.direction.x, p.direction.y, p.direction.z);
info.Up = FVector(p.up.x, p.up.y, p.up.z);
info.Orientation = FQuat(p.orientation.x, p.orientation.y, p.orientation.z, p.orientation.w);
#endif
return info;
}
bool UDEPRECATED_WindowsMixedRealityFunctionLibrary::IsButtonClicked(EControllerHand hand, EHMDInputControllerButtons button)
{
#if WITH_WINDOWS_MIXED_REALITY
WindowsMixedReality::FWindowsMixedRealityHMD* hmd = GetWindowsMixedRealityHMD();
if (hmd == nullptr)
{
return false;
}
return hmd->GetPressState((WindowsMixedReality::HMDHand)hand, (WindowsMixedReality::HMDInputControllerButtons)button) == WindowsMixedReality::HMDInputPressState::Pressed;
#endif
return false;
}
bool UDEPRECATED_WindowsMixedRealityFunctionLibrary::IsButtonDown(EControllerHand hand, EHMDInputControllerButtons button)
{
#if WITH_WINDOWS_MIXED_REALITY
WindowsMixedReality::FWindowsMixedRealityHMD* hmd = GetWindowsMixedRealityHMD();
if (hmd == nullptr)
{
return false;
}
return hmd->GetPressState((WindowsMixedReality::HMDHand)hand, (WindowsMixedReality::HMDInputControllerButtons)button, false) == WindowsMixedReality::HMDInputPressState::Pressed;
#endif
return false;
}
bool UDEPRECATED_WindowsMixedRealityFunctionLibrary::IsGrasped(EControllerHand hand)
{
return IsButtonDown(hand, EHMDInputControllerButtons::Grasp);
}
bool UDEPRECATED_WindowsMixedRealityFunctionLibrary::IsSelectPressed(EControllerHand hand)
{
return IsButtonDown(hand, EHMDInputControllerButtons::Select);
}
EHMDTrackingStatus UDEPRECATED_WindowsMixedRealityFunctionLibrary::GetControllerTrackingStatus(EControllerHand hand)
{
#if WITH_WINDOWS_MIXED_REALITY
WindowsMixedReality::FWindowsMixedRealityHMD* hmd = GetWindowsMixedRealityHMD();
if (hmd == nullptr)
{
return EHMDTrackingStatus::NotTracked;
}
return (EHMDTrackingStatus)hmd->GetControllerTrackingStatus((WindowsMixedReality::HMDHand)hand);
#endif
return EHMDTrackingStatus::NotTracked;
}
void UDEPRECATED_WindowsMixedRealityFunctionLibrary::SetFocusPointForFrame(FVector position)
{
#if WITH_WINDOWS_MIXED_REALITY
WindowsMixedReality::FWindowsMixedRealityHMD* hmd = GetWindowsMixedRealityHMD();
if (hmd == nullptr)
{
return;
}
hmd->SetFocusPointForFrame(position);
#endif
}
// Temporary CVAR api for FocusPoint
// The blueprint function to run a ConsoleCommand can be used to issue this each frame.
// The command string would be something like:
// vr.SetFocusPointForFrame 102.4 -850.3 21.7
static void SetFocusPointForFrame(const TArray<FString>& Args, UWorld*, FOutputDevice& Ar)
{
Ar.Logf(ELogVerbosity::Error, TEXT("SetFocusPointForFrame DEPRECATED: please switch to using the SetFocusPointForFrame blueprint function in this library instead. This command will be removed in 4.25."));
const int ArgsNum = Args.Num();
if (ArgsNum != 3)
{
Ar.Logf(ELogVerbosity::Error, TEXT("SetFocusPointForFrame command parameter expects 3 parameters not %i. Ignoring command."), ArgsNum);
}
FVector Position;
for (int i = 0; i < 3; ++i)
{
if (!FCString::IsNumeric(*Args[i]))
{
Ar.Logf(ELogVerbosity::Error, TEXT("SetFocusPointForFrame command parameter %i, '%s' is not numeric. Ignoring command."), i, *Args[i]);
return;
}
const float Value = FCString::Atof(*Args[i]);
check(i >= 0 && i <= 2);
Position[i] = Value;
}
WindowsMixedReality::FWindowsMixedRealityHMD* hmd = GetWindowsMixedRealityHMD();
if (hmd == nullptr)
{
Ar.Logf(ELogVerbosity::Error, TEXT("SetFocusPointForFrame command called but not WindowsMixedRealityHMD found. Ignoring command."));
return;
}
//Ar.Logf(TEXT("WindowsMixedReality SetFocusPointForFrame setting to %0.2f,%0.2f,%0.2f."), Position.X, Position.Y, Position.Z);
hmd->SetFocusPointForFrame(Position);
}
#define LOCTEXT_NAMESPACE "WindowsMixedReality"
static FAutoConsoleCommand CSetFocusPointForFrameCmd(
TEXT("vr.SetFocusPointForFrame"),
*LOCTEXT("CVarText_SetFocusPointForFrame", "Set the reference point for the stabilization plane on hololens 2. You must set it each frame to activate the feature for that frame. DEPRECATED: please switch to using the SetFocusPointForFrame blueprint function in this library instead.").ToString(),
FConsoleCommandWithWorldArgsAndOutputDeviceDelegate::CreateStatic(SetFocusPointForFrame));
#undef LOCTEXT_NAMESPACE