From 57aee0e93269d517bf3efae74a6be39f23e91ec1 Mon Sep 17 00:00:00 2001 From: Mamadou Babaei Date: Tue, 17 Feb 2026 16:03:02 +0100 Subject: [PATCH] drop support for unreal engine 5.4 --- Handbook/src/appendix/changelog.md | 5 + .../SGVirtualHandAnimInstanceProxy.cpp | 33 +- .../Components/SGVirtualHandComponent.cpp | 81 +---- .../Components/SGWristTrackerComponent.cpp | 49 +-- .../GameFramework/SGGameUserSettings.cpp | 9 +- .../SenseGlove/GameFramework/SGPawn.cpp | 8 +- .../SGVirtualHandAnimInstanceProxy.h | 11 - .../Components/SGVirtualHandComponent.h | 11 +- .../Components/SGWristTrackerComponent.h | 5 - .../Private/SGDebug/SGDebugVirtualHand.cpp | 47 +-- .../Public/SGDebug/SGDebugVirtualHand.h | 8 - .../SGDebugVirtualHandKismetLibrary.cpp | 12 - .../SGDebugVirtualHandKismetLibrary.h | 7 - .../SGVirtualHandComponentKismetLibrary.cpp | 8 - .../SGWristTrackerComponentKismetLibrary.cpp | 8 - .../SGVirtualHandComponentKismetLibrary.h | 4 - .../SGWristTrackerComponentKismetLibrary.h | 4 - .../Private/SGTracking/SGHMDTracker.cpp | 11 - .../Private/SGTracking/SGXRTracker.cpp | 313 ------------------ .../Public/SGTracking/SGXRTracker.h | 14 - .../SenseGloveTracking.Build.cs | 17 - .../SGXRTrackerKismetLibrary.cpp | 8 - .../SGXRTrackerKismetLibrary.h | 7 - .../Private/SGUtils/SGEngineUtils.cpp | 17 +- 24 files changed, 28 insertions(+), 669 deletions(-) diff --git a/Handbook/src/appendix/changelog.md b/Handbook/src/appendix/changelog.md index c09c5f8e..b3fd1192 100644 --- a/Handbook/src/appendix/changelog.md +++ b/Handbook/src/appendix/changelog.md @@ -25,6 +25,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Bumped the SenseGlove Unreal Engine Marketplace Packager to `v0.6.1-85c5a6e`. - Bumped the copyright years. +### Removed + +- Dropped support for Unreal Engine `5.4`, which was already deprecated via the `v2.7.x` release series. +- Dropped support for Epic Native/Cross Toolchains `v22` (previously used for building UE `5.3` and `5.4` Linux dependencies), as they were already deprecated via previous releases. + ### Documentation - Ensure deterministic dependency builds by pinning Rust toolchain. diff --git a/Source/SenseGlove/Private/SenseGlove/Animation/SGVirtualHandAnimInstanceProxy.cpp b/Source/SenseGlove/Private/SenseGlove/Animation/SGVirtualHandAnimInstanceProxy.cpp index 368539ad..eebcc3c5 100644 --- a/Source/SenseGlove/Private/SenseGlove/Animation/SGVirtualHandAnimInstanceProxy.cpp +++ b/Source/SenseGlove/Private/SenseGlove/Animation/SGVirtualHandAnimInstanceProxy.cpp @@ -107,7 +107,6 @@ void FSGVirtualHandAnimInstanceProxy::PreEvaluateAnimation(UAnimInstance* InAnim return; } -#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 HandTrackingState = VirtualHand->GetHandTrackingState(); if (!HandTrackingState.bValid) { @@ -115,26 +114,11 @@ void FSGVirtualHandAnimInstanceProxy::PreEvaluateAnimation(UAnimInstance* InAnim } ensureAlwaysMsgf(HandTrackingState.HandKeyLocations.Num() == HandTrackingState.HandKeyRotations.Num(), TEXT("Mismatched hand tracking state locations and rotations!")); -#else /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ - MotionControllerData = VirtualHand->GetMotionControllerData(); - if (!MotionControllerData.bValid) - { - return; - } - ensureAlwaysMsgf(MotionControllerData.HandKeyPositions.Num() == MotionControllerData.HandKeyRotations.Num(), - TEXT("Mismatched motion controller data positions and rotations!")); -#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ - BoneNamesMap.Empty(); for (TArray::SizeType HandKeyIndex = 0; - HandKeyIndex < -#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 - HandTrackingState.HandKeyRotations.Num() -#else /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ - MotionControllerData.HandKeyRotations.Num() -#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ - ; ++HandKeyIndex) + HandKeyIndex < HandTrackingState.HandKeyRotations.Num(); + ++HandKeyIndex) { const FName& BoneName{VirtualHand->GetHandBoneName(HandKeyIndex)}; BoneNamesMap.Add(HandKeyIndex, BoneName); @@ -152,17 +136,10 @@ bool FSGVirtualHandAnimInstanceProxy::Evaluate(FPoseContext& Output) return FAnimInstanceProxy::Evaluate(Output); } -#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 if (!HandTrackingState.bValid) { return FAnimInstanceProxy::Evaluate(Output); } -#else /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ - if (!MotionControllerData.bValid) - { - return FAnimInstanceProxy::Evaluate(Output); - } -#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ FComponentSpacePoseContext PoseContext{Output.AnimInstanceProxy}; PoseContext.Pose.InitPose(Output.Pose); @@ -187,15 +164,9 @@ bool FSGVirtualHandAnimInstanceProxy::Evaluate(FPoseContext& Output) BoneReference.BoneIndex = BoneIndex; BoneReference.bUseSkeletonIndex = true; -#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 const FVector& HandKeyLocation{HandTrackingState.HandKeyLocations[HandKeyIndex]}; const FQuat& HandKeyRotation{HandTrackingState.HandKeyRotations[HandKeyIndex]}; const FTransform HandKeyTransform{HandKeyRotation, HandKeyLocation}; -#else /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ - const FVector& HandKeyPosition{MotionControllerData.HandKeyPositions[HandKeyIndex]}; - const FQuat& HandKeyRotation{MotionControllerData.HandKeyRotations[HandKeyIndex]}; - const FTransform HandKeyTransform{HandKeyRotation, HandKeyPosition}; -#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ const FTransform BoneTransform{AnimationBoneCorrectionOffsetTransform * HandKeyTransform}; FRotator BoneRotation{BoneTransform.GetRotation().Rotator()}; diff --git a/Source/SenseGlove/Private/SenseGlove/Components/SGVirtualHandComponent.cpp b/Source/SenseGlove/Private/SenseGlove/Components/SGVirtualHandComponent.cpp index 86423f91..8297e4b5 100644 --- a/Source/SenseGlove/Private/SenseGlove/Components/SGVirtualHandComponent.cpp +++ b/Source/SenseGlove/Private/SenseGlove/Components/SGVirtualHandComponent.cpp @@ -99,13 +99,7 @@ struct USGVirtualHandComponent::FImpl ECollisionEnabled::Type CachedCollisionEnabled; FCollisionResponseContainer CachedCollisionResponse; -#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION < 7 - FXRMotionControllerData MotionControllerData; -#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION < 7 */ - -#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 FXRHandTrackingState HandTrackingState; -#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ /************************ * Owner object @@ -247,11 +241,7 @@ USGVirtualHandComponent::USGVirtualHandComponent(const FObjectInitializer& Objec Super::SetCollisionResponseToChannel(ECC_Vehicle, ECR_Block); Super::SetCollisionResponseToChannel(ECC_Destructible, ECR_Block); -#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 Super::SetAnimInstanceClass(USGVirtualHandAnimInstance::StaticClass()); -#else /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ - Super::SetAnimClass(USGVirtualHandAnimInstance::StaticClass()); -#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ bRight = true; @@ -314,7 +304,6 @@ FSGVirtualHandSettings USGVirtualHandComponent::GetVirtualHandSettings() const return VirtualHandSettings; } -#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 void USGVirtualHandComponent::SetAnimInstanceClass(UClass* NewClass) { ensureAlwaysMsgf((TIsDerivedFrom::IsDerived), @@ -322,15 +311,6 @@ void USGVirtualHandComponent::SetAnimInstanceClass(UClass* NewClass) Super::SetAnimInstanceClass(NewClass); } -#else /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ -void USGVirtualHandComponent::SetAnimClass(UClass* NewClass) -{ - ensureAlwaysMsgf((TIsDerivedFrom::IsDerived), - TEXT("The AnimInstance class must be a subclass of USGVirtualHandAnimInstance!")); - - Super::SetAnimClass(NewClass); -} -#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ void USGVirtualHandComponent::PostInitProperties() { @@ -476,17 +456,10 @@ USGHapticGlove* USGVirtualHandComponent::GetConnectedGlove() const return Glove; } -const FXRMotionControllerData& USGVirtualHandComponent::GetMotionControllerData() const -{ - return Pimpl->MotionControllerData; -} - -#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 const FXRHandTrackingState& USGVirtualHandComponent::GetHandTrackingState() const { return Pimpl->HandTrackingState; } -#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ const TArray& USGVirtualHandComponent::GetHandBoneNames() const { @@ -759,34 +732,14 @@ void USGVirtualHandComponent::FImpl::UpdateXRData() { const EControllerHand Hand = Owner->IsRight() ? EControllerHand::Right : EControllerHand::Left; -#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION < 7 - { - FXRMotionControllerData Data; - Data.bValid = false; + FXRHandTrackingState State; + State.bValid = false; + const bool bGotHandTrackingState = + FSGXRTracker::GetHandTrackingState( + Owner, EXRSpaceType::UnrealWorldSpace, Hand, State); - PRAGMA_DISABLE_DEPRECATION_WARNINGS - const bool bGotMotionControllerData = - FSGXRTracker::GetMotionControllerData(Owner, Hand, Data); - PRAGMA_ENABLE_DEPRECATION_WARNINGS - - (void) - bGotMotionControllerData; - MotionControllerData = MoveTemp(Data); - } -#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION < 7 */ - -#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 - { - FXRHandTrackingState State; - State.bValid = false; - const bool bGotHandTrackingState = - FSGXRTracker::GetHandTrackingState( - Owner, EXRSpaceType::UnrealWorldSpace, Hand, State); - - (void) bGotHandTrackingState; - HandTrackingState = MoveTemp(State); - } -#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ + (void) bGotHandTrackingState; + HandTrackingState = MoveTemp(State); } void USGVirtualHandComponent::FImpl::SetVisibility(const bool bInVisible) @@ -807,14 +760,7 @@ void USGVirtualHandComponent::FImpl::SetVisibility(const bool bInVisible) void USGVirtualHandComponent::FImpl::UpdateVisibility() { - const bool bHandDataAvailable = -#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 - HandTrackingState.bValid -#else /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ - MotionControllerData.bValid - && MotionControllerData.DeviceVisualType == EXRVisualType::Hand -#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ - ; + const bool bHandDataAvailable = HandTrackingState.bValid; const bool bHandVisible = Owner->IsVisible(); const bool bShouldBeVisibleWhenHandDataUnavailable = Owner->GetVirtualHandSettings().bVisibleWhenHandDataUnavailable; @@ -873,23 +819,12 @@ void USGVirtualHandComponent::FImpl::DrawDebugVirtualHand() const return; } -#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 if (!HandTrackingState.bValid) { return; } FSGDebugVirtualHand::Draw(World, HandTrackingState, Owner->GetVirtualHandSettings().DebuggingSettings); -#else /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ - - if (!MotionControllerData.bValid - || MotionControllerData.DeviceVisualType == EXRVisualType::Hand) - { - return; - } - - FSGDebugVirtualHand::Draw(World, MotionControllerData, Owner->GetVirtualHandSettings().DebuggingSettings); -#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ } void USGVirtualHandComponent::FImpl::TriggerHandVisibilityChangedEvent(const bool bNewVisibility) const diff --git a/Source/SenseGlove/Private/SenseGlove/Components/SGWristTrackerComponent.cpp b/Source/SenseGlove/Private/SenseGlove/Components/SGWristTrackerComponent.cpp index dee81eb3..9a034d24 100644 --- a/Source/SenseGlove/Private/SenseGlove/Components/SGWristTrackerComponent.cpp +++ b/Source/SenseGlove/Private/SenseGlove/Components/SGWristTrackerComponent.cpp @@ -56,13 +56,7 @@ struct USGWristTrackerComponent::FImpl bool bOverridePluginSettingsPropertyAlreadyModified; -#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION < 7 - FXRMotionControllerData MotionControllerData; -#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION < 7 */ - -#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 FXRHandTrackingState HandTrackingState; -#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ /************************ * Owner object @@ -257,19 +251,10 @@ void USGWristTrackerComponent::EditorTick( Pimpl->UpdateWristTrackingData(); } -#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION < 7 -const FXRMotionControllerData& USGWristTrackerComponent::GetMotionControllerData() const -{ - return Pimpl->MotionControllerData; -} -#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION < 7 */ - -#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 const FXRHandTrackingState& USGWristTrackerComponent::GetHandTrackingState() const { return Pimpl->HandTrackingState; } -#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ USGWristTrackerComponent::FImpl::FImpl(USGWristTrackerComponent* InOwner) : bOverridePluginSettingsPropertyAlreadyModified(false), @@ -333,34 +318,14 @@ void USGWristTrackerComponent::FImpl::UpdateXRData() { const EControllerHand Hand = Owner->IsRight() ? EControllerHand::Right : EControllerHand::Left; -#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION < 7 - { - FXRMotionControllerData Data; - Data.bValid = false; + FXRHandTrackingState State; + State.bValid = false; + const bool bGotHandTrackingState = + FSGXRTracker::GetHandTrackingState( + Owner, EXRSpaceType::UnrealWorldSpace, Hand, State); - PRAGMA_DISABLE_DEPRECATION_WARNINGS - const bool bGotMotionControllerData = - FSGXRTracker::GetMotionControllerData(Owner, Hand, Data); - PRAGMA_ENABLE_DEPRECATION_WARNINGS - - (void) - bGotMotionControllerData; - MotionControllerData = MoveTemp(Data); - } -#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION < 7 */ - -#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 - { - FXRHandTrackingState State; - State.bValid = false; - const bool bGotHandTrackingState = - FSGXRTracker::GetHandTrackingState( - Owner, EXRSpaceType::UnrealWorldSpace, Hand, State); - - (void) bGotHandTrackingState; - HandTrackingState = MoveTemp(State); - } -#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ + (void) bGotHandTrackingState; + HandTrackingState = MoveTemp(State); } void USGWristTrackerComponent::FImpl::UpdateWristTrackingData() const diff --git a/Source/SenseGlove/Private/SenseGlove/GameFramework/SGGameUserSettings.cpp b/Source/SenseGlove/Private/SenseGlove/GameFramework/SGGameUserSettings.cpp index 345018c1..57c5bdbc 100644 --- a/Source/SenseGlove/Private/SenseGlove/GameFramework/SGGameUserSettings.cpp +++ b/Source/SenseGlove/Private/SenseGlove/GameFramework/SGGameUserSettings.cpp @@ -200,9 +200,7 @@ void USGGameUserSettings::SetEngineScalabilitySettings(ESGEngineScalabilitySetti ScalabilityQuality.SetEffectsQuality(ScalabilityValue); ScalabilityQuality.SetFoliageQuality(ScalabilityValue); ScalabilityQuality.SetShadingQuality(ScalabilityValue); -#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 4 ScalabilityQuality.SetLandscapeQuality(ScalabilityValue); -#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 4 */ } else { @@ -275,9 +273,7 @@ bool USGGameUserSettings::FImpl::DoesCurrentSettingsMatch(const ESGEngineScalabi const int32 CurrentEffectQuality = Owner->ScalabilityQuality.EffectsQuality; const int32 CurrentFoliageQuality = Owner->ScalabilityQuality.FoliageQuality; const int32 CurrentShadingQuality = Owner->ScalabilityQuality.ShadingQuality; -#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 4 const int32 CurrentLandscapeQuality = Owner->ScalabilityQuality.LandscapeQuality; -#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 4 */ if (FMath::IsNearlyEqual(CurrentResolutionScaleNormalized, ResolutionScaleNormalized) && CurrentViewDistanceQuality == ScalabilityValue @@ -290,10 +286,7 @@ bool USGGameUserSettings::FImpl::DoesCurrentSettingsMatch(const ESGEngineScalabi && CurrentEffectQuality == ScalabilityValue && CurrentFoliageQuality == ScalabilityValue && CurrentShadingQuality == ScalabilityValue -#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 4 - && CurrentLandscapeQuality == ScalabilityValue -#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 4 */ - ) + && CurrentLandscapeQuality == ScalabilityValue) { return true; } diff --git a/Source/SenseGlove/Private/SenseGlove/GameFramework/SGPawn.cpp b/Source/SenseGlove/Private/SenseGlove/GameFramework/SGPawn.cpp index 835e2a88..7dacfd32 100644 --- a/Source/SenseGlove/Private/SenseGlove/GameFramework/SGPawn.cpp +++ b/Source/SenseGlove/Private/SenseGlove/GameFramework/SGPawn.cpp @@ -2193,13 +2193,7 @@ void ASGPawn::FImpl::RecordHandVelocity(FSGGrabState& GrabState, const float Del { if (GrabState.HandVelocityHistory.IsValidIndex(0)) { - GrabState.HandVelocityHistory.RemoveAt(0, 1, -#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 - EAllowShrinking::No -#else /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ - false -#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ - ); + GrabState.HandVelocityHistory.RemoveAt(0, 1, EAllowShrinking::No); GrabState.HandVelocityHistory.Emplace(MoveTemp(HandVelocity)); } } diff --git a/Source/SenseGlove/Public/SenseGlove/Animation/SGVirtualHandAnimInstanceProxy.h b/Source/SenseGlove/Public/SenseGlove/Animation/SGVirtualHandAnimInstanceProxy.h index ddba6099..39afb44a 100644 --- a/Source/SenseGlove/Public/SenseGlove/Animation/SGVirtualHandAnimInstanceProxy.h +++ b/Source/SenseGlove/Public/SenseGlove/Animation/SGVirtualHandAnimInstanceProxy.h @@ -68,11 +68,7 @@ private: bool bVirtualHandVisible; bool bMarkRenderStateDirty; -#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 FXRHandTrackingState HandTrackingState; -#else /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ - FXRMotionControllerData MotionControllerData; -#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ TMap::SizeType, FName> BoneNamesMap; @@ -109,17 +105,10 @@ protected: return bMarkRenderStateDirty; } -#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 FORCEINLINE const FXRHandTrackingState& GetHandTrackingState() const { return HandTrackingState; } -#else /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ - FORCEINLINE const FXRMotionControllerData& GetMotionControllerData() const - { - return MotionControllerData; - } -#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ FORCEINLINE const TMap::SizeType, FName>& GetBoneNamesMap() const { diff --git a/Source/SenseGlove/Public/SenseGlove/Components/SGVirtualHandComponent.h b/Source/SenseGlove/Public/SenseGlove/Components/SGVirtualHandComponent.h index 3aa91ffe..93e54659 100644 --- a/Source/SenseGlove/Public/SenseGlove/Components/SGVirtualHandComponent.h +++ b/Source/SenseGlove/Public/SenseGlove/Components/SGVirtualHandComponent.h @@ -146,11 +146,7 @@ public: } public: -#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 - virtual void SetAnimInstanceClass(class UClass* NewClass) override; -#else /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ - virtual void SetAnimClass(class UClass* NewClass) override; -#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ + virtual void SetAnimInstanceClass(UClass* NewClass) override; virtual void PostInitProperties() override; @@ -181,12 +177,7 @@ public: bool IsGloveConnected() const; USGHapticGlove* GetConnectedGlove() const; - UE_DEPRECATED(5.5, "Deprecated by UE 5.5 in favor of GetMotionControllerState and GetHandTrackingState") - const FXRMotionControllerData& GetMotionControllerData() const; - -#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 const FXRHandTrackingState& GetHandTrackingState() const; -#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ public: const TArray& GetHandBoneNames() const; diff --git a/Source/SenseGlove/Public/SenseGlove/Components/SGWristTrackerComponent.h b/Source/SenseGlove/Public/SenseGlove/Components/SGWristTrackerComponent.h index 478967b0..713d9b99 100644 --- a/Source/SenseGlove/Public/SenseGlove/Components/SGWristTrackerComponent.h +++ b/Source/SenseGlove/Public/SenseGlove/Components/SGWristTrackerComponent.h @@ -165,10 +165,5 @@ protected: FActorComponentTickFunction* ThisTickFunction); public: - UE_DEPRECATED(5.5, "Deprecated by UE 5.5 in favor of GetMotionControllerState and GetHandTrackingState") - const FXRMotionControllerData& GetMotionControllerData() const; - -#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 const FXRHandTrackingState& GetHandTrackingState() const; -#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ }; \ No newline at end of file diff --git a/Source/SenseGloveDebug/Private/SGDebug/SGDebugVirtualHand.cpp b/Source/SenseGloveDebug/Private/SGDebug/SGDebugVirtualHand.cpp index 9e659f1b..84710348 100644 --- a/Source/SenseGloveDebug/Private/SGDebug/SGDebugVirtualHand.cpp +++ b/Source/SenseGloveDebug/Private/SGDebug/SGDebugVirtualHand.cpp @@ -44,50 +44,6 @@ #include "SGDebug/SGDebugCube.h" #include "SGDebug/SGDebugGizmo.h" -void FSGDebugVirtualHand::Draw( - const UWorld* World, - const FXRMotionControllerData& MotionControllerData, - const FSGVirtualHandDebuggingSettings& Settings) -{ - if (!ensureAlwaysMsgf( - Settings.DrawingMode != ESGDebugVirtualHandDrawingMode::None, - TEXT("Invalid virtual hand drawing mode!"))) - { - return; - } - - if (!ensureAlwaysMsgf( - MotionControllerData.bValid, - TEXT("Invalid motion controller data!"))) - { - return; - } - - if (!ensureAlwaysMsgf( - MotionControllerData.HandKeyPositions.Num() == MotionControllerData.HandKeyRotations.Num(), - TEXT("Mismatched motion controller data positions and rotations!"))) - { - return; - } - - for (TArray::SizeType HandKeyIndex = 0; - HandKeyIndex < MotionControllerData.HandKeyPositions.Num(); ++HandKeyIndex) - { - const FVector& HandKeyPosition{MotionControllerData.HandKeyPositions[HandKeyIndex]}; - const FQuat& HandKeyRotation{MotionControllerData.HandKeyRotations[HandKeyIndex]}; - - if (Settings.DrawingMode == ESGDebugVirtualHandDrawingMode::CubicJoints) - { - FSGDebugCube::Draw(World, HandKeyPosition, HandKeyRotation, Settings.DebugCubicHandSettings); - } - else if (Settings.DrawingMode == ESGDebugVirtualHandDrawingMode::GizmoJoints) - { - FSGDebugGizmo::Draw(World, HandKeyPosition, HandKeyRotation, Settings.DebugGizmoHandSettings); - } - } -} - -#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 void FSGDebugVirtualHand::Draw( const UWorld* World, const FXRHandTrackingState& HandTrackingState, @@ -158,5 +114,4 @@ void FSGDebugVirtualHand::Draw( FSGDebugGizmo::Draw(World, HandKeyLocation, HandKeyRotation, Settings); } -} -#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ \ No newline at end of file +} \ No newline at end of file diff --git a/Source/SenseGloveDebug/Public/SGDebug/SGDebugVirtualHand.h b/Source/SenseGloveDebug/Public/SGDebug/SGDebugVirtualHand.h index 994224c7..ad5063cb 100644 --- a/Source/SenseGloveDebug/Public/SGDebug/SGDebugVirtualHand.h +++ b/Source/SenseGloveDebug/Public/SGDebug/SGDebugVirtualHand.h @@ -48,13 +48,6 @@ class UWorld; class SENSEGLOVEDEBUG_API FSGDebugVirtualHand final { public: - UE_DEPRECATED(5.5, "Deprecated in favor of the variant that accepts FXRHandTrackingState") - static void Draw( - const UWorld* World, - const FXRMotionControllerData& MotionControllerData, - const FSGVirtualHandDebuggingSettings& Settings); - -#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 static void Draw( const UWorld* World, const FXRHandTrackingState& HandTrackingState, @@ -64,7 +57,6 @@ public: const UWorld* World, const FXRHandTrackingState& HandTrackingState, const FSGDebugGizmoSettings& Settings); -#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ public: FSGDebugVirtualHand() = delete; diff --git a/Source/SenseGloveDebugKismet/Private/SGDebugKismet/SGDebugVirtualHandKismetLibrary.cpp b/Source/SenseGloveDebugKismet/Private/SGDebugKismet/SGDebugVirtualHandKismetLibrary.cpp index 611e6125..53bc363e 100644 --- a/Source/SenseGloveDebugKismet/Private/SGDebugKismet/SGDebugVirtualHandKismetLibrary.cpp +++ b/Source/SenseGloveDebugKismet/Private/SGDebugKismet/SGDebugVirtualHandKismetLibrary.cpp @@ -37,18 +37,6 @@ #include "SGDebug/SGDebugVirtualHand.h" -void USGDebugVirtualHandKismetLibrary::Draw_FXRMotionControllerData( - UObject* WorldContextObject, - const FXRMotionControllerData& MotionControllerData, - const FSGVirtualHandDebuggingSettings& Settings) -{ - ensureAlwaysMsgf(WorldContextObject, TEXT("Invalid world context object!")); - - PRAGMA_DISABLE_DEPRECATION_WARNINGS - FSGDebugVirtualHand::Draw(WorldContextObject->GetWorld(), MotionControllerData, Settings); - PRAGMA_ENABLE_DEPRECATION_WARNINGS -} - void USGDebugVirtualHandKismetLibrary::Draw_FXRHandTrackingState( UObject* WorldContextObject, const FXRHandTrackingState& HandTrackingState, diff --git a/Source/SenseGloveDebugKismet/Public/SGDebugKismet/SGDebugVirtualHandKismetLibrary.h b/Source/SenseGloveDebugKismet/Public/SGDebugKismet/SGDebugVirtualHandKismetLibrary.h index f10262aa..b41484b3 100644 --- a/Source/SenseGloveDebugKismet/Public/SGDebugKismet/SGDebugVirtualHandKismetLibrary.h +++ b/Source/SenseGloveDebugKismet/Public/SGDebugKismet/SGDebugVirtualHandKismetLibrary.h @@ -50,13 +50,6 @@ class SENSEGLOVEDEBUGKISMET_API USGDebugVirtualHandKismetLibrary final : public GENERATED_BODY() public: - UFUNCTION(BlueprintCallable, DisplayName="Draw", Category="SenseGlove | Debug | Virtual Hand", - meta=(WorldContext="WorldContextObject")) - static void Draw_FXRMotionControllerData( - UObject* WorldContextObject, - const FXRMotionControllerData& MotionControllerData, - const FSGVirtualHandDebuggingSettings& Settings); - UFUNCTION(BlueprintCallable, DisplayName="Draw", Category="SenseGlove | Debug | Virtual Hand", meta=(WorldContext="WorldContextObject")) static void Draw_FXRHandTrackingState( diff --git a/Source/SenseGloveKismet/Private/SGKismet/SGVirtualHandComponentKismetLibrary.cpp b/Source/SenseGloveKismet/Private/SGKismet/SGVirtualHandComponentKismetLibrary.cpp index 572a3af7..347f8e69 100644 --- a/Source/SenseGloveKismet/Private/SGKismet/SGVirtualHandComponentKismetLibrary.cpp +++ b/Source/SenseGloveKismet/Private/SGKismet/SGVirtualHandComponentKismetLibrary.cpp @@ -110,14 +110,6 @@ USGHapticGlove* UVirtualHandComponentKismetLibrary::GetConnectedGlove( return VirtualHandComponent->GetConnectedGlove(); } -const FXRMotionControllerData& UVirtualHandComponentKismetLibrary::GetMotionControllerData( - USGVirtualHandComponent* VirtualHandComponent) -{ - PRAGMA_DISABLE_DEPRECATION_WARNINGS - return VirtualHandComponent->GetMotionControllerData(); - PRAGMA_ENABLE_DEPRECATION_WARNINGS -} - const FXRHandTrackingState& UVirtualHandComponentKismetLibrary::GetHandTrackingState( USGVirtualHandComponent* VirtualHandComponent) { diff --git a/Source/SenseGloveKismet/Private/SGKismet/SGWristTrackerComponentKismetLibrary.cpp b/Source/SenseGloveKismet/Private/SGKismet/SGWristTrackerComponentKismetLibrary.cpp index 4a513af2..7e4e9f58 100644 --- a/Source/SenseGloveKismet/Private/SGKismet/SGWristTrackerComponentKismetLibrary.cpp +++ b/Source/SenseGloveKismet/Private/SGKismet/SGWristTrackerComponentKismetLibrary.cpp @@ -90,14 +90,6 @@ const FRotator& UWristTrackerComponentKismetLibrary::GetWristRotation( return WristTrackerComponent->GetWristRotation(); } -const FXRMotionControllerData& UWristTrackerComponentKismetLibrary::GetMotionControllerData( - USGWristTrackerComponent* WristTrackerComponent) -{ - PRAGMA_DISABLE_DEPRECATION_WARNINGS - return WristTrackerComponent->GetMotionControllerData(); - PRAGMA_ENABLE_DEPRECATION_WARNINGS -} - const FXRHandTrackingState& UWristTrackerComponentKismetLibrary::GetHandTrackingState( USGWristTrackerComponent* WristTrackerComponent) { diff --git a/Source/SenseGloveKismet/Public/SGKismet/SGVirtualHandComponentKismetLibrary.h b/Source/SenseGloveKismet/Public/SGKismet/SGVirtualHandComponentKismetLibrary.h index 97eb31d3..a744824a 100644 --- a/Source/SenseGloveKismet/Public/SGKismet/SGVirtualHandComponentKismetLibrary.h +++ b/Source/SenseGloveKismet/Public/SGKismet/SGVirtualHandComponentKismetLibrary.h @@ -102,10 +102,6 @@ public: UFUNCTION(BlueprintPure, Category="SenseGlove | Components | Virtual Hand Component") static USGHapticGlove* GetConnectedGlove(const USGVirtualHandComponent* VirtualHandComponent); - UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Virtual Hand Component") - static const FXRMotionControllerData& GetMotionControllerData( - UPARAM(ref) USGVirtualHandComponent* VirtualHandComponent); - UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Virtual Hand Component") static const FXRHandTrackingState& GetHandTrackingState( UPARAM(ref) USGVirtualHandComponent* VirtualHandComponent); diff --git a/Source/SenseGloveKismet/Public/SGKismet/SGWristTrackerComponentKismetLibrary.h b/Source/SenseGloveKismet/Public/SGKismet/SGWristTrackerComponentKismetLibrary.h index 6986ab45..85757dd6 100644 --- a/Source/SenseGloveKismet/Public/SGKismet/SGWristTrackerComponentKismetLibrary.h +++ b/Source/SenseGloveKismet/Public/SGKismet/SGWristTrackerComponentKismetLibrary.h @@ -83,10 +83,6 @@ public: UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Wrist Tracker Component") static const FRotator& GetWristRotation(const USGWristTrackerComponent* WristTrackerComponent); - UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Wrist Tracker Component") - static const FXRMotionControllerData& GetMotionControllerData( - UPARAM(ref) USGWristTrackerComponent* WristTrackerComponent); - UFUNCTION(BlueprintCallable, Category="SenseGlove | Components | Wrist Tracker Component") static const FXRHandTrackingState& GetHandTrackingState( UPARAM(ref) USGWristTrackerComponent* WristTrackerComponent); diff --git a/Source/SenseGloveTracking/Private/SGTracking/SGHMDTracker.cpp b/Source/SenseGloveTracking/Private/SGTracking/SGHMDTracker.cpp index 830ba05c..9947a5e4 100644 --- a/Source/SenseGloveTracking/Private/SGTracking/SGHMDTracker.cpp +++ b/Source/SenseGloveTracking/Private/SGTracking/SGHMDTracker.cpp @@ -37,18 +37,14 @@ #include "Runtime/Launch/Resources/Version.h" -#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 #include "Async/Async.h" #include "Async/Future.h" #include "Async/TaskGraphInterfaces.h" -#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ #include "Engine/Engine.h" #include "IHeadMountedDisplay.h" #include "IXRTrackingSystem.h" -#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 #include "Misc/Optional.h" #include "Misc/Timespan.h" -#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ #include "SGSettings/SGSettings.h" @@ -72,12 +68,6 @@ struct FSGHMDTracker::FStaticImpl void FSGHMDTracker::FStaticImpl::GetHMDMonitorInfo( IHeadMountedDisplay* Device, IHeadMountedDisplay::MonitorInfo& OutMonitorInfo) { -#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION <= 4 - Device->GetHMDMonitorInfo(OutMonitorInfo); - return; -#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION <= 4 */ - -#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 TPromise> Promise; const TFuture> Future{Promise.GetFuture()}; @@ -100,7 +90,6 @@ void FSGHMDTracker::FStaticImpl::GetHMDMonitorInfo( OutMonitorInfo = Result.GetValue(); } } -#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ } FName FSGHMDTracker::GetDeviceName() diff --git a/Source/SenseGloveTracking/Private/SGTracking/SGXRTracker.cpp b/Source/SenseGloveTracking/Private/SGTracking/SGXRTracker.cpp index 41641091..4e88452c 100644 --- a/Source/SenseGloveTracking/Private/SGTracking/SGXRTracker.cpp +++ b/Source/SenseGloveTracking/Private/SGTracking/SGXRTracker.cpp @@ -35,26 +35,20 @@ #include "SGTracking/SGXRTracker.h" -#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 #include "Async/Async.h" #include "Async/Future.h" #include "Async/TaskGraphInterfaces.h" -#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ #include "Containers/Array.h" #include "Containers/Map.h" #include "Engine/Engine.h" #include "Engine/SkeletalMesh.h" #include "Engine/World.h" #include "GameFramework/WorldSettings.h" -#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 4 #include "IOpenXRHMD.h" -#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 4 */ #include "IOpenXRHMDModule.h" #include "IXRTrackingSystem.h" -#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 #include "Misc/Optional.h" #include "Misc/Timespan.h" -#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ #include "OpenXRCore.h" #include "SGCore/SGHapticGlove.h" @@ -1013,237 +1007,6 @@ FTransform FSGXRTracker::FImpl::GetMeshFingerStartBoneRefTransform( return Transform; } -#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION < 7 - -bool FSGXRTracker::GetMotionControllerData( - UObject* WorldContextObject, - const EControllerHand Hand, - FXRMotionControllerData& OutMotionControllerData) -{ - OutMotionControllerData.DeviceName = NAME_None; - OutMotionControllerData.ApplicationInstanceID = FApp::GetInstanceId(); - OutMotionControllerData.DeviceVisualType = EXRVisualType::Controller; - OutMotionControllerData.TrackingStatus = ETrackingStatus::NotTracked; - OutMotionControllerData.HandIndex = Hand; - OutMotionControllerData.bValid = false; - - if (!IsValid(WorldContextObject)) - { - return false; - } - - IXRTrackingSystem* XRTrackingSystem{GEngine ? GEngine->XRSystem.Get() : nullptr}; - if (!XRTrackingSystem) - { - return false; - } - -#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 4 - IOpenXRHMD* OpenXRHMD{XRTrackingSystem->GetIOpenXRHMD()}; -#else /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 4 */ - FOpenXRHMD* OpenXRHMD{static_cast(GEngine->XRSystem.Get())}; -#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 4 */ - if (!OpenXRHMD) - { - return false; - } - - TArray Devices; - const int32 HandIndex = static_cast(Hand); - const bool bGotDevices = - XRTrackingSystem->EnumerateTrackedDevices(Devices, EXRTrackedDeviceType::Controller); - if (bGotDevices && Devices.IsValidIndex(HandIndex)) - { - const XrSession Session{OpenXRHMD->GetSession()}; - if (Session) - { - XrInteractionProfileState Profile = {XR_TYPE_INTERACTION_PROFILE_STATE}; - const XrPath TopLevelUserPath{OpenXRHMD->GetTrackedDevicePath(Devices[HandIndex])}; - const XrResult CurrentInteractionProfile{ - xrGetCurrentInteractionProfile(Session, TopLevelUserPath, &Profile) - }; - if (XR_SUCCEEDED(CurrentInteractionProfile) && Profile.interactionProfile != XR_NULL_PATH) - { - OutMotionControllerData.DeviceName = FOpenXRPath(Profile.interactionProfile); - } - } - } - - static const FName HandTrackerName{"OpenXRHandTracking"}; - TArray HandTrackers = IModularFeatures::Get().GetModularFeatureImplementations( - IHandTracker::GetModularFeatureName()); - IHandTracker* HandTracker{nullptr}; - for (IHandTracker* HandTrackerIterator: HandTrackers) - { - if (!HandTrackerIterator) - { - continue; - } - - const FName DeviceTypeName{HandTrackerIterator->GetHandTrackerDeviceTypeName()}; - if (DeviceTypeName != HandTrackerName) - { - continue; - } - - FSGXRTracker* SGXRTracker{static_cast(HandTrackerIterator)}; - if (!SGXRTracker) - { - continue; - } - - HandTracker = SGXRTracker; - break; - } - - if (Hand == EControllerHand::Left || Hand == EControllerHand::Right) - { - static const FName MotionControllerName("OpenXR"); - TArray MotionControllers{ - IModularFeatures::Get().GetModularFeatureImplementations( - IMotionController::GetModularFeatureName()) - }; - IMotionController* MotionController{nullptr}; - for (IMotionController* MotionControllerIterator: MotionControllers) - { - if (!MotionControllerIterator) - { - continue; - } - - const FName DeviceTypeName{MotionControllerIterator->GetMotionControllerDeviceTypeName()}; - if (DeviceTypeName != MotionControllerName) - { - continue; - } - - MotionController = MotionControllerIterator; - break; - } - - const float WorldToMeters = XRTrackingSystem->GetWorldToMetersScale(); - if (MotionController) - { - const FTransform TrackingToWorld{XRTrackingSystem->GetTrackingToWorldTransform()}; - - { - const FName AimSource{Hand == EControllerHand::Left ? FName{TEXT("LeftAim")} : FName{TEXT("RightAim")}}; - FRotator AimSourceRotation; - FVector AimSourcePosition; - const bool bGotAimOrientationAndPosition = - MotionController->GetControllerOrientationAndPosition( - 0, AimSource, AimSourceRotation, AimSourcePosition, WorldToMeters); - if (bGotAimOrientationAndPosition) - { - OutMotionControllerData.AimPosition = TrackingToWorld.TransformPosition(AimSourcePosition); - OutMotionControllerData.AimRotation = - TrackingToWorld.TransformRotation(AimSourceRotation.Quaternion()); - } - OutMotionControllerData.bValid |= bGotAimOrientationAndPosition; - } - - const FName GripSource{Hand == EControllerHand::Left ? FName{TEXT("LeftGrip")} : FName{TEXT("RightGrip")}}; - { - FRotator GripRotation; - FVector GripPosition; - const bool bGotGripSourceOrientationAndPosition = - MotionController->GetControllerOrientationAndPosition( - 0, GripSource, GripRotation, GripPosition, WorldToMeters); - if (bGotGripSourceOrientationAndPosition) - { - OutMotionControllerData.GripPosition = TrackingToWorld.TransformPosition(GripPosition); - OutMotionControllerData.GripRotation = - TrackingToWorld.TransformRotation(GripRotation.Quaternion()); - } - OutMotionControllerData.bValid |= bGotGripSourceOrientationAndPosition; - } - - { - const FName PalmSource{ - Hand == EControllerHand::Left ? FName{TEXT("LeftPalm")} : FName{TEXT("RightPalm")} - }; - FRotator PalmRotation; - FVector PalmPosition; - const bool bGotPalmOrientationAndPosition = MotionController->GetControllerOrientationAndPosition( - 0, PalmSource, PalmRotation, PalmPosition, WorldToMeters); - if (bGotPalmOrientationAndPosition) - { - OutMotionControllerData.GripPosition = TrackingToWorld.TransformPosition(PalmPosition); - OutMotionControllerData.GripRotation = - TrackingToWorld.TransformRotation(PalmRotation.Quaternion()); - } - OutMotionControllerData.bValid |= bGotPalmOrientationAndPosition; - } - - OutMotionControllerData.TrackingStatus = MotionController->GetControllerTrackingStatus(0, GripSource); - } - - const bool bHandTrackingStateValid = HandTracker && HandTracker->IsHandTrackingStateValid(); - if (bHandTrackingStateValid) - { - OutMotionControllerData.DeviceVisualType = EXRVisualType::Hand; - -#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 - bool bTracked = false; -#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ - - OutMotionControllerData.bValid = HandTracker->GetAllKeypointStates( - Hand, - OutMotionControllerData.HandKeyPositions, - OutMotionControllerData.HandKeyRotations, - OutMotionControllerData.HandKeyRadii -#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 - , bTracked -#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ - ); - -#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 - // Unused! - (void) bTracked; -#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ - -#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 - // TODO - // Begin backward compatibility with the deprecated function, remove this block along with the deprecated - // GetAllKeypointStates (though it should be time to remove this entire function as well)! - if (!OutMotionControllerData.bValid) - { - PRAGMA_DISABLE_DEPRECATION_WARNINGS - OutMotionControllerData.bValid = HandTracker->GetAllKeypointStates( - Hand, - OutMotionControllerData.HandKeyPositions, - OutMotionControllerData.HandKeyRotations, - OutMotionControllerData.HandKeyRadii); - PRAGMA_ENABLE_DEPRECATION_WARNINGS - } - // End backward compability. -#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ - - if (!ensureAlwaysMsgf( - !OutMotionControllerData.bValid - || (OutMotionControllerData.HandKeyPositions.Num() == EHandKeypointCount - && OutMotionControllerData.HandKeyRotations.Num() == EHandKeypointCount - && OutMotionControllerData.HandKeyRadii.Num() == EHandKeypointCount), - TEXT("Corrupted OutMotionControllerData!"))) - { - OutMotionControllerData.bValid = false; - return false; - } - } - } - - if (OutMotionControllerData.bValid) - { - OutMotionControllerData.TrackingStatus = ETrackingStatus::Tracked; - } - - return OutMotionControllerData.bValid; -} - -#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION < 7 */ - -#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 - bool FSGXRTracker::GetMotionControllerState( UObject* WorldContextObject, const EXRSpaceType XRSpaceType, const EControllerHand Hand, const EXRControllerPoseType XRControllerPoseType, @@ -1313,11 +1076,7 @@ bool FSGXRTracker::GetMotionControllerState( return false; } -#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 4 IOpenXRHMD* OpenXRHMD{XRTrackingSystem->GetIOpenXRHMD()}; -#else /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 4 */ - FOpenXRHMD* OpenXRHMD{static_cast(GEngine->XRSystem.Get())}; -#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 4 */ if (!OpenXRHMD) { return false; @@ -1450,11 +1209,7 @@ bool FSGXRTracker::GetHandTrackingState( return false; } -#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 4 IOpenXRHMD* OpenXRHMD{XRTrackingSystem->GetIOpenXRHMD()}; -#else /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 4 */ - FOpenXRHMD* OpenXRHMD{static_cast(GEngine->XRSystem.Get())}; -#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 4 */ if (!OpenXRHMD) { return false; @@ -1486,25 +1241,6 @@ bool FSGXRTracker::GetHandTrackingState( OutHandTrackingState.HandKeyRadii, bTracked); -#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION < 7 - /// TODO - // Begin backward compatibility with the deprecated function, remove this block along with the deprecated - // GetAllKeypointStates. - if (!OutHandTrackingState.bValid) - { - PRAGMA_DISABLE_DEPRECATION_WARNINGS - OutHandTrackingState.bValid = HandTracker->GetAllKeypointStates( - Hand, - OutHandTrackingState.HandKeyLocations, - OutHandTrackingState.HandKeyRotations, - OutHandTrackingState.HandKeyRadii); - PRAGMA_ENABLE_DEPRECATION_WARNINGS - bTracked = OutHandTrackingState.bValid; - // The inability to distinguish this is the reason for the deprecation. - } - // End backward compability. -#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION < 7 */ - if (!ensureAlwaysMsgf( !OutHandTrackingState.bValid || (OutHandTrackingState.HandKeyLocations.Num() == EHandKeypointCount @@ -1526,8 +1262,6 @@ bool FSGXRTracker::GetHandTrackingState( return OutHandTrackingState.bValid; } -#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ - FSGXRTracker::FSGXRTracker(const TSharedRef& InMessageHandler) : Pimpl(TUniquePtr(new FImpl{this}, PimplDeleter)) { @@ -1912,17 +1646,10 @@ bool FSGXRTracker::GetKeypointState( return bGotTransform; } -#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 bool FSGXRTracker::GetAllKeypointStates( const EControllerHand Hand, TArray& OutPositions, TArray& OutRotations, TArray& OutRadii, bool& OutIsTracked) const -#else /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ -bool FSGXRTracker::GetAllKeypointStates( - const EControllerHand Hand, - TArray& OutPositions, TArray& OutRotations, TArray& OutRadii) const -#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5*/ - { if (!IsHandTrackingStateValid()) { @@ -1948,9 +1675,7 @@ bool FSGXRTracker::GetAllKeypointStates( return false; } -#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 OutIsTracked = HandState.bTracked; -#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5*/ // If we ever received poses we return the last data we received, even if not currently tracking to avoid poping // back to (0.0f, 0.0f, 0.0f) and the like. @@ -2216,43 +1941,6 @@ bool FSGXRTracker::FImpl::GetControllerTransform( IMotionController::GetModularFeatureName()) }; -#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION <= 4 - for (const IMotionController* MotionController: MotionControllers) - { - if (!MotionController) - { - continue; - } - - const ETrackingStatus TrackingStatus = MotionController->GetControllerTrackingStatus( - DeviceIndex, PositionalTrackingHardwareMotionSource); - if (TrackingStatus == ETrackingStatus::NotTracked) - { - continue; - } - - const FName DeviceTypeName{MotionController->GetMotionControllerDeviceTypeName()}; - if (DeviceTypeName != TargetPositionalTrackingProviderName) - { - continue; - } - - FRotator Orientation; - FVector Position; - const bool bGotTransform = MotionController->GetControllerOrientationAndPosition( - DeviceIndex, PositionalTrackingHardwareMotionSource, - Orientation, Position, WorldToMetersScale); - if (bGotTransform) - { - OutTransform = FTransform{Orientation, Position}; - bOutMotionSourceHandTracking = false; - bTracked = true; - break; - } - } -#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION <= 4 */ - -#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 TPromise> Promise; const TFuture> Future{Promise.GetFuture()}; @@ -2311,7 +1999,6 @@ bool FSGXRTracker::FImpl::GetControllerTransform( bTracked = true; } } -#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ } if (!bTracked && bFallbackToHandTrackingIfNoGloveDetected) diff --git a/Source/SenseGloveTracking/Public/SGTracking/SGXRTracker.h b/Source/SenseGloveTracking/Public/SGTracking/SGXRTracker.h index f383b9d4..e0496320 100644 --- a/Source/SenseGloveTracking/Public/SGTracking/SGXRTracker.h +++ b/Source/SenseGloveTracking/Public/SGTracking/SGXRTracker.h @@ -55,13 +55,6 @@ class SENSEGLOVETRACKING_API FSGXRTracker final : public IOpenXRExtensionPlugin, public IHandTracker { public: - UE_DEPRECATED(5.5, "Deprecated by UE 5.5 in favor of GetMotionControllerState and GetHandTrackingState") - static bool GetMotionControllerData( - UObject* WorldContextObject, - EControllerHand Hand, - FXRMotionControllerData& OutMotionControllerData); - -#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 static bool GetMotionControllerState( UObject* WorldContextObject, EXRSpaceType XRSpaceType, EControllerHand Hand, EXRControllerPoseType XRControllerPoseType, @@ -70,7 +63,6 @@ public: UObject* WorldContextObject, EXRSpaceType XRSpaceType, EControllerHand Hand, FXRHandTrackingState& OutHandTrackingState); -#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ private: struct FImpl; @@ -165,14 +157,8 @@ public: EControllerHand Hand, EHandKeypoint Keypoint, FTransform& OutTransform, float& OutRadius) const override; -#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 virtual bool GetAllKeypointStates( EControllerHand Hand, TArray& OutPositions, TArray& OutRotations, TArray& OutRadii, bool& OutIsTracked) const override; -#else /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ - virtual bool GetAllKeypointStates( - EControllerHand Hand, - TArray& OutPositions, TArray& OutRotations, TArray& OutRadii) const override; -#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ }; \ No newline at end of file diff --git a/Source/SenseGloveTracking/SenseGloveTracking.Build.cs b/Source/SenseGloveTracking/SenseGloveTracking.Build.cs index e1646e7a..a9a933e3 100644 --- a/Source/SenseGloveTracking/SenseGloveTracking.Build.cs +++ b/Source/SenseGloveTracking/SenseGloveTracking.Build.cs @@ -61,23 +61,6 @@ public class SenseGloveTracking : ModuleRules } ); -#if ! UE_5_4_OR_LATER - string OpenXRHMDPrivateIncludeDir = Path.GetFullPath(Target.RelativeEnginePath); - OpenXRHMDPrivateIncludeDir = Path.Combine(OpenXRHMDPrivateIncludeDir, "Plugins"); - OpenXRHMDPrivateIncludeDir = Path.Combine(OpenXRHMDPrivateIncludeDir, "Runtime"); - OpenXRHMDPrivateIncludeDir = Path.Combine(OpenXRHMDPrivateIncludeDir, "OpenXR"); - OpenXRHMDPrivateIncludeDir = Path.Combine(OpenXRHMDPrivateIncludeDir, "Source"); - OpenXRHMDPrivateIncludeDir = Path.Combine(OpenXRHMDPrivateIncludeDir, "OpenXRHMD"); - OpenXRHMDPrivateIncludeDir = Path.Combine(OpenXRHMDPrivateIncludeDir, "Private"); - - PrivateIncludePaths.AddRange( - new string[] - { - OpenXRHMDPrivateIncludeDir, - } - ); -#endif - PrivateDependencyModuleNames.AddRange( new string[] { diff --git a/Source/SenseGloveTrackingKismet/Private/SGTrackingKismet/SGXRTrackerKismetLibrary.cpp b/Source/SenseGloveTrackingKismet/Private/SGTrackingKismet/SGXRTrackerKismetLibrary.cpp index f4e4cc13..417c50a5 100644 --- a/Source/SenseGloveTrackingKismet/Private/SGTrackingKismet/SGXRTrackerKismetLibrary.cpp +++ b/Source/SenseGloveTrackingKismet/Private/SGTrackingKismet/SGXRTrackerKismetLibrary.cpp @@ -39,14 +39,6 @@ #include "SGTracking/SGXRTracker.h" -bool USGXRTrackerKismetLibrary::GetMotionControllerData( - UObject* WorldContextObject, const EControllerHand Hand, FXRMotionControllerData& OutMotionControllerData) -{ - PRAGMA_DISABLE_DEPRECATION_WARNINGS - return FSGXRTracker::GetMotionControllerData(WorldContextObject, Hand, OutMotionControllerData); - PRAGMA_ENABLE_DEPRECATION_WARNINGS -} - bool USGXRTrackerKismetLibrary::GetMotionControllerState( UObject* WorldContextObject, const EXRSpaceType XRSpaceType, const EControllerHand Hand, const EXRControllerPoseType XRControllerPoseType, diff --git a/Source/SenseGloveTrackingKismet/Public/SGTrackingKismet/SGXRTrackerKismetLibrary.h b/Source/SenseGloveTrackingKismet/Public/SGTrackingKismet/SGXRTrackerKismetLibrary.h index 600b47c0..2ce72e2b 100644 --- a/Source/SenseGloveTrackingKismet/Public/SGTrackingKismet/SGXRTrackerKismetLibrary.h +++ b/Source/SenseGloveTrackingKismet/Public/SGTrackingKismet/SGXRTrackerKismetLibrary.h @@ -51,13 +51,6 @@ class SENSEGLOVETRACKINGKISMET_API USGXRTrackerKismetLibrary final : public USGB GENERATED_BODY() public: - UFUNCTION(BlueprintCallable, Category="SenseGlove | Tracking | XR Tracker", - meta=(WorldContext="WorldContextObject")) - static bool GetMotionControllerData( - UObject* WorldContextObject, - EControllerHand Hand, - FXRMotionControllerData& OutMotionControllerData); - UFUNCTION(BlueprintCallable, Category="SenseGlove | Tracking | XR Tracker", meta=(WorldContext="WorldContextObject")) static bool GetMotionControllerState( diff --git a/Source/SenseGloveUtils/Private/SGUtils/SGEngineUtils.cpp b/Source/SenseGloveUtils/Private/SGUtils/SGEngineUtils.cpp index 2afb6253..d4253e54 100644 --- a/Source/SenseGloveUtils/Private/SGUtils/SGEngineUtils.cpp +++ b/Source/SenseGloveUtils/Private/SGUtils/SGEngineUtils.cpp @@ -55,21 +55,8 @@ UWorld* FSGEngineUtils::GetWorld() if (IsValid(GEditor)) { { - const bool bIsPIE = -#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 - UE::GetPlayInEditorID() -#else /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ - GPlayInEditorID -#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ - != -1; - const int32 WorldPIEInstance = bIsPIE - ? -#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 - UE::GetPlayInEditorID() -#else /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ - GPlayInEditorID -#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */ - : 1; + const bool bIsPIE = UE::GetPlayInEditorID() != -1; + const int32 WorldPIEInstance = bIsPIE ? UE::GetPlayInEditorID() : 1; const FWorldContext* WorldContext{GEditor->GetPIEWorldContext(WorldPIEInstance)}; if (WorldContext) {