diff --git a/Source/CesiumRuntime/Private/CesiumEncodedFeaturesMetadata.h b/Source/CesiumRuntime/Private/CesiumEncodedFeaturesMetadata.h index 0bb838505..45f3ece2b 100644 --- a/Source/CesiumRuntime/Private/CesiumEncodedFeaturesMetadata.h +++ b/Source/CesiumRuntime/Private/CesiumEncodedFeaturesMetadata.h @@ -11,6 +11,7 @@ #include "Templates/SharedPointer.h" #include "Templates/UniquePtr.h" #include +#include #include struct FCesiumFeatureIdSet; diff --git a/Source/CesiumRuntime/Private/CesiumGltfComponent.cpp b/Source/CesiumRuntime/Private/CesiumGltfComponent.cpp index b2781a59a..758059658 100644 --- a/Source/CesiumRuntime/Private/CesiumGltfComponent.cpp +++ b/Source/CesiumRuntime/Private/CesiumGltfComponent.cpp @@ -1715,6 +1715,12 @@ static void loadPrimitive( LODResources.bHasReversedIndices = false; LODResources.bHasReversedDepthOnlyIndices = false; +#if ENGINE_VERSION_5_5_OR_HIGHER + // UE 5.5 requires that we do this in order to avoid a crash when ray tracing + // is enabled. + RenderData->InitializeRayTracingRepresentationFromRenderingLODs(); +#endif + primitiveResult.meshIndex = options.pMeshOptions->meshIndex; primitiveResult.primitiveIndex = options.primitiveIndex; primitiveResult.RenderData = std::move(RenderData); diff --git a/Source/CesiumRuntime/Public/CesiumCommon.h b/Source/CesiumRuntime/Public/CesiumCommon.h index 633570315..17901acb2 100644 --- a/Source/CesiumRuntime/Public/CesiumCommon.h +++ b/Source/CesiumRuntime/Public/CesiumCommon.h @@ -4,6 +4,8 @@ #include "Runtime/Launch/Resources/Version.h" +#define ENGINE_VERSION_5_5_OR_HIGHER \ + (ENGINE_MAJOR_VERSION > 5 || ENGINE_MINOR_VERSION >= 5) #define ENGINE_VERSION_5_4_OR_HIGHER \ (ENGINE_MAJOR_VERSION > 5 || ENGINE_MINOR_VERSION >= 4) #define ENGINE_VERSION_5_3_OR_HIGHER \