Skip to content

Commit

Permalink
Merge pull request #1050 from CesiumGS/update-native
Browse files Browse the repository at this point in the history
Update for breaking changes in cesium-native
  • Loading branch information
kring authored Mar 1, 2023
2 parents 5cfa967 + d7f5940 commit 00ca7a0
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

- Fixed bug that caused a crash when changing the project default token with tilesets active in the level.
- Vertex buffers created for 3D Tiles are now set to use full-precision UV coordinates, avoiding problems in particular with feature IDs.
- Added some missing headers, to avoid compiler errors in non-unity builds.

In addition to the above, this release updates [cesium-native](https://github.com/CesiumGS/cesium-native) from v0.21.3 to v0.22.0. See the [changelog](https://github.com/CesiumGS/cesium-native/blob/main/CHANGES.md) for a complete list of changes in cesium-native.

Expand Down
1 change: 0 additions & 1 deletion Source/CesiumRuntime/Private/Cesium3DTileset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include "CesiumCustomVersion.h"
#include "CesiumGeospatial/Cartographic.h"
#include "CesiumGeospatial/Ellipsoid.h"
#include "CesiumGeospatial/Transforms.h"
#include "CesiumGltf/ImageCesium.h"
#include "CesiumGltf/Ktx2TranscodeTargets.h"
#include "CesiumGltfComponent.h"
Expand Down
1 change: 0 additions & 1 deletion Source/CesiumRuntime/Private/CesiumGeoreference.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include "Camera/PlayerCameraManager.h"
#include "CesiumActors.h"
#include "CesiumCommon.h"
#include "CesiumGeospatial/Transforms.h"
#include "CesiumRuntime.h"
#include "CesiumTransforms.h"
#include "CesiumUtility/Math.h"
Expand Down
10 changes: 6 additions & 4 deletions Source/CesiumRuntime/Private/CesiumGltfComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
#include "CesiumFeatureTexture.h"
#include "CesiumFeatureTextureProperty.h"
#include "CesiumGeometry/Axis.h"
#include "CesiumGeometry/AxisTransforms.h"
#include "CesiumGeometry/Rectangle.h"
#include "CesiumGeometry/Transforms.h"
#include "CesiumGltf/AccessorView.h"
#include "CesiumGltf/ExtensionKhrMaterialsUnlit.h"
#include "CesiumGltf/ExtensionMeshPrimitiveExtFeatureMetadata.h"
Expand Down Expand Up @@ -46,9 +46,11 @@
#include "StaticMeshOperations.h"
#include "StaticMeshResources.h"
#include "UObject/ConstructorHelpers.h"
#include "VecMath.h"
#include "mikktspace.h"
#include <cstddef>
#include <glm/ext/matrix_transform.hpp>
#include <glm/gtc/matrix_inverse.hpp>
#include <glm/gtc/quaternion.hpp>
#include <glm/mat3x3.hpp>
#include <iostream>
Expand Down Expand Up @@ -1508,15 +1510,15 @@ void applyGltfUpAxisTransform(const Model& model, glm::dmat4x4& rootTransform) {
// The default up-axis of glTF is the Y-axis, and no other
// up-axis was specified. Transform the Y-axis to the Z-axis,
// to match the 3D Tiles specification
rootTransform *= CesiumGeometry::AxisTransforms::Y_UP_TO_Z_UP;
rootTransform *= CesiumGeometry::Transforms::Y_UP_TO_Z_UP;
return;
}
const CesiumUtility::JsonValue& gltfUpAxis = gltfUpAxisIt->second;
int gltfUpAxisValue = static_cast<int>(gltfUpAxis.getSafeNumberOrDefault(1));
if (gltfUpAxisValue == static_cast<int>(CesiumGeometry::Axis::X)) {
rootTransform *= CesiumGeometry::AxisTransforms::X_UP_TO_Z_UP;
rootTransform *= CesiumGeometry::Transforms::X_UP_TO_Z_UP;
} else if (gltfUpAxisValue == static_cast<int>(CesiumGeometry::Axis::Y)) {
rootTransform *= CesiumGeometry::AxisTransforms::Y_UP_TO_Z_UP;
rootTransform *= CesiumGeometry::Transforms::Y_UP_TO_Z_UP;
} else if (gltfUpAxisValue == static_cast<int>(CesiumGeometry::Axis::Z)) {
// No transform required
} else {
Expand Down
1 change: 1 addition & 0 deletions Source/CesiumRuntime/Private/CesiumLifetime.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright 2020-2021 CesiumGS, Inc. and Contributors

#include "CesiumLifetime.h"
#include "CesiumRuntime.h"
#include "Engine/StaticMesh.h"
#include "Engine/Texture2D.h"
#include "PhysicsEngine/BodySetup.h"
Expand Down
1 change: 1 addition & 0 deletions Source/CesiumRuntime/Private/CesiumRasterOverlay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "Cesium3DTilesSelection/Tileset.h"
#include "Cesium3DTileset.h"
#include "CesiumAsync/IAssetResponse.h"
#include "CesiumRuntime.h"

FCesiumRasterOverlayLoadFailure OnCesiumRasterOverlayLoadFailure{};

Expand Down
9 changes: 5 additions & 4 deletions Source/CesiumRuntime/Private/GeoTransforms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include "GeoTransforms.h"

#include "CesiumGeospatial/Transforms.h"
#include "CesiumGeospatial/GlobeTransforms.h"
#include "CesiumTransforms.h"
#include "VecMath.h"

Expand Down Expand Up @@ -52,7 +52,7 @@ glm::dquat GeoTransforms::ComputeSurfaceNormalRotationUnreal(

void GeoTransforms::updateTransforms() noexcept {
this->_georeferencedToEcef =
CesiumGeospatial::Transforms::eastNorthUpToFixedFrame(
CesiumGeospatial::GlobeTransforms::eastNorthUpToFixedFrame(
_center,
_ellipsoid);
this->_ecefToGeoreferenced = glm::affineInverse(this->_georeferencedToEcef);
Expand Down Expand Up @@ -166,6 +166,7 @@ glm::dmat3 GeoTransforms::ComputeEastSouthUpToUnreal(

glm::dmat3
GeoTransforms::ComputeEastNorthUpToEcef(const glm::dvec3& ecef) const noexcept {
return glm::dmat3(
CesiumGeospatial::Transforms::eastNorthUpToFixedFrame(ecef, _ellipsoid));
return glm::dmat3(CesiumGeospatial::GlobeTransforms::eastNorthUpToFixedFrame(
ecef,
_ellipsoid));
}
1 change: 0 additions & 1 deletion Source/CesiumRuntime/Private/GlobeAwareDefaultPawn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include "CesiumCustomVersion.h"
#include "CesiumGeoreference.h"
#include "CesiumGeospatial/Ellipsoid.h"
#include "CesiumGeospatial/Transforms.h"
#include "CesiumGlobeAnchorComponent.h"
#include "CesiumRuntime.h"
#include "CesiumTransforms.h"
Expand Down
1 change: 1 addition & 0 deletions Source/CesiumRuntime/Private/ScreenCreditsWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "Math/UnrealMathUtility.h"
#include "Misc/Base64.h"
#include "Rendering/DrawElements.h"
#include "Runtime/Launch/Resources/Version.h"
#include "Slate/SlateGameResources.h"
#include "UObject/ConstructorHelpers.h"
#include "Widgets/DeclarativeSyntaxSupport.h"
Expand Down
1 change: 0 additions & 1 deletion Source/CesiumRuntime/Private/VecMath.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include "CesiumUtility/Math.h"
#include "Math/Quat.h"
#include "Math/RotationMatrix.h"
#include <CesiumGeometry/AxisTransforms.h>
#include <glm/detail/type_quat.hpp>
#include <glm/gtc/quaternion.hpp>
#include <glm/gtx/rotate_vector.hpp>
Expand Down
1 change: 1 addition & 0 deletions Source/CesiumRuntime/Public/CesiumRuntime.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include "CoreMinimal.h"
#include "Modules/ModuleManager.h"
#include <memory>

class ACesium3DTileset;
class UCesiumRasterOverlay;
Expand Down

0 comments on commit 00ca7a0

Please sign in to comment.