Skip to content

Commit 35eba16

Browse files
committed
Added an optional glTF model post-processing stage
after the tile loading step, before the tile can be displayed
1 parent 6cdf329 commit 35eba16

File tree

4 files changed

+22
-2
lines changed

4 files changed

+22
-2
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
##### Additions :tada:
66

77
- Added support for `TRIANGLE_FAN` primitives in tile meshes.
8+
- Added an optional glTF model post-processing stage after the tile loading step, before the tile can be displayed.
89

910
##### Fixes :wrench:
1011

Source/CesiumRuntime/Private/Cesium3DTileset.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,10 @@ void ACesium3DTileset::LoadTileset() {
992992
->EnableExperimentalOcclusionCullingFeature &&
993993
this->EnableOcclusionCulling && this->BoundingVolumePoolComponent)
994994
? this->BoundingVolumePoolComponent->getPool()
995-
: nullptr};
995+
: nullptr,
996+
{},
997+
_gltfTuner
998+
};
996999

9971000
this->_startTime = std::chrono::high_resolution_clock::now();
9981001

@@ -2325,3 +2328,8 @@ void ACesium3DTileset::RuntimeSettingsChanged(
23252328
}
23262329
}
23272330
#endif
2331+
2332+
void ACesium3DTileset::SetGltfTuner(
2333+
const std::shared_ptr<Cesium3DTilesSelection::GltfTuner>& tuner) {
2334+
_gltfTuner = tuner;
2335+
}

Source/CesiumRuntime/Public/Cesium3DTileset.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1257,6 +1257,15 @@ class CESIUMRUNTIME_API ACesium3DTileset : public AActor {
12571257
*/
12581258
void UpdateTransformFromCesium();
12591259

1260+
/**
1261+
* Sets the glTF model tuner, an optional extension class that can edit
1262+
* each tile's glTF model after it has been loaded, before it can be
1263+
* displayed. Can only be called in the same engine tick after the tileset
1264+
* actor was spawned, or {@link RefreshTileset} was called.
1265+
*/
1266+
void
1267+
SetGltfTuner(const std::shared_ptr<Cesium3DTilesSelection::GltfTuner>& tuner);
1268+
12601269
private:
12611270
/**
12621271
* The event handler for ACesiumGeoreference::OnEllipsoidChanged.
@@ -1371,6 +1380,8 @@ class CESIUMRUNTIME_API ACesium3DTileset : public AActor {
13711380

13721381
int32 _tilesetsBeingDestroyed;
13731382

1383+
std::shared_ptr<Cesium3DTilesSelection::GltfTuner> _gltfTuner;
1384+
13741385
friend class UnrealPrepareRendererResources;
13751386
friend class UCesiumGltfPointsComponent;
13761387
};

0 commit comments

Comments
 (0)