diff --git a/CHANGES.md b/CHANGES.md index cbcccc6b5..768e4c916 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,8 +2,10 @@ ### ? - ? -#### Fixes :wrench: +##### Fixes :wrench: +- Fixed a bug that could cause a `bad_any_cast` exception when trying to access glTF extensions on non-Windows platforms. This commonly popped up when loading tilesets with metadata. +- Fixed a bug that caused the `GetInteger64` functions on `CesiumMetadataValue`, `CesiumPropertyArray`, and `CesiumPropertyTableProperty` to always return the default value on non-Windows platforms. - Fixed issue with `UCesiumGlobeAnchorComponent::GetEllipsoid` that caused compilation errors on some machines. ### v2.7.0 - 2024-07-01 diff --git a/Source/CesiumRuntime/Private/CesiumMetadataValue.cpp b/Source/CesiumRuntime/Private/CesiumMetadataValue.cpp index 44580b035..140dce068 100644 --- a/Source/CesiumRuntime/Private/CesiumMetadataValue.cpp +++ b/Source/CesiumRuntime/Private/CesiumMetadataValue.cpp @@ -91,9 +91,9 @@ int64 UCesiumMetadataValueBlueprintLibrary::GetInteger64( int64 DefaultValue) { return std::visit( [DefaultValue](auto value) -> int64 { - return CesiumGltf::MetadataConversions::convert( - value) - .value_or(DefaultValue); + return CesiumGltf::MetadataConversions:: + convert(value) + .value_or(DefaultValue); }, Value._value); } diff --git a/Source/CesiumRuntime/Private/CesiumPropertyArrayBlueprintLibrary.cpp b/Source/CesiumRuntime/Private/CesiumPropertyArrayBlueprintLibrary.cpp index f96fa4181..e9d6d6ec7 100644 --- a/Source/CesiumRuntime/Private/CesiumPropertyArrayBlueprintLibrary.cpp +++ b/Source/CesiumRuntime/Private/CesiumPropertyArrayBlueprintLibrary.cpp @@ -120,9 +120,9 @@ int64 UCesiumPropertyArrayBlueprintLibrary::GetInteger64( return defaultValue; } auto value = v[index]; - return CesiumGltf::MetadataConversions::convert( - value) - .value_or(defaultValue); + return CesiumGltf::MetadataConversions:: + convert(value) + .value_or(defaultValue); }, array._value); } diff --git a/Source/CesiumRuntime/Private/CesiumPropertyTableProperty.cpp b/Source/CesiumRuntime/Private/CesiumPropertyTableProperty.cpp index a3aba9f56..fa8a6117c 100644 --- a/Source/CesiumRuntime/Private/CesiumPropertyTableProperty.cpp +++ b/Source/CesiumRuntime/Private/CesiumPropertyTableProperty.cpp @@ -969,7 +969,7 @@ int64 UCesiumPropertyTablePropertyBlueprintLibrary::GetInteger64( auto maybeValue = v.get(FeatureID); if (maybeValue) { auto value = *maybeValue; - return CesiumGltf::MetadataConversions:: + return CesiumGltf::MetadataConversions:: convert(value) .value_or(DefaultValue); } diff --git a/extern/CMakeLists.txt b/extern/CMakeLists.txt index c38c16a4d..b31a54cea 100644 --- a/extern/CMakeLists.txt +++ b/extern/CMakeLists.txt @@ -54,11 +54,11 @@ set(CMAKE_RELWITHDEBINFO_POSTFIX ${CESIUM_RELEASE_POSTFIX}) # On Mac and Linux, Unreal uses -fvisibility-ms-compat. # On Android, it uses -fvisibility=hidden if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-ms-compat -fvisibility-inlines-hidden") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-ms-compat -fvisibility-inlines-hidden -fno-rtti") elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Android") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden -fno-rtti") elseif (${CMAKE_SYSTEM_NAME} STREQUAL "iOS") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fno-rtti") elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") # Unreal Engine adds /Zp8 in 64-bit Windows builds to align structs to 8 bytes instead of the # default of 16 bytes. There's this nice note in the documentation for that option: