diff --git a/Handbook/src/appendix/changelog.md b/Handbook/src/appendix/changelog.md index 0bc08923..869f4576 100644 --- a/Handbook/src/appendix/changelog.md +++ b/Handbook/src/appendix/changelog.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- Added initial support for the upcoming Unreal Engine `5.5` release. Please note that, while the plugin is functional, a few adjustments are still required to address deprecation warnings. Specifically, the `FXRMotionControllerData` struct needs to be replaced with the newly introduced `FXRMotionControllerState` and `FXRHandTrackingState` structs, along with adjustments to adhere to the new hand-tracking API changes. - Added support for Epic Native Toolchain `v23`. ### Fixed diff --git a/Source/SenseGlove/Private/SenseGlove/GameFramework/SGPawn.cpp b/Source/SenseGlove/Private/SenseGlove/GameFramework/SGPawn.cpp index aca14bc8..c0bea071 100644 --- a/Source/SenseGlove/Private/SenseGlove/GameFramework/SGPawn.cpp +++ b/Source/SenseGlove/Private/SenseGlove/GameFramework/SGPawn.cpp @@ -39,6 +39,7 @@ #include "Components/PrimitiveComponent.h" #include "Components/SphereComponent.h" #include "Kismet/KismetMathLibrary.h" +#include "Runtime/Launch/Resources/Version.h" #include "UObject/UObjectGlobals.h" #include "XRDeviceVisualizationComponent.h" @@ -2192,7 +2193,13 @@ void ASGPawn::FImpl::RecordHandVelocity(FSGGrabState& GrabState, const float Del { if (GrabState.HandVelocityHistory.IsValidIndex(0)) { - GrabState.HandVelocityHistory.RemoveAt(0, 1, false); + 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.Emplace(MoveTemp(HandVelocity)); } } diff --git a/Source/SenseGloveUtils/Private/SGUtils/SGEngineUtils.cpp b/Source/SenseGloveUtils/Private/SGUtils/SGEngineUtils.cpp index 304d7b76..17724969 100644 --- a/Source/SenseGloveUtils/Private/SGUtils/SGEngineUtils.cpp +++ b/Source/SenseGloveUtils/Private/SGUtils/SGEngineUtils.cpp @@ -54,8 +54,21 @@ UWorld* FSGEngineUtils::GetWorld() if (IsValid(GEditor)) { { - const bool bIsPIE = GPlayInEditorID != -1; - const int32 WorldPIEInstance = bIsPIE ? GPlayInEditorID : 1; + 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 FWorldContext* WorldContext{GEditor->GetPIEWorldContext(WorldPIEInstance)}; if (WorldContext) {