Skip to content

Commit a85939b

Browse files
committed
Merge branch 'main' into primitive-edges
2 parents b4efa99 + 5bca73f commit a85939b

12 files changed

Lines changed: 393 additions & 103 deletions

.github/workflows/buildLinux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
- name: Removed unneeded packages to gain disk space
4040
run: |
4141
sudo apt update
42-
sudo apt remove google-chrome-stable clang-13 clang-14 clang-15 clang-format-13 clang-format-14 clang-format-15 llvm-13-dev llvm-13-linker-tools llvm-13-runtime llvm-13-tools llvm-13 llvm-14-dev llvm-14-linker-tools llvm-14-runtime llvm-14-tools llvm-14 llvm-15-dev llvm-15-linker-tools llvm-15-runtime llvm-15-tools llvm-15 x11-common xserver-common aspnetcore-runtime-6.0 aspnetcore-runtime-7.0 aspnetcore-runtime-8.0 aspnetcore-runtime-9.0 aspnetcore-targeting-pack-6.0 aspnetcore-targeting-pack-7.0 aspnetcore-targeting-pack-8.0 aspnetcore-targeting-pack-9.0 docker-ce-cli docker-ce dotnet-apphost-pack-6.0 dotnet-apphost-pack-7.0 dotnet-apphost-pack-8.0 dotnet-apphost-pack-9.0 dotnet-host dotnet-hostfxr-6.0 dotnet-hostfxr-7.0 dotnet-hostfxr-8.0 dotnet-hostfxr-9.0 dotnet-runtime-6.0 dotnet-runtime-7.0 dotnet-runtime-8.0 dotnet-runtime-9.0 dotnet-runtime-deps-6.0 dotnet-runtime-deps-7.0 dotnet-runtime-deps-8.0 dotnet-runtime-deps-9.0 dotnet-sdk-6.0 dotnet-sdk-7.0 dotnet-sdk-8.0 dotnet-sdk-9.0 dotnet-targeting-pack-6.0 dotnet-targeting-pack-7.0 dotnet-targeting-pack-8.0 dotnet-targeting-pack-9.0 eatmydata emacsen-common firebird3.0-common-doc firebird3.0-common firefox kubectl mercurial-common mercurial microsoft-edge-stable mssql-tools mysql-client-8.0 mysql-client-core-8.0 mysql-client mysql-common mysql-server-8.0 php8.1 postgresql-14 azure-cli microsoft-edge-stable google-cloud-cli temurin-21-jdk temurin-17-jdk temurin-11-jdk temurin-8-jdk powershell google-cloud-cli-anthoscli mysql-server-core-8.0 containerd.io libllvm15 libllvm14 libllvm13 mono-devel libclang-common-15-dev libclang-common-14-dev libclang-common-13-dev apache2-bin apache2-data apache2-utils apache2 containerd.io cpp-9 cpp-10 cpp-11 cpp-12 cpp docker-ce-cli docker-ce emacsen-common g++-9 g++-10 g++-11 g++-12 g++ gcc-9-base gcc-10-base gcc-11-base gcc-9 gcc-10 gcc-11 gcc-12 gcc gfortran-9 gfortran-10 gfortran-11 gfortran-12 gfortran ruby-dev ruby-full ruby-net-telnet ruby-rubygems ruby-webrick ruby-xmlrpc ruby3.0-dev ruby3.0-doc ruby3.0 ruby rubygems-integration alsa-topology-conf alsa-ucm-conf ant byobu cifs-utils conmon crun debugedit dirmngr imagemagick-6.q16 imagemagick-6-common imagemagick golang-github-containernetworking-plugin-dnsname golang-github-containers-common golang-github-containers-image java-common javascript-common postgresql-client-14 postgresql-client-common postgresql-common vim vim-common vim-runtime vim-tiny tex-common texinfo
42+
sudo apt remove google-chrome-stable clang-13 clang-14 clang-15 clang-format-13 clang-format-14 clang-format-15 llvm-13-dev llvm-13-linker-tools llvm-13-runtime llvm-13-tools llvm-13 llvm-14-dev llvm-14-linker-tools llvm-14-runtime llvm-14-tools llvm-14 llvm-15-dev llvm-15-linker-tools llvm-15-runtime llvm-15-tools llvm-15 x11-common xserver-common aspnetcore-runtime-6.0 aspnetcore-runtime-7.0 aspnetcore-runtime-8.0 aspnetcore-runtime-9.0 aspnetcore-targeting-pack-6.0 aspnetcore-targeting-pack-7.0 aspnetcore-targeting-pack-8.0 aspnetcore-targeting-pack-9.0 docker-ce-cli docker-ce dotnet-apphost-pack-6.0 dotnet-apphost-pack-7.0 dotnet-apphost-pack-8.0 dotnet-apphost-pack-9.0 dotnet-host dotnet-hostfxr-6.0 dotnet-hostfxr-7.0 dotnet-hostfxr-8.0 dotnet-hostfxr-9.0 dotnet-runtime-6.0 dotnet-runtime-7.0 dotnet-runtime-8.0 dotnet-runtime-9.0 dotnet-runtime-deps-6.0 dotnet-runtime-deps-7.0 dotnet-runtime-deps-8.0 dotnet-runtime-deps-9.0 dotnet-sdk-6.0 dotnet-sdk-7.0 dotnet-sdk-8.0 dotnet-sdk-9.0 dotnet-targeting-pack-6.0 dotnet-targeting-pack-7.0 dotnet-targeting-pack-8.0 dotnet-targeting-pack-9.0 eatmydata emacsen-common firebird3.0-common-doc firebird3.0-common firefox kubectl mercurial-common mercurial microsoft-edge-stable mssql-tools mysql-client-8.0 mysql-client-core-8.0 mysql-client mysql-common mysql-server-8.0 php8.1 postgresql-14 azure-cli microsoft-edge-stable google-cloud-cli temurin-21-jdk temurin-17-jdk temurin-11-jdk temurin-8-jdk powershell mysql-server-core-8.0 containerd.io libllvm15 libllvm14 libllvm13 mono-devel libclang-common-15-dev libclang-common-14-dev libclang-common-13-dev apache2-bin apache2-data apache2-utils apache2 containerd.io cpp-9 cpp-10 cpp-11 cpp-12 cpp docker-ce-cli docker-ce emacsen-common g++-9 g++-10 g++-11 g++-12 g++ gcc-9-base gcc-10-base gcc-11-base gcc-9 gcc-10 gcc-11 gcc-12 gcc gfortran-9 gfortran-10 gfortran-11 gfortran-12 gfortran ruby-dev ruby-full ruby-net-telnet ruby-rubygems ruby-webrick ruby-xmlrpc ruby3.0-dev ruby3.0-doc ruby3.0 ruby rubygems-integration alsa-topology-conf alsa-ucm-conf ant byobu cifs-utils conmon crun debugedit dirmngr imagemagick-6.q16 imagemagick-6-common imagemagick golang-github-containernetworking-plugin-dnsname golang-github-containers-common golang-github-containers-image java-common javascript-common postgresql-client-14 postgresql-client-common postgresql-common vim vim-common vim-runtime vim-tiny tex-common texinfo
4343
df -h
4444
sudo rm -rf /usr/local/lib/android || true
4545
sudo rm -rf /usr/share/dotnet || true

