address a few ue 5.5 deprecation warnings

This commit is contained in:
Mamadou Babaei
2024-10-11 12:30:22 +02:00
parent 50599d2832
commit 1d9ca12cf8
3 changed files with 24 additions and 3 deletions
+1
View File
@@ -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
@@ -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));
}
}
@@ -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)
{