diff --git a/CHANGELOG.md b/CHANGELOG.md index be19f0d1..e3507067 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,9 +10,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - A fallback to HMD and wrist tracker hardware auto-detection mechanism has been added to be triggered in situations when automatic detection of the wrist tracker hardware is desired, e.g., either by not setting it explicitly, or setting it to the default None value. Please note that this is still highly experimental and HTC VIVE Focus 3 and HTC XR Elite cannot be distinguished in the current iteration. Though, since the tracker devices and offsets for both headsets are the same in the end it does not make a difference if both headsets are detected as each other. -- Added the SGHeadMountDisplay utility class, exposed to both C++ and Blueprint, in order to easily gather information about the HMD at runtime. +- Added the SGHeadMountedDisplay utility class, exposed to both C++ and Blueprint, in order to easily gather information about the HMD at runtime. - Added the SGTypes header to the SenseGloveTypes module in order to define and share SenseGlove module types through this header across the plugin modules. -- Added ESGHeadMountDisplayDevice enum with supported HMDs list. +- Added ESGHeadMountedDisplayDevice enum with supported HMDs list. ### Changed diff --git a/Source/SenseGlove/Private/SenseGlove/Components/SGWristTrackerComponent.cpp b/Source/SenseGlove/Private/SenseGlove/Components/SGWristTrackerComponent.cpp index 79985804..41a1de95 100644 --- a/Source/SenseGlove/Private/SenseGlove/Components/SGWristTrackerComponent.cpp +++ b/Source/SenseGlove/Private/SenseGlove/Components/SGWristTrackerComponent.cpp @@ -40,7 +40,7 @@ #include "Engine/SkeletalMesh.h" #include "UObject/ConstructorHelpers.h" -#include "SenseGlove/SGHeadMountDisplay.h" +#include "SenseGlove/SGHeadMountedDisplay.h" #include "SGBackend/SGBackend.h" #include "SGCore/SGHapticGlove.h" #include "SGDebug/SGDebugGizmo.h" @@ -289,24 +289,24 @@ void USGWristTrackerComponent::FImpl::UpdateWristTrackingData() const ESGPositionalTrackingHardware TrackerHardware = Owner->GetWristTrackingSettings().TrackingHardware; if (TrackerHardware == ESGPositionalTrackingHardware::None) { - const ESGHeadMountDisplayDevice HmdDevice = FSGHeadMountDisplay::GetDeviceType(); + const ESGHeadMountedDisplayDevice HmdDevice = FSGHeadMountedDisplay::GetDeviceType(); switch (HmdDevice) { - case ESGHeadMountDisplayDevice::MetaQuest2: + case ESGHeadMountedDisplayDevice::MetaQuest2: TrackerHardware = ESGPositionalTrackingHardware::Quest2Controller; break; - case ESGHeadMountDisplayDevice::MetaQuestPro: + case ESGHeadMountedDisplayDevice::MetaQuestPro: TrackerHardware = ESGPositionalTrackingHardware::QuestProController; break; - case ESGHeadMountDisplayDevice::MetaQuest3: + case ESGHeadMountedDisplayDevice::MetaQuest3: TrackerHardware = ESGPositionalTrackingHardware::Quest3Controller; break; - case ESGHeadMountDisplayDevice::HtcVivePro: + case ESGHeadMountedDisplayDevice::HtcVivePro: TrackerHardware = ESGPositionalTrackingHardware::ViveTracker; break; - case ESGHeadMountDisplayDevice::HtcViveFocus3: + case ESGHeadMountedDisplayDevice::HtcViveFocus3: // Fall through - case ESGHeadMountDisplayDevice::HtcViveXRElite: + case ESGHeadMountedDisplayDevice::HtcViveXRElite: TrackerHardware = ESGPositionalTrackingHardware::ViveFocus3WristTracker; break; default: diff --git a/Source/SenseGlove/Private/SenseGlove/SGHeadMountDisplay.cpp b/Source/SenseGlove/Private/SenseGlove/SGHeadMountedDisplay.cpp similarity index 92% rename from Source/SenseGlove/Private/SenseGlove/SGHeadMountDisplay.cpp rename to Source/SenseGlove/Private/SenseGlove/SGHeadMountedDisplay.cpp index be45c57f..64bb5330 100644 --- a/Source/SenseGlove/Private/SenseGlove/SGHeadMountDisplay.cpp +++ b/Source/SenseGlove/Private/SenseGlove/SGHeadMountedDisplay.cpp @@ -33,13 +33,13 @@ */ -#include "SenseGlove/SGHeadMountDisplay.h" +#include "SenseGlove/SGHeadMountedDisplay.h" #include "Engine/Engine.h" #include "IHeadMountedDisplay.h" #include "IXRTrackingSystem.h" -FName FSGHeadMountDisplay::GetDeviceName() +FName FSGHeadMountedDisplay::GetDeviceName() { if (GEngine && GEngine->XRSystem.IsValid() && GEngine->XRSystem->IsHeadTrackingAllowed()) { @@ -53,7 +53,7 @@ FName FSGHeadMountDisplay::GetDeviceName() return NAME_None; } -bool FSGHeadMountDisplay::IsMetaQuest2() +bool FSGHeadMountedDisplay::IsMetaQuest2() { static const FName MetaQuest2DeviceIdentifier{TEXT("Meta Quest 2")}; static const FName OculusQuest2DeviceIdentifier{TEXT("Oculus Quest2")}; @@ -72,7 +72,7 @@ bool FSGHeadMountDisplay::IsMetaQuest2() return bMatched; } -bool FSGHeadMountDisplay::IsMetaQuestPro() +bool FSGHeadMountedDisplay::IsMetaQuestPro() { static const FName MetaQuestProDeviceIdentifier{TEXT("Meta Quest Pro")}; static const FName OculusQuestProDeviceIdentifier{TEXT("Oculus QuestPro")}; @@ -91,7 +91,7 @@ bool FSGHeadMountDisplay::IsMetaQuestPro() return bMatched; } -bool FSGHeadMountDisplay::IsMetaQuest3() +bool FSGHeadMountedDisplay::IsMetaQuest3() { static const FName MetaQuest3DeviceIdentifier{TEXT("Meta Quest 3")}; static const FName OculusQuest3DeviceIdentifier{TEXT("Oculus Quest3")}; @@ -110,7 +110,7 @@ bool FSGHeadMountDisplay::IsMetaQuest3() return bMatched; } -bool FSGHeadMountDisplay::IsHtcVivePro() +bool FSGHeadMountedDisplay::IsHtcVivePro() { #if PLATFORM_ANDROID return false; @@ -165,7 +165,7 @@ bool FSGHeadMountDisplay::IsHtcVivePro() #endif /* PLATFORM_ANDROID */ } -bool FSGHeadMountDisplay::IsHtcViveFocus3() +bool FSGHeadMountedDisplay::IsHtcViveFocus3() { static const FName DeviceIdentifier{TEXT("Vive OpenXR: Vive SRanipal")}; static const FString ViveDeviceIdentifier{TEXT("Vive")}; @@ -225,7 +225,7 @@ bool FSGHeadMountDisplay::IsHtcViveFocus3() return bMatched; } -bool FSGHeadMountDisplay::IsHtcViveXRElite() +bool FSGHeadMountedDisplay::IsHtcViveXRElite() { static const FName DeviceIdentifier{TEXT("Vive OpenXR: Vive SRanipal")}; static const FString ViveDeviceIdentifier{TEXT("Vive")}; @@ -285,37 +285,37 @@ bool FSGHeadMountDisplay::IsHtcViveXRElite() return bMatched; } -ESGHeadMountDisplayDevice FSGHeadMountDisplay::GetDeviceType() +ESGHeadMountedDisplayDevice FSGHeadMountedDisplay::GetDeviceType() { if (IsMetaQuest2()) { - return ESGHeadMountDisplayDevice::MetaQuest2; + return ESGHeadMountedDisplayDevice::MetaQuest2; } if (IsMetaQuestPro()) { - return ESGHeadMountDisplayDevice::MetaQuestPro; + return ESGHeadMountedDisplayDevice::MetaQuestPro; } if (IsMetaQuest3()) { - return ESGHeadMountDisplayDevice::MetaQuest3; + return ESGHeadMountedDisplayDevice::MetaQuest3; } if (IsHtcVivePro()) { - return ESGHeadMountDisplayDevice::HtcVivePro; + return ESGHeadMountedDisplayDevice::HtcVivePro; } if (IsHtcViveFocus3()) { - return ESGHeadMountDisplayDevice::HtcViveFocus3; + return ESGHeadMountedDisplayDevice::HtcViveFocus3; } if (IsHtcViveXRElite()) { - return ESGHeadMountDisplayDevice::HtcViveXRElite; + return ESGHeadMountedDisplayDevice::HtcViveXRElite; } - return ESGHeadMountDisplayDevice::None; + return ESGHeadMountedDisplayDevice::None; } \ No newline at end of file diff --git a/Source/SenseGlove/Public/SenseGlove/SGHeadMountDisplay.h b/Source/SenseGlove/Public/SenseGlove/SGHeadMountedDisplay.h similarity index 94% rename from Source/SenseGlove/Public/SenseGlove/SGHeadMountDisplay.h rename to Source/SenseGlove/Public/SenseGlove/SGHeadMountedDisplay.h index 5554885a..5cf71c9d 100644 --- a/Source/SenseGlove/Public/SenseGlove/SGHeadMountDisplay.h +++ b/Source/SenseGlove/Public/SenseGlove/SGHeadMountedDisplay.h @@ -41,13 +41,13 @@ #include "SGTypes/SGTypes.h" -#include "SGHeadMountDisplay.generated.h" +#include "SGHeadMountedDisplay.generated.h" /** * */ USTRUCT() -struct SENSEGLOVE_API FSGHeadMountDisplay +struct SENSEGLOVE_API FSGHeadMountedDisplay { GENERATED_BODY() @@ -90,5 +90,5 @@ public: */ static bool IsHtcViveXRElite(); - static ESGHeadMountDisplayDevice GetDeviceType(); + static ESGHeadMountedDisplayDevice GetDeviceType(); }; \ No newline at end of file diff --git a/Source/SenseGloveKismet/Private/SGKismet/SGHeadMountDisplayKismetLibrary.cpp b/Source/SenseGloveKismet/Private/SGKismet/SGHeadMountedDisplayKismetLibrary.cpp similarity index 57% rename from Source/SenseGloveKismet/Private/SGKismet/SGHeadMountDisplayKismetLibrary.cpp rename to Source/SenseGloveKismet/Private/SGKismet/SGHeadMountedDisplayKismetLibrary.cpp index bf932c12..d88c1130 100644 --- a/Source/SenseGloveKismet/Private/SGKismet/SGHeadMountDisplayKismetLibrary.cpp +++ b/Source/SenseGloveKismet/Private/SGKismet/SGHeadMountedDisplayKismetLibrary.cpp @@ -33,46 +33,46 @@ */ -#include "SGKismet/SGHeadMountDisplayKismetLibrary.h" +#include "SGKismet/SGHeadMountedDisplayKismetLibrary.h" -#include "SenseGlove/SGHeadMountDisplay.h" +#include "SenseGlove/SGHeadMountedDisplay.h" -FName UHeadMountDisplayKismetLibrary::GetDeviceName() +FName UHeadMountedDisplayKismetLibrary::GetDeviceName() { - return FSGHeadMountDisplay::GetDeviceName(); + return FSGHeadMountedDisplay::GetDeviceName(); } -bool UHeadMountDisplayKismetLibrary::IsMetaQuest2() +bool UHeadMountedDisplayKismetLibrary::IsMetaQuest2() { - return FSGHeadMountDisplay::IsMetaQuest2(); + return FSGHeadMountedDisplay::IsMetaQuest2(); } -bool UHeadMountDisplayKismetLibrary::IsMetaQuestPro() +bool UHeadMountedDisplayKismetLibrary::IsMetaQuestPro() { - return FSGHeadMountDisplay::IsMetaQuestPro(); + return FSGHeadMountedDisplay::IsMetaQuestPro(); } -bool UHeadMountDisplayKismetLibrary::IsMetaQuest3() +bool UHeadMountedDisplayKismetLibrary::IsMetaQuest3() { - return FSGHeadMountDisplay::IsMetaQuest3(); + return FSGHeadMountedDisplay::IsMetaQuest3(); } -bool UHeadMountDisplayKismetLibrary::IsHtcVivePro() +bool UHeadMountedDisplayKismetLibrary::IsHtcVivePro() { - return FSGHeadMountDisplay::IsHtcVivePro(); + return FSGHeadMountedDisplay::IsHtcVivePro(); } -bool UHeadMountDisplayKismetLibrary::IsHtcViveFocus3() +bool UHeadMountedDisplayKismetLibrary::IsHtcViveFocus3() { - return FSGHeadMountDisplay::IsHtcViveFocus3(); + return FSGHeadMountedDisplay::IsHtcViveFocus3(); } -bool UHeadMountDisplayKismetLibrary::IsHtcViveXRElite() +bool UHeadMountedDisplayKismetLibrary::IsHtcViveXRElite() { - return FSGHeadMountDisplay::IsHtcViveXRElite(); + return FSGHeadMountedDisplay::IsHtcViveXRElite(); } -ESGHeadMountDisplayDevice UHeadMountDisplayKismetLibrary::GetDeviceType() +ESGHeadMountedDisplayDevice UHeadMountedDisplayKismetLibrary::GetDeviceType() { - return FSGHeadMountDisplay::GetDeviceType(); + return FSGHeadMountedDisplay::GetDeviceType(); } \ No newline at end of file diff --git a/Source/SenseGloveKismet/Public/SGKismet/SGHeadMountDisplayKismetLibrary.h b/Source/SenseGloveKismet/Public/SGKismet/SGHeadMountedDisplayKismetLibrary.h similarity index 74% rename from Source/SenseGloveKismet/Public/SGKismet/SGHeadMountDisplayKismetLibrary.h rename to Source/SenseGloveKismet/Public/SGKismet/SGHeadMountedDisplayKismetLibrary.h index 648506de..37cc6374 100644 --- a/Source/SenseGloveKismet/Public/SGKismet/SGHeadMountDisplayKismetLibrary.h +++ b/Source/SenseGloveKismet/Public/SGKismet/SGHeadMountedDisplayKismetLibrary.h @@ -40,39 +40,39 @@ #include "SGKismet/SGBlueprintFunctionLibrary.h" #include "SGTypes/SGTypes.h" -#include "SGHeadMountDisplayKismetLibrary.generated.h" +#include "SGHeadMountedDisplayKismetLibrary.generated.h" -UCLASS(meta=(ScriptName = "SesneGloveHeadMountDisplayKismetLibrary")) -class SENSEGLOVEKISMET_API UHeadMountDisplayKismetLibrary final : public USGBlueprintFunctionLibrary +UCLASS(meta=(ScriptName = "SesneGloveHeadMountedDisplayKismetLibrary")) +class SENSEGLOVEKISMET_API UHeadMountedDisplayKismetLibrary final : public USGBlueprintFunctionLibrary { GENERATED_BODY() public: - UFUNCTION(BlueprintCallable, Category="SenseGlove | Head Mount Display") + UFUNCTION(BlueprintCallable, Category="SenseGlove | Head-mounted Display") static FName GetDeviceName(); /** * Checks whether the HMD device is Meta Quest 2, or not. */ - UFUNCTION(BlueprintCallable, Category="SenseGlove | Head Mount Display") + UFUNCTION(BlueprintCallable, Category="SenseGlove | Head-mounted Display") static bool IsMetaQuest2(); /** * Checks whether the HMD device is Meta Quest Pro, or not. */ - UFUNCTION(BlueprintCallable, Category="SenseGlove | Head Mount Display") + UFUNCTION(BlueprintCallable, Category="SenseGlove | Head-mounted Display") static bool IsMetaQuestPro(); /** * Checks whether the HMD device is Meta Quest 3, or not. */ - UFUNCTION(BlueprintCallable, Category="SenseGlove | Head Mount Display") + UFUNCTION(BlueprintCallable, Category="SenseGlove | Head-mounted Display") static bool IsMetaQuest3(); /** * Checks whether the HMD device is HTC VIVE Pro, or not. */ - UFUNCTION(BlueprintCallable, Category="SenseGlove | Head Mount Display") + UFUNCTION(BlueprintCallable, Category="SenseGlove | Head-mounted Display") static bool IsHtcVivePro(); /** @@ -81,7 +81,7 @@ public: * @remark At the moment, VIVE Focus 3 cannot be distinguished from VIVE XR Elite, so when IsHtcViveFocus3 returns * true, IsHtcViveXRElite will return true as well; thus we cannot know for sure which headset we are running on. */ - UFUNCTION(BlueprintCallable, Category="SenseGlove | Head Mount Display") + UFUNCTION(BlueprintCallable, Category="SenseGlove | Head-mounted Display") static bool IsHtcViveFocus3(); /** @@ -90,9 +90,9 @@ public: * @remark At the moment, VIVE Focus 3 cannot be distinguished from VIVE XR Elite, so when IsHtcViveXRElite returns * true, IsHtcViveFocus3 will return true as well; thus we cannot know for sure which headset we are running on. */ - UFUNCTION(BlueprintCallable, Category = "SenseGlove | Head Mount Display") + UFUNCTION(BlueprintCallable, Category = "SenseGlove | Head-mounted Display") static bool IsHtcViveXRElite(); - UFUNCTION(BlueprintCallable, Category="SenseGlove | Head Mount Display") - static ESGHeadMountDisplayDevice GetDeviceType(); + UFUNCTION(BlueprintCallable, Category="SenseGlove | Head-mounted Display") + static ESGHeadMountedDisplayDevice GetDeviceType(); }; diff --git a/Source/SenseGloveTypes/Public/SGTypes/SGTypes.h b/Source/SenseGloveTypes/Public/SGTypes/SGTypes.h index e95e9c23..6663ae5f 100644 --- a/Source/SenseGloveTypes/Public/SGTypes/SGTypes.h +++ b/Source/SenseGloveTypes/Public/SGTypes/SGTypes.h @@ -38,9 +38,9 @@ #include "CoreTypes.h" #include "UObject/ObjectMacros.h" -/* The Head Mount Display device enum to determine the HMD device type. */ +/* The Head-mounted Display device enum to determine the HMD device type. */ UENUM(BlueprintType) -enum class ESGHeadMountDisplayDevice : uint8 +enum class ESGHeadMountedDisplayDevice : uint8 { /* The default none value. */ None UMETA(DisplayName = "None"),