From 691c1204a5ebdf125328814e6473573a412aab79 Mon Sep 17 00:00:00 2001 From: Ashley Rogers Date: Fri, 8 May 2026 16:42:30 -0400 Subject: [PATCH 1/6] Basic vector tiles overlay --- .../Private/CesiumVectorStyle.cpp | 79 ++++++++++++++----- .../CesiumVectorTilesRasterOverlay.cpp | 23 ++++++ .../CesiumRuntime/Public/CesiumVectorStyle.h | 49 ++++++++++++ .../Public/CesiumVectorTilesRasterOverlay.h | 60 ++++++++++++++ extern/cesium-native | 2 +- 5 files changed, 194 insertions(+), 19 deletions(-) create mode 100644 Source/CesiumRuntime/Private/CesiumVectorTilesRasterOverlay.cpp create mode 100644 Source/CesiumRuntime/Public/CesiumVectorTilesRasterOverlay.h diff --git a/Source/CesiumRuntime/Private/CesiumVectorStyle.cpp b/Source/CesiumRuntime/Private/CesiumVectorStyle.cpp index ad5f72462..5209305a9 100644 --- a/Source/CesiumRuntime/Private/CesiumVectorStyle.cpp +++ b/Source/CesiumRuntime/Private/CesiumVectorStyle.cpp @@ -15,6 +15,17 @@ lineStyleToNative(const FCesiumVectorLineStyle& InLineStyle) { InLineStyle.Width, (CesiumVectorData::LineWidthMode)InLineStyle.WidthMode}; } + +CesiumVectorData::ColorStyle +fillStyleToNative(const FCesiumVectorPolygonFillStyle& fillStyle) { + return CesiumVectorData::ColorStyle{ + CesiumUtility::Color{ + fillStyle.Color.R, + fillStyle.Color.G, + fillStyle.Color.B, + fillStyle.Color.A}, + (CesiumVectorData::ColorMode)fillStyle.ColorMode}; +} } // namespace CesiumVectorData::VectorStyle FCesiumVectorStyle::toNative() const { @@ -32,32 +43,34 @@ CesiumVectorData::VectorStyle FCesiumVectorStyle::toNative() const { (uint8)CesiumVectorData::LineWidthMode::Pixels == (uint8)ECesiumVectorLineWidthMode::Pixels); - std::optional fillStyle; - if (this->PolygonStyle.Fill) { - fillStyle = CesiumVectorData::ColorStyle{ - CesiumUtility::Color{ - this->PolygonStyle.FillStyle.Color.R, - this->PolygonStyle.FillStyle.Color.G, - this->PolygonStyle.FillStyle.Color.B, - this->PolygonStyle.FillStyle.Color.A}, - (CesiumVectorData::ColorMode)this->PolygonStyle.FillStyle.ColorMode}; - } - return CesiumVectorData::VectorStyle{ lineStyleToNative(this->LineStyle), CesiumVectorData::PolygonStyle{ - fillStyle, + this->PolygonStyle.Fill + ? std::optional( + fillStyleToNative(this->PolygonStyle.FillStyle)) + : std::nullopt, this->PolygonStyle.Outline ? std::optional( lineStyleToNative(this->PolygonStyle.OutlineStyle)) + : std::nullopt}, + CesiumVectorData::PointStyle{ + this->PointStyle.Radius, + this->PointStyle.Fill + ? std::optional( + fillStyleToNative(this->PointStyle.FillStyle)) + : std::nullopt, + this->PointStyle.Outline + ? std::optional( + lineStyleToNative(this->PointStyle.OutlineStyle)) : std::nullopt}}; } FCesiumVectorStyle FCesiumVectorStyle::fromNative(const CesiumVectorData::VectorStyle& style) { - FCesiumVectorLineStyle OutlineStyle; + FCesiumVectorLineStyle PolygonOutlineStyle; if (style.polygon.outline) { - OutlineStyle = FCesiumVectorLineStyle{ + PolygonOutlineStyle = FCesiumVectorLineStyle{ FColor( (uint8)style.polygon.outline->color.r, (uint8)style.polygon.outline->color.g, @@ -68,9 +81,9 @@ FCesiumVectorStyle::fromNative(const CesiumVectorData::VectorStyle& style) { (ECesiumVectorLineWidthMode)style.polygon.outline->widthMode}; } - FCesiumVectorPolygonFillStyle FillStyle; + FCesiumVectorPolygonFillStyle PolygonFillStyle; if (style.polygon.fill) { - FillStyle = FCesiumVectorPolygonFillStyle{ + PolygonFillStyle = FCesiumVectorPolygonFillStyle{ FColor( (uint8)style.polygon.fill->color.r, (uint8)style.polygon.fill->color.g, @@ -79,6 +92,30 @@ FCesiumVectorStyle::fromNative(const CesiumVectorData::VectorStyle& style) { (ECesiumVectorColorMode)style.polygon.fill->colorMode}; } + FCesiumVectorLineStyle PointOutlineStyle; + if (style.point.outline) { + PolygonOutlineStyle = FCesiumVectorLineStyle{ + FColor( + (uint8)style.point.outline->color.r, + (uint8)style.point.outline->color.g, + (uint8)style.point.outline->color.b, + (uint8)style.point.outline->color.a), + (ECesiumVectorColorMode)style.point.outline->colorMode, + style.point.outline->width, + (ECesiumVectorLineWidthMode)style.point.outline->widthMode}; + } + + FCesiumVectorPolygonFillStyle PointFillStyle; + if (style.point.fill) { + PolygonFillStyle = FCesiumVectorPolygonFillStyle{ + FColor( + (uint8)style.point.fill->color.r, + (uint8)style.point.fill->color.g, + (uint8)style.point.fill->color.b, + (uint8)style.point.fill->color.a), + (ECesiumVectorColorMode)style.point.fill->colorMode}; + } + return FCesiumVectorStyle{ FCesiumVectorLineStyle{ FColor( @@ -91,7 +128,13 @@ FCesiumVectorStyle::fromNative(const CesiumVectorData::VectorStyle& style) { (ECesiumVectorLineWidthMode)style.line.widthMode}, FCesiumVectorPolygonStyle{ style.polygon.fill.has_value(), - FillStyle, + PolygonFillStyle, style.polygon.outline.has_value(), - OutlineStyle}}; + PolygonOutlineStyle}, + FCesiumVectorPointStyle{ + (float)style.point.radius, + style.point.fill.has_value(), + PointFillStyle, + style.point.outline.has_value(), + PointOutlineStyle}}; } diff --git a/Source/CesiumRuntime/Private/CesiumVectorTilesRasterOverlay.cpp b/Source/CesiumRuntime/Private/CesiumVectorTilesRasterOverlay.cpp new file mode 100644 index 000000000..b1f8beec1 --- /dev/null +++ b/Source/CesiumRuntime/Private/CesiumVectorTilesRasterOverlay.cpp @@ -0,0 +1,23 @@ +// Copyright 2020-2024 CesiumGS, Inc. and Contributors + +#include "CesiumVectorTilesRasterOverlay.h" + +#include "CesiumCustomVersion.h" +#include "CesiumGeometry/QuadtreeTilingScheme.h" +#include "CesiumGeospatial/GlobeRectangle.h" +#include "CesiumGeospatial/Projection.h" +#include "CesiumRasterOverlays/GeoJsonDocumentRasterOverlay.h" +#include "CesiumVectorData/VectorStyle.h" +#include "Cesium3DTilesSelection/VectorTilesRasterOverlay.h" + +#include "CesiumRuntime.h" + +std::unique_ptr +UCesiumVectorTilesRasterOverlay::CreateOverlay( + const CesiumRasterOverlays::RasterOverlayOptions& options) { + return std::make_unique( + TCHAR_TO_UTF8(*this->MaterialLayerKey), + TCHAR_TO_UTF8(*this->Url), + this->DefaultStyle.toNative(), + options); +} diff --git a/Source/CesiumRuntime/Public/CesiumVectorStyle.h b/Source/CesiumRuntime/Public/CesiumVectorStyle.h index 5f2286417..5820fb43c 100644 --- a/Source/CesiumRuntime/Public/CesiumVectorStyle.h +++ b/Source/CesiumRuntime/Public/CesiumVectorStyle.h @@ -135,6 +135,49 @@ struct FCesiumVectorPolygonStyle { FCesiumVectorLineStyle OutlineStyle; }; +USTRUCT(BlueprintType) +struct FCesiumVectorPointStyle { + GENERATED_BODY() + + /** + * The radius of the point. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cesium") + float Radius = 1.0f; + + /** + * Whether the point should be filled. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cesium") + bool Fill = true; + + /** + * If `Fill` is true, this style will be used when filling the point. + */ + UPROPERTY( + EditAnywhere, + BlueprintReadWrite, + Category = "Cesium", + meta = (EditCondition = "Fill")) + FCesiumVectorPolygonFillStyle FillStyle; + + /** + * Whether the point should be outlined. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cesium") + bool Outline = false; + + /** + * If `Outline` is true, this style will be used when outlining the point. + */ + UPROPERTY( + EditAnywhere, + BlueprintReadWrite, + Category = "Cesium", + meta = (EditCondition = "Outline")) + FCesiumVectorLineStyle OutlineStyle; +}; + /** * Style information to use when drawing vector data. */ @@ -154,6 +197,12 @@ struct FCesiumVectorStyle { UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cesium") FCesiumVectorPolygonStyle PolygonStyle; + /** + * Styles to use when drawing points. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cesium") + FCesiumVectorPointStyle PointStyle; + /** * Converts this Unreal representation into the Cesium Native equivalent. */ diff --git a/Source/CesiumRuntime/Public/CesiumVectorTilesRasterOverlay.h b/Source/CesiumRuntime/Public/CesiumVectorTilesRasterOverlay.h new file mode 100644 index 000000000..f54727b82 --- /dev/null +++ b/Source/CesiumRuntime/Public/CesiumVectorTilesRasterOverlay.h @@ -0,0 +1,60 @@ +// Copyright 2020-2024 CesiumGS, Inc. and Contributors + +#pragma once + +#include "CesiumGeoJsonDocument.h" +#include "CesiumIonServer.h" +#include "CesiumRasterOverlay.h" +#include "CesiumVectorStyle.h" +#include "Components/ActorComponent.h" +#include "CoreMinimal.h" +#include "Delegates/Delegate.h" +#include "CesiumVectorTilesRasterOverlay.generated.h" + + +UCLASS( + ClassGroup = Cesium, + BlueprintType, + Blueprintable, + meta = (BlueprintSpawnableComponent)) +class CESIUMRUNTIME_API UCesiumVectorTilesRasterOverlay + : public UCesiumRasterOverlay { + GENERATED_BODY() + +public: + /** + * A URL to load a GeoJSON document from. + */ + UPROPERTY( + EditAnywhere, + BlueprintReadWrite, + Category = "Cesium") + FString Url; + + /** + * The number of mip levels to generate for each tile of this raster overlay. + * + * Additional mip levels can improve the visual quality of tiles farther from + * the camera at the cost of additional rasterization time to create each mip + * level. + */ + UPROPERTY( + EditAnywhere, + BlueprintReadWrite, + Category = "Cesium", + meta = (ClampMin = "0", ClampMax = "8")) + int32 MipLevels = 0; + + /** + * The default style to use for this raster overlay. + * + * If no style is set on a GeoJSON object or any of its parents, this style + * will be used instead. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cesium") + FCesiumVectorStyle DefaultStyle; + +protected: + virtual std::unique_ptr CreateOverlay( + const CesiumRasterOverlays::RasterOverlayOptions& options = {}) override; +}; diff --git a/extern/cesium-native b/extern/cesium-native index 595969069..0e0d06aaa 160000 --- a/extern/cesium-native +++ b/extern/cesium-native @@ -1 +1 @@ -Subproject commit 595969069e4e5d07bf917f413905db09d3f49483 +Subproject commit 0e0d06aaa5e93c9063f9a214fa35b2e8737c6800 From e3f24d2afefd750cb14fba56b0a45eb6308a38da Mon Sep 17 00:00:00 2001 From: Ashley Rogers Date: Wed, 13 May 2026 11:18:19 -0400 Subject: [PATCH 2/6] Update cesium-native --- extern/cesium-native | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extern/cesium-native b/extern/cesium-native index 0e0d06aaa..2a1446ff2 160000 --- a/extern/cesium-native +++ b/extern/cesium-native @@ -1 +1 @@ -Subproject commit 0e0d06aaa5e93c9063f9a214fa35b2e8737c6800 +Subproject commit 2a1446ff2e2200a15ed785a419748a1584c9ce55 From 115db87580fa818139983dfc8a20cb55e9a4c732 Mon Sep 17 00:00:00 2001 From: Ashley Rogers Date: Tue, 26 May 2026 10:34:39 -0400 Subject: [PATCH 3/6] Cesium ion support, clean up --- CHANGES.md | 5 ++ .../CesiumGeoJsonDocumentRasterOverlay.cpp | 10 +-- .../CesiumVectorTilesRasterOverlay.cpp | 45 ++++++++++--- .../Public/CesiumVectorTilesRasterOverlay.h | 65 ++++++++++++++++++- extern/cesium-native | 2 +- 5 files changed, 109 insertions(+), 18 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 4d745c465..074d867f6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,11 @@ ### ? - ? +##### Additions :tada: + +- Added `CesiumVectorTilesRasterOverlay` supporting vector data loaded from 3D Tiles tilesets. +- Added support for displaying points in `CesiumGeoJsonDocumentRasterOverlay` and `CesiumVectorTilesRasterOverlay`. + ##### Fixes :wrench: - 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). diff --git a/Source/CesiumRuntime/Private/CesiumGeoJsonDocumentRasterOverlay.cpp b/Source/CesiumRuntime/Private/CesiumGeoJsonDocumentRasterOverlay.cpp index 8978132c2..bad07cfd6 100644 --- a/Source/CesiumRuntime/Private/CesiumGeoJsonDocumentRasterOverlay.cpp +++ b/Source/CesiumRuntime/Private/CesiumGeoJsonDocumentRasterOverlay.cpp @@ -6,8 +6,8 @@ #include "CesiumGeometry/QuadtreeTilingScheme.h" #include "CesiumGeospatial/GlobeRectangle.h" #include "CesiumGeospatial/Projection.h" -#include "CesiumRasterOverlays/GeoJsonDocumentRasterOverlay.h" #include "CesiumVectorData/VectorStyle.h" +#include "CesiumVectorOverlays/GeoJsonDocumentRasterOverlay.h" #include "CesiumRuntime.h" @@ -52,7 +52,7 @@ UCesiumGeoJsonDocumentRasterOverlay::CreateOverlay( return nullptr; } - CesiumRasterOverlays::GeoJsonDocumentRasterOverlayOptions vectorOptions{ + CesiumVectorOverlays::GeoJsonDocumentRasterOverlayOptions vectorOptions{ this->DefaultStyle.toNative(), options.ellipsoid, this->MipLevels}; @@ -63,7 +63,7 @@ UCesiumGeoJsonDocumentRasterOverlay::CreateOverlay( this->CesiumIonServer = UCesiumIonServer::GetServerForNewObjects(); } - return std::make_unique( + return std::make_unique( TCHAR_TO_UTF8(*this->MaterialLayerKey), wrapLoaderFuture( this, @@ -85,7 +85,7 @@ UCesiumGeoJsonDocumentRasterOverlay::CreateOverlay( headers.push_back({TCHAR_TO_UTF8(*k), TCHAR_TO_UTF8(*v)}); } - return std::make_unique( + return std::make_unique( TCHAR_TO_UTF8(*this->MaterialLayerKey), wrapLoaderFuture( this, @@ -102,7 +102,7 @@ UCesiumGeoJsonDocumentRasterOverlay::CreateOverlay( this->OnDocumentLoaded.Execute(this->GeoJsonDocument); } - return std::make_unique( + return std::make_unique( getAsyncSystem(), TCHAR_TO_UTF8(*this->MaterialLayerKey), this->GeoJsonDocument.GetDocument(), diff --git a/Source/CesiumRuntime/Private/CesiumVectorTilesRasterOverlay.cpp b/Source/CesiumRuntime/Private/CesiumVectorTilesRasterOverlay.cpp index b1f8beec1..d9b6fe618 100644 --- a/Source/CesiumRuntime/Private/CesiumVectorTilesRasterOverlay.cpp +++ b/Source/CesiumRuntime/Private/CesiumVectorTilesRasterOverlay.cpp @@ -2,22 +2,49 @@ #include "CesiumVectorTilesRasterOverlay.h" -#include "CesiumCustomVersion.h" -#include "CesiumGeometry/QuadtreeTilingScheme.h" -#include "CesiumGeospatial/GlobeRectangle.h" -#include "CesiumGeospatial/Projection.h" -#include "CesiumRasterOverlays/GeoJsonDocumentRasterOverlay.h" -#include "CesiumVectorData/VectorStyle.h" -#include "Cesium3DTilesSelection/VectorTilesRasterOverlay.h" +#include +#include +#include +#include +#include +#include +#include "CesiumCustomVersion.h" #include "CesiumRuntime.h" +#include + std::unique_ptr UCesiumVectorTilesRasterOverlay::CreateOverlay( const CesiumRasterOverlays::RasterOverlayOptions& options) { - return std::make_unique( + std::vector headers; + headers.reserve(this->RequestHeaders.Num()); + + for (auto& [k, v] : this->RequestHeaders) { + headers.push_back({TCHAR_TO_UTF8(*k), TCHAR_TO_UTF8(*v)}); + } + + CesiumVectorOverlays::VectorTilesRasterOverlayOptions vectorOptions{ + this->DefaultStyle.toNative(), + headers}; + + if (this->Source == ECesiumVectorTilesRasterOverlaySource::FromCesiumIon) { + if (!IsValid(this->CesiumIonServer)) { + this->CesiumIonServer = UCesiumIonServer::GetServerForNewObjects(); + } + + return std::make_unique( + TCHAR_TO_UTF8(*this->MaterialLayerKey), + this->IonAssetID, + TCHAR_TO_UTF8(*this->CesiumIonServer->DefaultIonAccessToken), + std::string(TCHAR_TO_UTF8(*this->CesiumIonServer->ApiUrl)) + "/", + vectorOptions, + options); + } + + return std::make_unique( TCHAR_TO_UTF8(*this->MaterialLayerKey), TCHAR_TO_UTF8(*this->Url), - this->DefaultStyle.toNative(), + vectorOptions, options); } diff --git a/Source/CesiumRuntime/Public/CesiumVectorTilesRasterOverlay.h b/Source/CesiumRuntime/Public/CesiumVectorTilesRasterOverlay.h index f54727b82..35579a5ad 100644 --- a/Source/CesiumRuntime/Public/CesiumVectorTilesRasterOverlay.h +++ b/Source/CesiumRuntime/Public/CesiumVectorTilesRasterOverlay.h @@ -11,6 +11,21 @@ #include "Delegates/Delegate.h" #include "CesiumVectorTilesRasterOverlay.generated.h" +/** + * Configures where the CesiumVectorTilesRasterOverlay should load its vector + * data from. + */ +UENUM(BlueprintType) +enum class ECesiumVectorTilesRasterOverlaySource : uint8 { + /** + * The raster overlay will load a vector tileset from Cesium ion. + */ + FromCesiumIon = 0, + /** + * The raster overlay will load a vector tileset from a URL. + */ + FromUrl = 1 +}; UCLASS( ClassGroup = Cesium, @@ -22,15 +37,59 @@ class CESIUMRUNTIME_API UCesiumVectorTilesRasterOverlay GENERATED_BODY() public: + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cesium") + ECesiumVectorTilesRasterOverlaySource Source = + ECesiumVectorTilesRasterOverlaySource::FromCesiumIon; + /** + * The ID of the Cesium ion asset to use. + */ + UPROPERTY( + EditAnywhere, + BlueprintReadWrite, + Category = "Cesium", + meta = + (EditCondition = + "Source == ECesiumVectorTilesRasterOverlaySource::FromCesiumIon")) + int64 IonAssetID; + + /** + * The Cesium ion Server from which this raster overlay is loaded. + */ + UPROPERTY( + EditAnywhere, + BlueprintReadWrite, + Category = "Cesium", + AdvancedDisplay, + meta = + (EditCondition = + "Source == ECesiumVectorTilesRasterOverlaySource::FromCesiumIon")) + UCesiumIonServer* CesiumIonServer; + /** - * A URL to load a GeoJSON document from. + * A URL to load a vector tiles tileset from. */ UPROPERTY( EditAnywhere, BlueprintReadWrite, - Category = "Cesium") + Category = "Cesium", + meta = + (EditCondition = + "Source == ECesiumVectorTilesRasterOverlaySource::FromUrl")) FString Url; + /** + * Headers to use while making a request to `Url` to load a vector tiles + * tileset. + */ + UPROPERTY( + EditAnywhere, + BlueprintReadWrite, + Category = "Cesium", + meta = + (EditCondition = + "Source == ECesiumVectorTilesRasterOverlaySource::FromUrl")) + TMap RequestHeaders; + /** * The number of mip levels to generate for each tile of this raster overlay. * @@ -48,7 +107,7 @@ class CESIUMRUNTIME_API UCesiumVectorTilesRasterOverlay /** * The default style to use for this raster overlay. * - * If no style is set on a GeoJSON object or any of its parents, this style + * If no style information is present in the vector tiles tileset, this style * will be used instead. */ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cesium") diff --git a/extern/cesium-native b/extern/cesium-native index 2a1446ff2..6f71bbf6a 160000 --- a/extern/cesium-native +++ b/extern/cesium-native @@ -1 +1 @@ -Subproject commit 2a1446ff2e2200a15ed785a419748a1584c9ce55 +Subproject commit 6f71bbf6adaa6f67f06116c0522662d21a0aa772 From b3c20c4506d55a82336b889fcadfaba7e5f94290 Mon Sep 17 00:00:00 2001 From: Ashley Rogers Date: Thu, 28 May 2026 11:34:04 -0400 Subject: [PATCH 4/6] Update from review --- .../Private/CesiumVectorStyle.cpp | 56 +++++++++---------- .../CesiumVectorTilesRasterOverlay.cpp | 14 ++++- .../CesiumRuntime/Public/CesiumVectorStyle.h | 2 +- .../Public/CesiumVectorTilesRasterOverlay.h | 12 ++++ extern/cesium-native | 2 +- 5 files changed, 55 insertions(+), 31 deletions(-) diff --git a/Source/CesiumRuntime/Private/CesiumVectorStyle.cpp b/Source/CesiumRuntime/Private/CesiumVectorStyle.cpp index 5209305a9..23916d15a 100644 --- a/Source/CesiumRuntime/Private/CesiumVectorStyle.cpp +++ b/Source/CesiumRuntime/Private/CesiumVectorStyle.cpp @@ -31,17 +31,17 @@ fillStyleToNative(const FCesiumVectorPolygonFillStyle& fillStyle) { CesiumVectorData::VectorStyle FCesiumVectorStyle::toNative() const { // Assert that enums are equivalent to catch any issues. static_assert( - (uint8)CesiumVectorData::ColorMode::Normal == - (uint8)ECesiumVectorColorMode::Normal); + static_cast(CesiumVectorData::ColorMode::Normal) == + static_cast(ECesiumVectorColorMode::Normal)); static_assert( - (uint8)CesiumVectorData::ColorMode::Random == - (uint8)ECesiumVectorColorMode::Random); + static_cast(CesiumVectorData::ColorMode::Random) == + static_cast(ECesiumVectorColorMode::Random)); static_assert( - (uint8)CesiumVectorData::LineWidthMode::Meters == - (uint8)ECesiumVectorLineWidthMode::Meters); + static_cast(CesiumVectorData::LineWidthMode::Meters) == + static_cast(ECesiumVectorLineWidthMode::Meters)); static_assert( - (uint8)CesiumVectorData::LineWidthMode::Pixels == - (uint8)ECesiumVectorLineWidthMode::Pixels); + static_cast(CesiumVectorData::LineWidthMode::Pixels) == + static_cast(ECesiumVectorLineWidthMode::Pixels)); return CesiumVectorData::VectorStyle{ lineStyleToNative(this->LineStyle), @@ -72,10 +72,10 @@ FCesiumVectorStyle::fromNative(const CesiumVectorData::VectorStyle& style) { if (style.polygon.outline) { PolygonOutlineStyle = FCesiumVectorLineStyle{ FColor( - (uint8)style.polygon.outline->color.r, - (uint8)style.polygon.outline->color.g, - (uint8)style.polygon.outline->color.b, - (uint8)style.polygon.outline->color.a), + static_cast(style.polygon.outline->color.r), + static_cast(style.polygon.outline->color.g), + static_cast(style.polygon.outline->color.b), + static_cast(style.polygon.outline->color.a)), (ECesiumVectorColorMode)style.polygon.outline->colorMode, style.polygon.outline->width, (ECesiumVectorLineWidthMode)style.polygon.outline->widthMode}; @@ -85,10 +85,10 @@ FCesiumVectorStyle::fromNative(const CesiumVectorData::VectorStyle& style) { if (style.polygon.fill) { PolygonFillStyle = FCesiumVectorPolygonFillStyle{ FColor( - (uint8)style.polygon.fill->color.r, - (uint8)style.polygon.fill->color.g, - (uint8)style.polygon.fill->color.b, - (uint8)style.polygon.fill->color.a), + static_cast(style.polygon.fill->color.r), + static_cast(style.polygon.fill->color.g), + static_cast(style.polygon.fill->color.b), + static_cast(style.polygon.fill->color.a)), (ECesiumVectorColorMode)style.polygon.fill->colorMode}; } @@ -96,10 +96,10 @@ FCesiumVectorStyle::fromNative(const CesiumVectorData::VectorStyle& style) { if (style.point.outline) { PolygonOutlineStyle = FCesiumVectorLineStyle{ FColor( - (uint8)style.point.outline->color.r, - (uint8)style.point.outline->color.g, - (uint8)style.point.outline->color.b, - (uint8)style.point.outline->color.a), + static_cast(style.point.outline->color.r), + static_cast(style.point.outline->color.g), + static_cast(style.point.outline->color.b), + static_cast(style.point.outline->color.a)), (ECesiumVectorColorMode)style.point.outline->colorMode, style.point.outline->width, (ECesiumVectorLineWidthMode)style.point.outline->widthMode}; @@ -109,20 +109,20 @@ FCesiumVectorStyle::fromNative(const CesiumVectorData::VectorStyle& style) { if (style.point.fill) { PolygonFillStyle = FCesiumVectorPolygonFillStyle{ FColor( - (uint8)style.point.fill->color.r, - (uint8)style.point.fill->color.g, - (uint8)style.point.fill->color.b, - (uint8)style.point.fill->color.a), + static_cast(style.point.fill->color.r), + static_cast(style.point.fill->color.g), + static_cast(style.point.fill->color.b), + static_cast(style.point.fill->color.a)), (ECesiumVectorColorMode)style.point.fill->colorMode}; } return FCesiumVectorStyle{ FCesiumVectorLineStyle{ FColor( - (uint8)style.line.color.r, - (uint8)style.line.color.g, - (uint8)style.line.color.b, - (uint8)style.line.color.a), + static_cast(style.line.color.r), + static_cast(style.line.color.g), + static_cast(style.line.color.b), + static_cast(style.line.color.a)), (ECesiumVectorColorMode)style.line.colorMode, style.line.width, (ECesiumVectorLineWidthMode)style.line.widthMode}, diff --git a/Source/CesiumRuntime/Private/CesiumVectorTilesRasterOverlay.cpp b/Source/CesiumRuntime/Private/CesiumVectorTilesRasterOverlay.cpp index d9b6fe618..2be52d2ec 100644 --- a/Source/CesiumRuntime/Private/CesiumVectorTilesRasterOverlay.cpp +++ b/Source/CesiumRuntime/Private/CesiumVectorTilesRasterOverlay.cpp @@ -29,19 +29,31 @@ UCesiumVectorTilesRasterOverlay::CreateOverlay( headers}; if (this->Source == ECesiumVectorTilesRasterOverlaySource::FromCesiumIon) { + if (this->IonAssetID <= 0) { + return nullptr; + } + if (!IsValid(this->CesiumIonServer)) { this->CesiumIonServer = UCesiumIonServer::GetServerForNewObjects(); } + FString token = this->IonAccessToken.IsEmpty() + ? this->CesiumIonServer->DefaultIonAccessToken + : this->IonAccessToken; + return std::make_unique( TCHAR_TO_UTF8(*this->MaterialLayerKey), this->IonAssetID, - TCHAR_TO_UTF8(*this->CesiumIonServer->DefaultIonAccessToken), + TCHAR_TO_UTF8(*token), std::string(TCHAR_TO_UTF8(*this->CesiumIonServer->ApiUrl)) + "/", vectorOptions, options); } + if (this->Url.IsEmpty()) { + return nullptr; + } + return std::make_unique( TCHAR_TO_UTF8(*this->MaterialLayerKey), TCHAR_TO_UTF8(*this->Url), diff --git a/Source/CesiumRuntime/Public/CesiumVectorStyle.h b/Source/CesiumRuntime/Public/CesiumVectorStyle.h index 5820fb43c..c75168bf2 100644 --- a/Source/CesiumRuntime/Public/CesiumVectorStyle.h +++ b/Source/CesiumRuntime/Public/CesiumVectorStyle.h @@ -140,7 +140,7 @@ struct FCesiumVectorPointStyle { GENERATED_BODY() /** - * The radius of the point. + * The radius of the point in pixels. */ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cesium") float Radius = 1.0f; diff --git a/Source/CesiumRuntime/Public/CesiumVectorTilesRasterOverlay.h b/Source/CesiumRuntime/Public/CesiumVectorTilesRasterOverlay.h index 35579a5ad..6a4070b0d 100644 --- a/Source/CesiumRuntime/Public/CesiumVectorTilesRasterOverlay.h +++ b/Source/CesiumRuntime/Public/CesiumVectorTilesRasterOverlay.h @@ -52,6 +52,18 @@ class CESIUMRUNTIME_API UCesiumVectorTilesRasterOverlay "Source == ECesiumVectorTilesRasterOverlaySource::FromCesiumIon")) int64 IonAssetID; + /** + * The access token to use to access the Cesium ion resource. + */ + UPROPERTY( + EditAnywhere, + BlueprintReadWrite, + Category = "Cesium", + meta = + (EditCondition = + "Source == ECesiumVectorTilesRasterOverlaySource::FromCesiumIon")) + FString IonAccessToken; + /** * The Cesium ion Server from which this raster overlay is loaded. */ diff --git a/extern/cesium-native b/extern/cesium-native index 6f71bbf6a..4f8b75d90 160000 --- a/extern/cesium-native +++ b/extern/cesium-native @@ -1 +1 @@ -Subproject commit 6f71bbf6adaa6f67f06116c0522662d21a0aa772 +Subproject commit 4f8b75d90f009d494dde95db437dd4268af4accb From 1c5a58fac68148dc0288ac80fca80dd3fd3434e0 Mon Sep 17 00:00:00 2001 From: Ashley Rogers Date: Thu, 28 May 2026 11:57:42 -0400 Subject: [PATCH 5/6] Update cesium-native --- extern/cesium-native | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extern/cesium-native b/extern/cesium-native index 4f8b75d90..7fd368ac2 160000 --- a/extern/cesium-native +++ b/extern/cesium-native @@ -1 +1 @@ -Subproject commit 4f8b75d90f009d494dde95db437dd4268af4accb +Subproject commit 7fd368ac23d0e624267ae3188a5ec4258d0ed4b3 From ee9cddab5ca7e889adc35a8687eba2f5246f3405 Mon Sep 17 00:00:00 2001 From: Ashley Rogers Date: Thu, 28 May 2026 12:00:22 -0400 Subject: [PATCH 6/6] Fix broken CI job --- .github/workflows/buildLinux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/buildLinux.yml b/.github/workflows/buildLinux.yml index a90037eeb..1887a799b 100644 --- a/.github/workflows/buildLinux.yml +++ b/.github/workflows/buildLinux.yml @@ -39,7 +39,7 @@ jobs: - name: Removed unneeded packages to gain disk space run: | sudo apt update - 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 + 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 df -h sudo rm -rf /usr/local/lib/android || true sudo rm -rf /usr/share/dotnet || true