Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/shared-assets' into shared-asset…
Browse files Browse the repository at this point in the history
…s-kring
  • Loading branch information
kring committed Oct 2, 2024
2 parents b03d1f6 + 0f341f0 commit 83a24d1
Show file tree
Hide file tree
Showing 7 changed files with 86 additions and 17 deletions.
4 changes: 3 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Change Log

### Next version (not released yet)
### v2.9.0 - 2024-10-01

##### Additions :tada:

Expand All @@ -11,6 +11,8 @@
- Drastically reduced tile mesh memory usage in UE 5.3 and 5.4 by working around a bug that causes those engine versions to add more texture coordinate sets than necessary.
- Fixed a bug where the `scale`, `noData`, and `default` values of a property in `EXT_strutural_metadata` were not correctly passed to the tileset's material.

This release updates [cesium-native](https://github.com/CesiumGS/cesium-native) from v0.39.0 to v0.40.1. See the [changelog](https://github.com/CesiumGS/cesium-native/blob/main/CHANGES.md) for a complete list of changes in cesium-native.

### v2.8.0 - 2024-09-02

##### Additions :tada:
Expand Down
4 changes: 2 additions & 2 deletions CesiumForUnreal.uplugin
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"FileVersion": 3,
"Version": 63,
"VersionName": "2.8.0",
"Version": 64,
"VersionName": "2.9.0",
"FriendlyName": "Cesium for Unreal",
"Description": "Unlock the 3D geospatial ecosystem in Unreal Engine with real-world 3D content and a high accuracy full-scale WGS84 globe.",
"Category": "Geospatial",
Expand Down
34 changes: 23 additions & 11 deletions Source/CesiumRuntime/Private/Cesium3DTileset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,17 +144,29 @@ void ACesium3DTileset::SampleHeightMostDetailed(
position.Z));
}

CesiumAsync::Future<Cesium3DTilesSelection::SampleHeightResult> future =
this->_pTileset
? this->_pTileset->sampleHeightMostDetailed(positions)
: getAsyncSystem().createResolvedFuture(
Cesium3DTilesSelection::SampleHeightResult{
std::move(positions),
std::vector<bool>(positions.size(), false),
{"Could not sample heights from tileset because it has not "
"been created."}});

std::move(future).thenImmediately(
auto sampleHeights = [this, &positions]() mutable {
if (this->_pTileset) {
return this->_pTileset->sampleHeightMostDetailed(positions)
.catchImmediately([positions = std::move(positions)](
std::exception&& exception) mutable {
std::vector<bool> sampleSuccess(positions.size(), false);
return Cesium3DTilesSelection::SampleHeightResult{
std::move(positions),
std::move(sampleSuccess),
{exception.what()}};
});
} else {
std::vector<bool> sampleSuccess(positions.size(), false);
return getAsyncSystem().createResolvedFuture(
Cesium3DTilesSelection::SampleHeightResult{
std::move(positions),
std::move(sampleSuccess),
{"Could not sample heights from tileset because it has not "
"been created."}});
}
};

sampleHeights().thenImmediately(
[this, OnHeightsSampled = std::move(OnHeightsSampled)](
Cesium3DTilesSelection::SampleHeightResult&& result) {
if (!IsValid(this))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
namespace Cesium {

FString SceneGenerationContext::testIonToken(
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI4NDFlMWY2Ny01Y2MxLTRkNTMtOGJhNS04NzQzNGM1Mjg2YTkiLCJpZCI6MjU5LCJpYXQiOjE3MjUyNjIwMzR9.enFkJqTnXmbEkGeQjLzyw2iPEtS2vq6qyXAqQnhCzTg");
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIwNzA3YWIzNS0xMjI5LTQ3MWEtOTgyNS05OTk0YThlOTE4NzMiLCJpZCI6MjU5LCJpYXQiOjE3Mjc3MzgxNjJ9.vll2Xe-NPuNPiC0KSe8uN7hgG-ldlalcXfdDBxxDkXY");

void SceneGenerationContext::setCommonProperties(
const FVector& origin,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,4 +298,59 @@ void FSampleHeightMostDetailedSpec::Define() {
}));
});
});

Describe("Broken tileset", [this]() {
BeforeEach([this]() { CesiumTestHelpers::pushAllowTickInEditor(); });

AfterEach(EAsyncExecution::TaskGraphMainThread, [this]() {
CesiumTestHelpers::popAllowTickInEditor();
});

LatentIt(
"",
EAsyncExecution::TaskGraphMainThread,
[this](const FDoneDelegate& done) {
// Two slightly different error messages will occur, depending on
// whether there's a web server running on localhost.
this->AddExpectedError(
TEXT("(Errors when loading)|(error occurred)"));

UWorld* pWorld = CesiumTestHelpers::getGlobalWorldContext();

ACesium3DTileset* pTileset = pWorld->SpawnActor<ACesium3DTileset>();
pTileset->SetTilesetSource(ETilesetSource::FromUrl);
pTileset->SetUrl("http://localhost/notgonnawork");

pTileset->SampleHeightMostDetailed(
{FVector(-105.1, 40.1, 1.0)},
FCesiumSampleHeightMostDetailedCallback::CreateLambda(
[this, done](
ACesium3DTileset* pTileset,
const TArray<FCesiumSampleHeightResult>& result,
const TArray<FString>& warnings) {
TestEqual("Number of results", result.Num(), 1);
TestEqual("Number of warnings", warnings.Num(), 1);
TestFalse("SampleSuccess", result[0].SampleSuccess);
TestEqual(
"Longitude",
result[0].LongitudeLatitudeHeight.X,
-105.1,
1e-12);
TestEqual(
"Latitude",
result[0].LongitudeLatitudeHeight.Y,
40.1,
1e-12);
TestEqual(
"Height",
result[0].LongitudeLatitudeHeight.Z,
1.0,
1e-12);
TestTrue(
"Error message",
warnings[0].Contains(TEXT("failed to load")));
done.ExecuteIfBound();
}));
});
});
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cesium-unreal",
"version": "2.8.0",
"version": "2.9.0",
"description": "Cesium for Unreal",
"main": "index.js",
"directories": {
Expand Down

0 comments on commit 83a24d1

Please sign in to comment.