CHANGES.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,17 @@
22

33
### ? - ?
44

5+
##### Additions :tada:
6+
7+
- Added `CesiumVectorTilesRasterOverlay` supporting vector data loaded from 3D Tiles tilesets.
8+
- Added support for displaying points in `CesiumGeoJsonDocumentRasterOverlay` and `CesiumVectorTilesRasterOverlay`.
9+
510
##### Fixes :wrench:
611

712
- Added missing includes that introduced compilation failures when building the plugin from source against UE 5.7's bundled clang 20.1.8 toolchain (introduced in v2.25.0 by #1685; binary plugin users were unaffected).
813
- Fixed the case where glTF line primitives caused excessive log spam due to Chaos attempting to generate physics bodies for small non-triangle meshes.
914
- Fixed an incorrect transform that reversed the appearance of data in box voxel tilesets.
15+
- Fixed a crash in `UCesiumGaussianSplatSubsystem::Tick` when `GetPrimaryWorld()` returns `nullptr` (e.g. between PIE shutdown and Standalone-Game launch, or on nDisplay secondary nodes during world bind-up). Restores the validity check ordering that shipped in v2.24.1 and was inadvertently inverted in v2.26.0 (#1841).
1016

1117
### v2.26.0 - 2026-05-01
1218

Source/CesiumRuntime/Private/CesiumGaussianSplatSubsystem.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -229,13 +229,6 @@ void UCesiumGaussianSplatSubsystem::Tick(float DeltaTime) {
229229
}
230230

231231
UWorld* pWorld = GetPrimaryWorld();
232-
// Gaussian splats are purely visual, so we don't need to initialize them if
233-
// we can't render anything. Besides, the Niagara component will fail to
234-
// spawn if either of these conditions are false (they are checked in
235-
// UNiagaraFunctionLibrary::CreateNiagaraSystem).
236-
if (!FApp::CanEverRender() || pWorld->IsNetMode(NM_DedicatedServer)) {
237-
return;
238-
}
239232

240233
if (!IsValid(pWorld)) {
241234
if (IsValid(this->_pNiagaraActor)) {
@@ -245,6 +238,14 @@ void UCesiumGaussianSplatSubsystem::Tick(float DeltaTime) {
245238
return;
246239
}
247240

241+
// Gaussian splats are purely visual, so we don't need to initialize them if
242+
// we can't render anything. Besides, the Niagara component will fail to
243+
// spawn if either of these conditions are false (they are checked in
244+
// UNiagaraFunctionLibrary::CreateNiagaraSystem).
245+
if (!FApp::CanEverRender() || pWorld->IsNetMode(NM_DedicatedServer)) {
246+
return;
247+
}
248+
248249
if (!IsValid(this->_pNiagaraActor) || pWorld != this->_pLastCreatedWorld) {
249250
this->initializeForWorld(*pWorld);
250251
}

Source/CesiumRuntime/Private/CesiumGeoJsonDocumentRasterOverlay.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
#include "CesiumGeometry/QuadtreeTilingScheme.h"
77
#include "CesiumGeospatial/GlobeRectangle.h"
88
#include "CesiumGeospatial/Projection.h"
9-
#include "CesiumRasterOverlays/GeoJsonDocumentRasterOverlay.h"
109
#include "CesiumVectorData/VectorStyle.h"
10+
#include "CesiumVectorOverlays/GeoJsonDocumentRasterOverlay.h"
1111

1212
#include "CesiumRuntime.h"
1313

@@ -52,7 +52,7 @@ UCesiumGeoJsonDocumentRasterOverlay::CreateOverlay(
5252
return nullptr;
5353
}
5454

55-
CesiumRasterOverlays::GeoJsonDocumentRasterOverlayOptions vectorOptions{
55+
CesiumVectorOverlays::GeoJsonDocumentRasterOverlayOptions vectorOptions{
5656
this->DefaultStyle.toNative(),
5757
options.ellipsoid,
5858
this->MipLevels};
@@ -63,7 +63,7 @@ UCesiumGeoJsonDocumentRasterOverlay::CreateOverlay(
6363
this->CesiumIonServer = UCesiumIonServer::GetServerForNewObjects();
6464
}
6565

66-
return std::make_unique<CesiumRasterOverlays::GeoJsonDocumentRasterOverlay>(
66+
return std::make_unique<CesiumVectorOverlays::GeoJsonDocumentRasterOverlay>(
6767
TCHAR_TO_UTF8(*this->MaterialLayerKey),
6868
wrapLoaderFuture(
6969
this,
@@ -85,7 +85,7 @@ UCesiumGeoJsonDocumentRasterOverlay::CreateOverlay(
8585
headers.push_back({TCHAR_TO_UTF8(*k), TCHAR_TO_UTF8(*v)});
8686
}
8787

88-
return std::make_unique<CesiumRasterOverlays::GeoJsonDocumentRasterOverlay>(
88+
return std::make_unique<CesiumVectorOverlays::GeoJsonDocumentRasterOverlay>(
8989
TCHAR_TO_UTF8(*this->MaterialLayerKey),
9090
wrapLoaderFuture(
9191
this,
@@ -102,7 +102,7 @@ UCesiumGeoJsonDocumentRasterOverlay::CreateOverlay(
102102
this->OnDocumentLoaded.Execute(this->GeoJsonDocument);
103103
}
104104

105-
return std::make_unique<CesiumRasterOverlays::GeoJsonDocumentRasterOverlay>(
105+
return std::make_unique<CesiumVectorOverlays::GeoJsonDocumentRasterOverlay>(
106106
getAsyncSystem(),
107107
TCHAR_TO_UTF8(*this->MaterialLayerKey),
108108
this->GeoJsonDocument.GetDocument(),

Source/CesiumRuntime/Private/CesiumGltfComponent.cpp

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3518,7 +3518,7 @@ ConstructedPrimitiveComponent createPrimitiveComponent(
35183518
const TSharedPtr<FCesiumPrimitiveFeatures>& pInstanceFeatures) {
35193519
ConstructedPrimitiveComponent result;
35203520

3521-
if (!instanceTransforms.empty()) {
3521+
if (instanceTransforms.size()) {
35223522
auto* pInstancedComponent =
35233523
NewObject<UCesiumGltfInstancedComponent>(pGltf, componentName);
35243524

@@ -3536,35 +3536,35 @@ ConstructedPrimitiveComponent createPrimitiveComponent(
35363536
}
35373537
result.pAsMeshComponent = pInstancedComponent;
35383538
result.pAsCesiumPrimitive = pInstancedComponent;
3539-
}
3540-
3541-
switch (primitiveMode) {
3542-
case CesiumGltf::MeshPrimitive::Mode::POINTS: {
3543-
auto* pPointMesh =
3544-
NewObject<UCesiumGltfPointsComponent>(pGltf, componentName);
3545-
pPointMesh->UsesAdditiveRefinement =
3546-
tile.getRefine() == Cesium3DTilesSelection::TileRefine::Add;
3547-
pPointMesh->GeometricError = static_cast<float>(tile.getGeometricError());
3548-
pPointMesh->Dimensions = loadResult.dimensions;
3549-
result.pAsMeshComponent = pPointMesh;
3550-
result.pAsCesiumPrimitive = pPointMesh;
3551-
break;
3552-
}
3553-
case CesiumGltf::MeshPrimitive::Mode::LINES:
3554-
case CesiumGltf::MeshPrimitive::Mode::LINE_LOOP:
3555-
case CesiumGltf::MeshPrimitive::Mode::LINE_STRIP: {
3556-
auto* pLinesComponent =
3557-
NewObject<UCesiumGltfLinesComponent>(pGltf, componentName);
3558-
result.pAsMeshComponent = pLinesComponent;
3559-
result.pAsCesiumPrimitive = pLinesComponent;
3560-
break;
3561-
}
3562-
default:
3563-
auto* pPrimitiveComponent =
3564-
NewObject<UCesiumGltfPrimitiveComponent>(pGltf, componentName);
3565-
result.pAsMeshComponent = pPrimitiveComponent;
3566-
result.pAsCesiumPrimitive = pPrimitiveComponent;
3567-
break;
3539+
} else {
3540+
switch (primitiveMode) {
3541+
case CesiumGltf::MeshPrimitive::Mode::POINTS: {
3542+
auto* pPointMesh =
3543+
NewObject<UCesiumGltfPointsComponent>(pGltf, componentName);
3544+
pPointMesh->UsesAdditiveRefinement =
3545+
tile.getRefine() == Cesium3DTilesSelection::TileRefine::Add;
3546+
pPointMesh->GeometricError = static_cast<float>(tile.getGeometricError());
3547+
pPointMesh->Dimensions = loadResult.dimensions;
3548+
result.pAsMeshComponent = pPointMesh;
3549+
result.pAsCesiumPrimitive = pPointMesh;
3550+
break;
3551+
}
3552+
case CesiumGltf::MeshPrimitive::Mode::LINES:
3553+
case CesiumGltf::MeshPrimitive::Mode::LINE_LOOP:
3554+
case CesiumGltf::MeshPrimitive::Mode::LINE_STRIP: {
3555+
auto* pLinesComponent =
3556+
NewObject<UCesiumGltfLinesComponent>(pGltf, componentName);
3557+
result.pAsMeshComponent = pLinesComponent;
3558+
result.pAsCesiumPrimitive = pLinesComponent;
3559+
break;
3560+
}
3561+
default:
3562+
auto* pPrimitiveComponent =
3563+
NewObject<UCesiumGltfPrimitiveComponent>(pGltf, componentName);
3564+
result.pAsMeshComponent = pPrimitiveComponent;
3565+
result.pAsCesiumPrimitive = pPrimitiveComponent;
3566+
break;
3567+
}
35683568
}
35693569

35703570
CESIUM_ASSERT(result.pAsMeshComponent && result.pAsCesiumPrimitive);
@@ -3654,7 +3654,7 @@ UStaticMesh* createStaticMesh(
36543654
TUniquePtr<FStaticMeshRenderData>&& pRenderData) {
36553655
TRACE_CPUPROFILER_EVENT_SCOPE(Cesium::SetupMesh)
36563656

3657-
auto pStaticMesh = NewObject<UStaticMesh>(pMeshComponent, componentName);
3657+
auto* pStaticMesh = NewObject<UStaticMesh>(pMeshComponent, componentName);
36583658
// Unreal will crash trying to generate ray tracing information for a
36593659
// static mesh without triangles (and it doesn't make sense anyways!)
36603660
switch (primitiveMode) {

Source/CesiumRuntime/Private/CesiumGltfInstancedComponent.cpp

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ void UCesiumGltfInstancedComponent::BeginDestroy() {
2828
// Clear everything we can in order to reduce memory usage, because this
2929
// UObject might not actually get deleted by the garbage collector until
3030
// much later.
31-
ICesiumPrimitive* pCesiumPrimitive = Cast<ICesiumPrimitive>(this);
32-
pCesiumPrimitive->getPrimitiveData().destroy();
31+
this->getPrimitiveData().destroy();
3332

3433
if (UMaterialInstanceDynamic* pMaterial =
3534
Cast<UMaterialInstanceDynamic>(this->GetMaterial(0))) {
@@ -49,15 +48,15 @@ void UCesiumGltfInstancedComponent::BeginDestroy() {
4948
FBoxSphereBounds UCesiumGltfInstancedComponent::CalcBounds(
5049
const FTransform& LocalToWorld) const {
5150
const CesiumPrimitiveData& primitiveData = this->getPrimitiveData();
52-
if (!primitiveData.boundingVolume) {
53-
return Super::CalcBounds(LocalToWorld);
54-
}
5551

56-
std::optional<FBoxSphereBounds> maybeBounds = std::visit(
57-
CalcBoundsOperation{
58-
LocalToWorld,
59-
primitiveData.highPrecisionNodeTransform},
60-
*primitiveData.boundingVolume);
52+
std::optional<FBoxSphereBounds> maybeBounds = std::nullopt;
53+
if (primitiveData.boundingVolume) {
54+
maybeBounds = std::visit(
55+
CalcBoundsOperation{
56+
LocalToWorld,
57+
primitiveData.highPrecisionNodeTransform},
58+
*primitiveData.boundingVolume);
59+
}
6160
return maybeBounds.value_or(Super::CalcBounds(LocalToWorld));
6261
}
6362

Source/CesiumRuntime/Private/CesiumGltfPrimitiveComponent.cpp

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ void UCesiumGltfPrimitiveComponent::BeginDestroy() {
2929
// Clear everything we can in order to reduce memory usage, because this
3030
// UObject might not actually get deleted by the garbage collector until
3131
// much later.
32-
ICesiumPrimitive* pCesiumPrimitive = Cast<ICesiumPrimitive>(this);
33-
pCesiumPrimitive->getPrimitiveData().destroy();
32+
this->getPrimitiveData().destroy();
3433

3534
if (UMaterialInstanceDynamic* pMaterial =
3635
Cast<UMaterialInstanceDynamic>(this->GetMaterial(0))) {
@@ -50,15 +49,15 @@ void UCesiumGltfPrimitiveComponent::BeginDestroy() {
5049
FBoxSphereBounds UCesiumGltfPrimitiveComponent::CalcBounds(
5150
const FTransform& LocalToWorld) const {
5251
const CesiumPrimitiveData& primitiveData = this->getPrimitiveData();
53-
if (!primitiveData.boundingVolume) {
54-
return Super::CalcBounds(LocalToWorld);
55-
}
5652

57-
std::optional<FBoxSphereBounds> maybeBounds = std::visit(
58-
CalcBoundsOperation{
59-
LocalToWorld,
60-
primitiveData.highPrecisionNodeTransform},
61-
*primitiveData.boundingVolume);
53+
std::optional<FBoxSphereBounds> maybeBounds = std::nullopt;
54+
if (primitiveData.boundingVolume) {
55+
maybeBounds = std::visit(
56+
CalcBoundsOperation{
57+
LocalToWorld,
58+
primitiveData.highPrecisionNodeTransform},
59+
*primitiveData.boundingVolume);
60+
}
6261
return maybeBounds.value_or(Super::CalcBounds(LocalToWorld));
6362
}
6463

0 commit comments

Comments
 (0)