Skip to content

Commit a7c7ccc

Browse files
committed
Merge from vector-overlay
2 parents e33520d + 9542362 commit a7c7ccc

20 files changed

+1593
-11
lines changed

CHANGES.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Change Log {#changes}
22

3+
### ? - ?
4+
5+
##### Fixes :wrench:
6+
7+
- Worked around an Unreal Engine limitation that prevented collisions and line traces from working correctly for tilesets with a very small scale factor.
8+
- Add a missing include for `GEngine` when packaging from source, introduced in *v2.16.0*.
9+
- Fixed a bug in UCesiumFeaturesMetadataComponent where multiple references to same feature ID set would cause improper encoding of its feature IDs.
10+
311
### v2.16.0 - 2025-05-01
412

513
##### Additions :tada:
2.64 KB
Binary file not shown.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"asset": { "version": "1.0" },
3+
"root": {
4+
"boundingVolume": {
5+
"sphere": [
6+
0,0,0,200000
7+
]
8+
},
9+
"children": [],
10+
"content": { "uri": "BigCube.glb" },
11+
"geometricError": 0.0,
12+
"refine": "REPLACE"
13+
}
14+
}

Source/CesiumRuntime/CesiumRuntime.Build.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ public CesiumRuntime(ReadOnlyTargetRules Target) : base(Target)
9191
"DeveloperSettings",
9292
"UMG",
9393
"Renderer",
94-
"OpenSSL"
94+
"OpenSSL",
95+
"Json",
96+
"JsonUtilities"
9597
}
9698
);
9799

Source/CesiumRuntime/Private/CesiumCreditSystem.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "CesiumCreditSystemBPLoader.h"
66
#include "CesiumRuntime.h"
77
#include "CesiumUtility/CreditSystem.h"
8+
#include "Engine/Engine.h"
89
#include "Engine/World.h"
910
#include "EngineUtils.h"
1011
#include "ScreenCreditsWidget.h"
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
#include "CesiumGeoJsonDocument.h"
2+
#include "CesiumRuntime.h"
3+
4+
#include "CesiumUtility/Result.h"
5+
6+
#include <span>
7+
8+
bool UCesiumGeoJsonDocumentBlueprintLibrary::LoadGeoJsonFromString(
9+
const FString& InString,
10+
FCesiumGeoJsonDocument& OutVectorDocument) {
11+
const std::string str = TCHAR_TO_UTF8(*InString);
12+
std::span<const std::byte> bytes(
13+
reinterpret_cast<const std::byte*>(str.data()),
14+
str.size());
15+
CesiumUtility::Result<
16+
CesiumUtility::IntrusivePointer<CesiumVectorData::GeoJsonDocument>>
17+
documentResult = CesiumVectorData::GeoJsonDocument::fromGeoJson(bytes);
18+
19+
if (!documentResult.errors.errors.empty()) {
20+
documentResult.errors.logError(
21+
spdlog::default_logger(),
22+
"Errors while loading GeoJSON from string");
23+
}
24+
25+
if (!documentResult.errors.warnings.empty()) {
26+
documentResult.errors.logWarning(
27+
spdlog::default_logger(),
28+
"Warnings while loading GeoJSON from string");
29+
}
30+
31+
if (documentResult.pValue) {
32+
OutVectorDocument =
33+
FCesiumGeoJsonDocument(std::move(documentResult.pValue));
34+
return true;
35+
}
36+
37+
return false;
38+
}
39+
40+
FCesiumGeoJsonObject UCesiumGeoJsonDocumentBlueprintLibrary::GetRootObject(
41+
const FCesiumGeoJsonDocument& InVectorDocument) {
42+
if (!InVectorDocument._document) {
43+
return FCesiumGeoJsonObject();
44+
}
45+
46+
return FCesiumGeoJsonObject(
47+
InVectorDocument._document,
48+
&InVectorDocument._document->getRootObject());
49+
}
50+
51+
UCesiumLoadVectorDocumentFromIonAsyncAction*
52+
UCesiumLoadVectorDocumentFromIonAsyncAction::LoadFromIon(
53+
int64 AssetId,
54+
const FString& IonAccessToken,
55+
const FString& IonAssetEndpointUrl) {
56+
UCesiumLoadVectorDocumentFromIonAsyncAction* pAction =
57+
NewObject<UCesiumLoadVectorDocumentFromIonAsyncAction>();
58+
pAction->AssetId = AssetId;
59+
pAction->IonAccessToken = IonAccessToken;
60+
pAction->IonAssetEndpointUrl = IonAssetEndpointUrl;
61+
return pAction;
62+
}
63+
64+
void UCesiumLoadVectorDocumentFromIonAsyncAction::Activate() {
65+
CesiumVectorData::GeoJsonDocument::fromCesiumIonAsset(
66+
getAsyncSystem(),
67+
getAssetAccessor(),
68+
this->AssetId,
69+
TCHAR_TO_UTF8(*this->IonAccessToken),
70+
TCHAR_TO_UTF8(*this->IonAssetEndpointUrl))
71+
.thenInMainThread(
72+
[Callback = this->OnLoadResult](
73+
CesiumUtility::Result<CesiumUtility::IntrusivePointer<
74+
CesiumVectorData::GeoJsonDocument>>&& result) {
75+
if (result.errors.hasErrors()) {
76+
result.errors.logError(
77+
spdlog::default_logger(),
78+
"Errors loading GeoJSON:");
79+
result.errors.logWarning(
80+
spdlog::default_logger(),
81+
"Warnings loading GeoJSON:");
82+
}
83+
84+
if (result.pValue) {
85+
Callback.Broadcast(
86+
true,
87+
FCesiumGeoJsonDocument(MoveTemp(result.pValue)));
88+
} else {
89+
Callback.Broadcast(false, {});
90+
}
91+
});
92+
}

0 commit comments

Comments
 (0)