Cesium for Unreal 2.12.0
Loading...
Searching...
No Matches
Cesium3DTileset.h
Go to the documentation of this file.
1// Copyright 2020-2024 CesiumGS, Inc. and Contributors
2
3#pragma once
4
5#include "Cesium3DTilesSelection/Tileset.h"
6#include "Cesium3DTilesSelection/ViewState.h"
7#include "Cesium3DTilesSelection/ViewUpdateResult.h"
12#include "CesiumGeoreference.h"
13#include "CesiumIonServer.h"
16#include "CoreMinimal.h"
18#include "Engine/EngineTypes.h"
19#include "GameFramework/Actor.h"
20#include "Interfaces/IHttpRequest.h"
21#include "PrimitiveSceneProxy.h"
22#include <PhysicsEngine/BodyInstance.h>
23#include <atomic>
24#include <chrono>
25#include <glm/mat4x4.hpp>
26#include <unordered_map>
27#include <vector>
28#include "Cesium3DTileset.generated.h"
29
30#ifdef CESIUM_DEBUG_TILE_STATES
31#include <Cesium3DTilesSelection/DebugTileStateDatabase.h>
32#endif
33
34class UMaterialInterface;
35class ACesiumCartographicSelection;
37class UCesiumBoundingVolumePoolComponent;
38class CesiumViewExtension;
39struct FCesiumCamera;
40
41namespace Cesium3DTilesSelection {
42class Tileset;
43class TilesetView;
44class TileOcclusionRendererProxyPool;
45} // namespace Cesium3DTilesSelection
46
52 FCesium3DTilesetLoadFailure,
54
56 FCesiumSampleHeightMostDetailedCallback,
58 const TArray<FCesiumSampleHeightResult>&,
59 const TArray<FString>&);
60
66
67CESIUMRUNTIME_API extern FCesium3DTilesetLoadFailure
69
70UENUM(BlueprintType)
71enum class ETilesetSource : uint8 {
76 FromCesiumIon UMETA(DisplayName = "From Cesium Ion"),
77
81 FromUrl UMETA(DisplayName = "From Url"),
82
86 FromEllipsoid UMETA(DisplayName = "From Ellipsoid")
87};
88
89UENUM(BlueprintType)
90enum class EApplyDpiScaling : uint8 { Yes, No, UseProjectDefault };
91
92UCLASS()
93class CESIUMRUNTIME_API ACesium3DTileset : public AActor {
94 GENERATED_BODY()
95
96public:
99
100private:
101 UPROPERTY(VisibleAnywhere, Category = "Cesium") USceneComponent* Root;
102
103 UPROPERTY(
104 Meta =
105 (AllowPrivateAccess,
106 DeprecatedProperty,
107 DeprecationMessage =
108 "Use the Mobility property on the RootComponent instead."))
109 TEnumAsByte<EComponentMobility::Type> Mobility_DEPRECATED =
110 EComponentMobility::Static;
111
112public:
113 UFUNCTION(BlueprintCallable, meta = (DeprecatedFunction))
114 EComponentMobility::Type GetMobility() const {
115 return this->RootComponent->Mobility;
116 }
117 UFUNCTION(BlueprintCallable, meta = (DeprecatedFunction))
118 void SetMobility(EComponentMobility::Type NewMobility);
119
137 void SampleHeightMostDetailed(
138 const TArray<FVector>& LongitudeLatitudeHeightArray,
139 FCesiumSampleHeightMostDetailedCallback OnHeightsSampled);
140
141private:
151 UPROPERTY(
152 EditAnywhere,
153 BlueprintReadWrite,
154 BlueprintGetter = GetGeoreference,
155 BlueprintSetter = SetGeoreference,
156 Category = "Cesium",
157 Meta = (AllowPrivateAccess))
158 TSoftObjectPtr<ACesiumGeoreference> Georeference;
159
168 UPROPERTY(
169 Transient,
170 VisibleAnywhere,
171 BlueprintReadOnly,
172 Category = "Cesium",
173 Meta = (AllowPrivateAccess))
174 ACesiumGeoreference* ResolvedGeoreference = nullptr;
175
176public:
178 UFUNCTION(BlueprintCallable, Category = "Cesium")
179 TSoftObjectPtr<ACesiumGeoreference> GetGeoreference() const;
180
182 UFUNCTION(BlueprintCallable, Category = "Cesium")
183 void SetGeoreference(TSoftObjectPtr<ACesiumGeoreference> NewGeoreference);
184
192 UFUNCTION(BlueprintCallable, Category = "Cesium")
193 ACesiumGeoreference* ResolveGeoreference();
194
200 UFUNCTION(BlueprintCallable, Category = "Cesium")
201 void InvalidateResolvedGeoreference();
202
203private:
211 UPROPERTY(
212 EditAnywhere,
213 BlueprintReadWrite,
214 BlueprintGetter = GetCreditSystem,
215 BlueprintSetter = SetCreditSystem,
216 Category = "Cesium",
217 Meta = (AllowPrivateAccess))
218 TSoftObjectPtr<ACesiumCreditSystem> CreditSystem;
219
228 UPROPERTY(
229 Transient,
230 BlueprintReadOnly,
231 Category = "Cesium",
232 Meta = (AllowPrivateAccess))
233 ACesiumCreditSystem* ResolvedCreditSystem = nullptr;
234
243 UPROPERTY(
244 EditAnywhere,
245 BlueprintReadWrite,
246 BlueprintGetter = GetCameraManager,
247 BlueprintSetter = SetCameraManager,
248 Category = "Cesium",
249 Meta = (AllowPrivateAccess))
250 TSoftObjectPtr<ACesiumCameraManager> CameraManager;
251
260 UPROPERTY(
261 Transient,
262 BlueprintReadOnly,
263 Category = "Cesium",
264 Meta = (AllowPrivateAccess))
265 ACesiumCameraManager* ResolvedCameraManager = nullptr;
266
271 UPROPERTY(
272 Transient,
273 BlueprintReadOnly,
274 Category = "Cesium",
275 Meta = (AllowPrivateAccess))
276 UCesiumBoundingVolumePoolComponent* BoundingVolumePoolComponent = nullptr;
277
282 TSharedPtr<CesiumViewExtension, ESPMode::ThreadSafe> _cesiumViewExtension =
283 nullptr;
284
285public:
287 UFUNCTION(BlueprintCallable, Category = "Cesium")
288 TSoftObjectPtr<ACesiumCreditSystem> GetCreditSystem() const;
289
291 UFUNCTION(BlueprintCallable, Category = "Cesium")
292 void SetCreditSystem(TSoftObjectPtr<ACesiumCreditSystem> NewCreditSystem);
293
301 UFUNCTION(BlueprintCallable, Category = "Cesium")
302 ACesiumCreditSystem* ResolveCreditSystem();
303
308 UFUNCTION(BlueprintCallable, Category = "Cesium")
309 void InvalidateResolvedCreditSystem();
310
314 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cesium")
315 bool ShowCreditsOnScreen = false;
316
318 UFUNCTION(BlueprintGetter, Category = "Cesium")
319 TSoftObjectPtr<ACesiumCameraManager> GetCameraManager() const;
320
322 UFUNCTION(BlueprintSetter, Category = "Cesium")
323 void SetCameraManager(TSoftObjectPtr<ACesiumCameraManager> NewCameraManager);
324
332 UFUNCTION(BlueprintCallable, Category = "Cesium")
333 ACesiumCameraManager* ResolveCameraManager();
334
340 UFUNCTION(BlueprintCallable, Category = "Cesium")
341 void InvalidateResolvedCameraManager();
342
358 UPROPERTY(
359 EditAnywhere,
360 BlueprintGetter = GetMaximumScreenSpaceError,
361 BlueprintSetter = SetMaximumScreenSpaceError,
362 Category = "Cesium|Level of Detail",
363 meta = (ClampMin = 0.0))
364 double MaximumScreenSpaceError = 16.0;
365
370 UPROPERTY(
371 EditAnywhere,
372 BlueprintReadWrite,
373 Category = "Cesium|Level of Detail")
375
383 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cesium|Tile Loading")
384 bool PreloadAncestors = true;
385
393 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cesium|Tile Loading")
394 bool PreloadSiblings = true;
395
405 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cesium|Tile Loading")
406 bool ForbidHoles = false;
407
417 UPROPERTY(
418 EditAnywhere,
419 BlueprintReadWrite,
420 Category = "Cesium|Tile Loading",
421 meta = (ClampMin = 0))
422 int32 MaximumSimultaneousTileLoads = 20;
423
433 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cesium|Tile Loading")
434 int64 MaximumCachedBytes = 256 * 1024 * 1024;
435
447 UPROPERTY(
448 EditAnywhere,
449 BlueprintReadWrite,
450 Category = "Cesium|Tile Loading",
451 meta = (ClampMin = 0))
452 int32 LoadingDescendantLimit = 20;
453
467 UPROPERTY(
468 EditAnywhere,
469 BlueprintReadWrite,
470 Category = "Cesium|Tile Culling",
471 Meta = (EditCondition = "!UseLodTransitions", EditConditionHides))
472 bool EnableFrustumCulling = true;
473
484 UPROPERTY(
485 EditAnywhere,
486 BlueprintReadWrite,
487 Category = "Cesium|Tile Culling",
488 Meta = (EditCondition = "!UseLodTransitions", EditConditionHides))
489 bool EnableFogCulling = true;
490
511 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cesium|Tile Culling")
512 bool EnforceCulledScreenSpaceError = false;
513
533 UPROPERTY(
534 EditAnywhere,
535 BlueprintReadWrite,
536 Category = "Cesium|Tile Culling",
537 meta = (EditCondition = "EnforceCulledScreenSpaceError", ClampMin = 0.0))
538 double CulledScreenSpaceError = 64.0;
539
540 // This mirrors
541 // UCesiumRuntimeSettings::EnableExperimentalOcclusionCullingFeature so that
542 // it can be used as an EditCondition.
543 UPROPERTY(Transient, VisibleDefaultsOnly, Category = "Cesium|Tile Occlusion")
544 bool CanEnableOcclusionCulling = false;
545
566 UPROPERTY(
567 EditAnywhere,
568 BlueprintGetter = GetEnableOcclusionCulling,
569 BlueprintSetter = SetEnableOcclusionCulling,
570 Category = "Cesium|Tile Occlusion",
571 meta = (EditCondition = "CanEnableOcclusionCulling"))
572 bool EnableOcclusionCulling = true;
573
580 UPROPERTY(
581 EditAnywhere,
582 BlueprintGetter = GetOcclusionPoolSize,
583 BlueprintSetter = SetOcclusionPoolSize,
584 Category = "Cesium|Tile Occlusion",
585 meta =
586 (EditCondition =
587 "EnableOcclusionCulling && CanEnableOcclusionCulling",
588 ClampMin = "0",
589 ClampMax = "1000"))
590 int32 OcclusionPoolSize = 500;
591
600 UPROPERTY(
601 EditAnywhere,
602 BlueprintGetter = GetDelayRefinementForOcclusion,
603 BlueprintSetter = SetDelayRefinementForOcclusion,
604 Category = "Cesium|Tile Occlusion",
605 meta =
606 (EditCondition =
607 "EnableOcclusionCulling && CanEnableOcclusionCulling"))
608 bool DelayRefinementForOcclusion = true;
609
616 UFUNCTION(CallInEditor, BlueprintCallable, Category = "Cesium")
617 void RefreshTileset();
618
622 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cesium|Debug")
623 bool SuspendUpdate;
624
629 UPROPERTY(EditAnywhere, Category = "Cesium|Debug")
630 bool UpdateInEditor = true;
631
635 UPROPERTY(EditAnywhere, Category = "Cesium|Debug")
636 bool LogSelectionStats = false;
637
642 UPROPERTY(EditAnywhere, Category = "Cesium|Debug")
643 bool LogSharedAssetStats = false;
644
649 UPROPERTY(EditAnywhere, Category = "Cesium|Debug")
650 bool DrawTileInfo = false;
651
656 UPROPERTY(
657 EditAnywhere,
658 BlueprintReadOnly,
659 Category = "Collision",
660 meta = (ShowOnlyInnerProperties, SkipUCSModifiedProperties))
661 FBodyInstance BodyInstance;
662
666 UPROPERTY(BlueprintAssignable, Category = "Cesium");
667 FCompletedLoadTrigger OnTilesetLoaded;
668
675 UPROPERTY(
676 EditAnywhere,
677 BlueprintGetter = GetUseLodTransitions,
678 BlueprintSetter = SetUseLodTransitions,
679 Category = "Cesium|Rendering")
680 bool UseLodTransitions = false;
681
688 UPROPERTY(
689 EditAnywhere,
690 BlueprintReadWrite,
691 Category = "Cesium|Rendering",
692 meta = (EditCondition = "UseLodTransitions", EditConditionHides))
693 float LodTransitionLength = 0.5f;
694
695private:
696 UPROPERTY(BlueprintGetter = GetLoadProgress, Category = "Cesium")
697 float LoadProgress = 0.0f;
698
702 UPROPERTY(
703 EditAnywhere,
704 BlueprintGetter = GetTilesetSource,
705 BlueprintSetter = SetTilesetSource,
706 Category = "Cesium",
707 meta = (DisplayName = "Source"))
708 ETilesetSource TilesetSource = ETilesetSource::FromCesiumIon;
709
715 UPROPERTY(
716 EditAnywhere,
717 BlueprintGetter = GetUrl,
718 BlueprintSetter = SetUrl,
719 Category = "Cesium",
720 meta = (EditCondition = "TilesetSource==ETilesetSource::FromUrl"))
721 FString Url = "";
722
728 UPROPERTY(
729 EditAnywhere,
730 BlueprintGetter = GetIonAssetID,
731 BlueprintSetter = SetIonAssetID,
732 Category = "Cesium",
733 meta =
734 (EditCondition = "TilesetSource==ETilesetSource::FromCesiumIon",
735 ClampMin = 0))
736 int64 IonAssetID;
737
741 UPROPERTY(
742 EditAnywhere,
743 BlueprintGetter = GetIonAccessToken,
744 BlueprintSetter = SetIonAccessToken,
745 Category = "Cesium",
746 meta = (EditCondition = "TilesetSource==ETilesetSource::FromCesiumIon"))
747 FString IonAccessToken;
748
749 UPROPERTY(
750 meta =
751 (DeprecatedProperty,
752 DeprecationMessage = "Use CesiumIonServer instead."))
753 FString IonAssetEndpointUrl_DEPRECATED;
754
758 UPROPERTY(
759 EditAnywhere,
760 BlueprintGetter = GetCesiumIonServer,
761 BlueprintSetter = SetCesiumIonServer,
762 Category = "Cesium",
763 AdvancedDisplay,
764 meta = (EditCondition = "TilesetSource==ETilesetSource::FromCesiumIon"))
765 UCesiumIonServer* CesiumIonServer;
766
771 UFUNCTION(CallInEditor, Category = "Cesium")
772 void TroubleshootToken();
773
783 UPROPERTY(
784 EditAnywhere,
785 BlueprintGetter = GetCreatePhysicsMeshes,
786 BlueprintSetter = SetCreatePhysicsMeshes,
787 Category = "Cesium|Physics")
788 bool CreatePhysicsMeshes = true;
789
798 UPROPERTY(
799 EditAnywhere,
800 BlueprintGetter = GetCreateNavCollision,
801 BlueprintSetter = SetCreateNavCollision,
802 Category = "Cesium|Navigation")
803 bool CreateNavCollision = false;
804
820 UPROPERTY(
821 EditAnywhere,
822 BlueprintGetter = GetAlwaysIncludeTangents,
823 BlueprintSetter = SetAlwaysIncludeTangents,
824 Category = "Cesium|Rendering")
825 bool AlwaysIncludeTangents = false;
826
836 UPROPERTY(
837 EditAnywhere,
838 BlueprintGetter = GetGenerateSmoothNormals,
839 BlueprintSetter = SetGenerateSmoothNormals,
840 Category = "Cesium|Rendering")
841 bool GenerateSmoothNormals = false;
842
849 UPROPERTY(
850 EditAnywhere,
851 BlueprintGetter = GetEnableWaterMask,
852 BlueprintSetter = SetEnableWaterMask,
853 Category = "Cesium|Rendering",
854 meta = (EditCondition = "!bIsMac"))
855 bool EnableWaterMask = false;
856
867 UPROPERTY(
868 EditAnywhere,
869 BlueprintGetter = GetIgnoreKhrMaterialsUnlit,
870 BlueprintSetter = SetIgnoreKhrMaterialsUnlit,
871 Category = "Cesium|Rendering",
872 meta = (DisplayName = "Ignore KHR_materials_unlit"))
873 bool IgnoreKhrMaterialsUnlit = false;
874
883 UPROPERTY(
884 EditAnywhere,
885 BlueprintGetter = GetMaterial,
886 BlueprintSetter = SetMaterial,
887 Category = "Cesium|Rendering")
888 UMaterialInterface* Material = nullptr;
889
899 UPROPERTY(
900 EditAnywhere,
901 BlueprintGetter = GetTranslucentMaterial,
902 BlueprintSetter = SetTranslucentMaterial,
903 Category = "Cesium|Rendering")
904 UMaterialInterface* TranslucentMaterial = nullptr;
905
916 UPROPERTY(
917 EditAnywhere,
918 BlueprintGetter = GetWaterMaterial,
919 BlueprintSetter = SetWaterMaterial,
920 Category = "Cesium|Rendering")
921 UMaterialInterface* WaterMaterial = nullptr;
922
923 UPROPERTY(
924 EditAnywhere,
925 BlueprintGetter = GetCustomDepthParameters,
926 BlueprintSetter = SetCustomDepthParameters,
927 Category = "Rendering",
928 meta = (ShowOnlyInnerProperties))
929 FCustomDepthParameters CustomDepthParameters;
930
937 UPROPERTY(
938 EditAnywhere,
939 BlueprintGetter = GetPointCloudShading,
940 BlueprintSetter = SetPointCloudShading,
941 Category = "Cesium|Rendering")
942 FCesiumPointCloudShading PointCloudShading;
943
944protected:
945 UPROPERTY()
946 FString PlatformName;
947
948#if WITH_EDITORONLY_DATA
949 UPROPERTY()
950 bool bIsMac;
951#endif
952
953public:
954 UFUNCTION(BlueprintGetter, Category = "Cesium")
955 float GetLoadProgress() const { return LoadProgress; }
956
957 UFUNCTION(BlueprintGetter, Category = "Cesium")
958 bool GetUseLodTransitions() const { return UseLodTransitions; }
959
960 UFUNCTION(BlueprintSetter, Category = "Cesium")
961 void SetUseLodTransitions(bool InUseLodTransitions);
962
963 UFUNCTION(BlueprintGetter, Category = "Cesium")
964 ETilesetSource GetTilesetSource() const { return TilesetSource; }
965
966 UFUNCTION(BlueprintSetter, Category = "Cesium")
967 void SetTilesetSource(ETilesetSource InSource);
968
969 UFUNCTION(BlueprintGetter, Category = "Cesium")
970 FString GetUrl() const { return Url; }
971
972 UFUNCTION(BlueprintSetter, Category = "Cesium")
973 void SetUrl(const FString& InUrl);
974
975 UFUNCTION(BlueprintGetter, Category = "Cesium")
976 int64 GetIonAssetID() const { return IonAssetID; }
977
978 UFUNCTION(BlueprintSetter, Category = "Cesium")
979 void SetIonAssetID(int64 InAssetID);
980
981 UFUNCTION(BlueprintGetter, Category = "Cesium")
982 FString GetIonAccessToken() const { return IonAccessToken; }
983
984 UFUNCTION(BlueprintSetter, Category = "Cesium")
985 void SetIonAccessToken(const FString& InAccessToken);
986
987 UFUNCTION(BlueprintGetter, Category = "Cesium")
988 UCesiumIonServer* GetCesiumIonServer() const { return CesiumIonServer; }
989
990 UFUNCTION(BlueprintSetter, Category = "Cesium")
991 void SetCesiumIonServer(UCesiumIonServer* Server);
992
993 UFUNCTION(BlueprintGetter, Category = "Cesium")
994 double GetMaximumScreenSpaceError() { return MaximumScreenSpaceError; }
995
996 UFUNCTION(BlueprintSetter, Category = "Cesium")
997 void SetMaximumScreenSpaceError(double InMaximumScreenSpaceError);
998
999 UFUNCTION(BlueprintGetter, Category = "Cesium|Tile Culling|Experimental")
1000 bool GetEnableOcclusionCulling() const;
1001
1002 UFUNCTION(BlueprintSetter, Category = "Cesium|Tile Culling|Experimental")
1003 void SetEnableOcclusionCulling(bool bEnableOcclusionCulling);
1004
1005 UFUNCTION(BlueprintGetter, Category = "Cesium|Tile Culling|Experimental")
1006 int32 GetOcclusionPoolSize() const { return OcclusionPoolSize; }
1007
1008 UFUNCTION(BlueprintSetter, Category = "Cesium|Tile Culling|Experimental")
1009 void SetOcclusionPoolSize(int32 newOcclusionPoolSize);
1010
1011 UFUNCTION(BlueprintGetter, Category = "Cesium|Tile Culling|Experimental")
1012 bool GetDelayRefinementForOcclusion() const {
1013 return DelayRefinementForOcclusion;
1014 }
1015
1016 UFUNCTION(BlueprintSetter, Category = "Cesium|Tile Culling|Experimental")
1017 void SetDelayRefinementForOcclusion(bool bDelayRefinementForOcclusion);
1018
1019 UFUNCTION(BlueprintGetter, Category = "Cesium|Physics")
1020 bool GetCreatePhysicsMeshes() const { return CreatePhysicsMeshes; }
1021
1022 UFUNCTION(BlueprintSetter, Category = "Cesium|Physics")
1023 void SetCreatePhysicsMeshes(bool bCreatePhysicsMeshes);
1024
1025 UFUNCTION(BlueprintGetter, Category = "Cesium|Navigation")
1026 bool GetCreateNavCollision() const { return CreateNavCollision; }
1027
1028 UFUNCTION(BlueprintSetter, Category = "Cesium|Navigation")
1029 void SetCreateNavCollision(bool bCreateNavCollision);
1030
1031 UFUNCTION(BlueprintGetter, Category = "Cesium|Rendering")
1032 bool GetAlwaysIncludeTangents() const { return AlwaysIncludeTangents; }
1033
1034 UFUNCTION(BlueprintSetter, Category = "Cesium|Rendering")
1035 void SetAlwaysIncludeTangents(bool bAlwaysIncludeTangents);
1036
1037 UFUNCTION(BlueprintGetter, Category = "Cesium|Rendering")
1038 bool GetGenerateSmoothNormals() const { return GenerateSmoothNormals; }
1039
1040 UFUNCTION(BlueprintSetter, Category = "Cesium|Rendering")
1041 void SetGenerateSmoothNormals(bool bGenerateSmoothNormals);
1042
1043 UFUNCTION(BlueprintGetter, Category = "Cesium|Rendering")
1044 bool GetEnableWaterMask() const { return EnableWaterMask; }
1045
1046 UFUNCTION(BlueprintSetter, Category = "Cesium|Rendering")
1047 void SetEnableWaterMask(bool bEnableMask);
1048
1049 UFUNCTION(BlueprintGetter, Category = "Cesium|Rendering")
1050 bool GetIgnoreKhrMaterialsUnlit() const { return IgnoreKhrMaterialsUnlit; }
1051 UFUNCTION(BlueprintSetter, Category = "Cesium|Rendering")
1052 void SetIgnoreKhrMaterialsUnlit(bool bIgnoreKhrMaterialsUnlit);
1053
1054 UFUNCTION(BlueprintGetter, Category = "Cesium|Rendering")
1055 UMaterialInterface* GetMaterial() const { return Material; }
1056
1057 UFUNCTION(BlueprintSetter, Category = "Cesium|Rendering")
1058 void SetMaterial(UMaterialInterface* InMaterial);
1059
1060 UFUNCTION(BlueprintGetter, Category = "Cesium|Rendering")
1061 UMaterialInterface* GetTranslucentMaterial() const {
1062 return TranslucentMaterial;
1063 }
1064
1065 UFUNCTION(BlueprintSetter, Category = "Cesium|Rendering")
1066 void SetTranslucentMaterial(UMaterialInterface* InMaterial);
1067
1068 UFUNCTION(BlueprintGetter, Category = "Cesium|Rendering")
1069 UMaterialInterface* GetWaterMaterial() const { return WaterMaterial; }
1070
1071 UFUNCTION(BlueprintSetter, Category = "Cesium|Rendering")
1072 void SetWaterMaterial(UMaterialInterface* InMaterial);
1073
1074 UFUNCTION(BlueprintGetter, Category = "Rendering")
1075 FCustomDepthParameters GetCustomDepthParameters() const {
1076 return CustomDepthParameters;
1077 }
1078
1079 UFUNCTION(BlueprintSetter, Category = "Rendering")
1080 void SetCustomDepthParameters(FCustomDepthParameters InCustomDepthParameters);
1081
1082 UFUNCTION(BlueprintGetter, Category = "Cesium|Rendering")
1083 FCesiumPointCloudShading GetPointCloudShading() const {
1084 return PointCloudShading;
1085 }
1086
1087 UFUNCTION(BlueprintSetter, Category = "Cesium|Rendering")
1088 void SetPointCloudShading(FCesiumPointCloudShading InPointCloudShading);
1089
1090 UFUNCTION(BlueprintCallable, Category = "Cesium|Rendering")
1091 void PlayMovieSequencer();
1092
1093 UFUNCTION(BlueprintCallable, Category = "Cesium|Rendering")
1094 void StopMovieSequencer();
1095
1096 UFUNCTION(BlueprintCallable, Category = "Cesium|Rendering")
1097 void PauseMovieSequencer();
1098
1108 const glm::dmat4& GetCesiumTilesetToUnrealRelativeWorldTransform() const;
1109
1110 Cesium3DTilesSelection::Tileset* GetTileset() {
1111 return this->_pTileset.Get();
1112 }
1114 return this->_pTileset.Get();
1115 }
1116
1117 const std::optional<FCesiumFeaturesMetadataDescription>&
1119 return this->_featuresMetadataDescription;
1120 }
1121
1122 // AActor overrides (some or most of them should be protected)
1123 virtual bool ShouldTickIfViewportsOnly() const override;
1124 virtual void Tick(float DeltaTime) override;
1125 virtual void BeginDestroy() override;
1126 virtual bool IsReadyForFinishDestroy() override;
1127 virtual void Destroyed() override;
1128 virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
1129 virtual void PostLoad() override;
1130 virtual void Serialize(FArchive& Ar) override;
1131
1133
1134 // UObject overrides
1135#if WITH_EDITOR
1136 virtual void
1137 PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
1138 virtual void PostEditChangeChainProperty(
1139 FPropertyChangedChainEvent& PropertyChangedChainEvent) override;
1140 virtual void PostEditUndo() override;
1141 virtual void PostEditImport() override;
1142#endif
1143
1144protected:
1145 // Called when the game starts or when spawned
1146 virtual void BeginPlay() override;
1147 virtual void OnConstruction(const FTransform& Transform) override;
1148
1153 void PostInitProperties() override;
1154
1155 virtual void NotifyHit(
1156 class UPrimitiveComponent* MyComp,
1157 AActor* Other,
1158 class UPrimitiveComponent* OtherComp,
1159 bool bSelfMoved,
1160 FVector HitLocation,
1161 FVector HitNormal,
1162 FVector NormalImpulse,
1163 const FHitResult& Hit) override;
1164
1165private:
1166 void LoadTileset();
1167 void DestroyTileset();
1168
1169 static Cesium3DTilesSelection::ViewState CreateViewStateFromViewParameters(
1170 const FCesiumCamera& camera,
1171 const glm::dmat4& unrealWorldToTileset,
1172 UCesiumEllipsoid* ellipsoid);
1173
1174 std::vector<FCesiumCamera> GetCameras() const;
1175 std::vector<FCesiumCamera> GetPlayerCameras() const;
1176 std::vector<FCesiumCamera> GetSceneCaptures() const;
1177
1178public:
1187
1188private:
1192 UFUNCTION(CallInEditor)
1193 void HandleOnGeoreferenceEllipsoidChanged(
1194 UCesiumEllipsoid* OldEllipsoid,
1195 UCesiumEllipsoid* NewEllpisoid);
1196
1202 void updateTilesetOptionsFromProperties();
1203
1211 void updateLastViewUpdateResultState(
1213
1220 void
1221 showTilesToRender(const std::vector<Cesium3DTilesSelection::Tile*>& tiles);
1222
1228 void AddFocusViewportDelegate();
1229
1230#if WITH_EDITOR
1231 std::vector<FCesiumCamera> GetEditorCameras() const;
1232
1242 void OnFocusEditorViewportOnThis();
1243
1244 void RuntimeSettingsChanged(
1245 UObject* pObject,
1246 struct FPropertyChangedEvent& changed);
1247#endif
1248
1249private:
1250 TUniquePtr<Cesium3DTilesSelection::Tileset> _pTileset;
1251
1252#ifdef CESIUM_DEBUG_TILE_STATES
1253 TUniquePtr<Cesium3DTilesSelection::DebugTileStateDatabase> _pStateDebug;
1254#endif
1255
1256 std::optional<FCesiumFeaturesMetadataDescription>
1257 _featuresMetadataDescription;
1258
1259 PRAGMA_DISABLE_DEPRECATION_WARNINGS
1260 std::optional<FMetadataDescription> _metadataDescription_DEPRECATED;
1261 PRAGMA_ENABLE_DEPRECATION_WARNINGS
1262
1263 // For debug output
1264 uint32_t _lastTilesRendered;
1265 uint32_t _lastWorkerThreadTileLoadQueueLength;
1266 uint32_t _lastMainThreadTileLoadQueueLength;
1267
1268 uint32_t _lastTilesVisited;
1269 uint32_t _lastCulledTilesVisited;
1270 uint32_t _lastTilesCulled;
1271 uint32_t _lastTilesOccluded;
1272 uint32_t _lastTilesWaitingForOcclusionResults;
1273 uint32_t _lastMaxDepthVisited;
1274
1275 std::chrono::high_resolution_clock::time_point _startTime;
1276
1277 bool _captureMovieMode;
1278 bool _beforeMoviePreloadAncestors;
1279 bool _beforeMoviePreloadSiblings;
1280 int32_t _beforeMovieLoadingDescendantLimit;
1281 bool _beforeMovieUseLodTransitions;
1282
1283 bool _scaleUsingDPI;
1284
1285 // This is used as a workaround for cesium-native#186
1286 //
1287 // The tiles that are no longer supposed to be rendered in the current
1288 // frame, according to ViewUpdateResult::tilesToHideThisFrame,
1289 // are kept in this list, and hidden in the NEXT frame, because some
1290 // internal occlusion culling information from Unreal might prevent
1291 // the tiles that are supposed to be rendered instead from appearing
1292 // immediately.
1293 //
1294 // If we find a way to clear the wrong occlusion information in the
1295 // Unreal Engine, then this field may be removed, and the
1296 // tilesToHideThisFrame may be hidden immediately.
1297 std::vector<Cesium3DTilesSelection::Tile*> _tilesToHideNextFrame;
1298
1299 int32 _tilesetsBeingDestroyed;
1300
1301 friend class UnrealResourcePreparer;
1302 friend class UCesiumGltfPointsComponent;
1303};
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FCompletedLoadTrigger)
The delegate for the Acesium3DTileset::OnTilesetLoaded, which is triggered from UpdateLoadStatus.
FCesium3DTilesetLoadFailure OnCesium3DTilesetLoadFailure
DECLARE_DELEGATE_ThreeParams(FCesiumSampleHeightMostDetailedCallback, ACesium3DTileset *, const TArray< FCesiumSampleHeightResult > &, const TArray< FString > &)
DECLARE_MULTICAST_DELEGATE_OneParam(FCesium3DTilesetLoadFailure, const FCesium3DTilesetLoadFailureDetails &)
The delegate for OnCesium3DTilesetLoadFailure, which is triggered when the tileset encounters a load ...
EApplyDpiScaling
ETilesetSource
@ UMETA
The tileset will be loaded from Cesium Ion using the provided IonAssetID and IonAccessToken.
virtual bool ShouldTickIfViewportsOnly() const override
void UpdateTransformFromCesium()
Update the transforms of the glTF components based on the the transform of the root component.
void PostInitProperties() override
Called after the C++ constructor and after the properties have been initialized, including those load...
virtual void BeginPlay() override
virtual bool IsReadyForFinishDestroy() override
const Cesium3DTilesSelection::Tileset * GetTileset() const
virtual ~ACesium3DTileset()
virtual void Destroyed() override
void UpdateLoadStatus()
virtual void PostLoad() override
virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override
const std::optional< FCesiumFeaturesMetadataDescription > & getFeaturesMetadataDescription() const
virtual void OnConstruction(const FTransform &Transform) override
virtual void BeginDestroy() override
virtual void Serialize(FArchive &Ar) override
virtual void NotifyHit(class UPrimitiveComponent *MyComp, AActor *Other, class UPrimitiveComponent *OtherComp, bool bSelfMoved, FVector HitLocation, FVector HitNormal, FVector NormalImpulse, const FHitResult &Hit) override
virtual void Tick(float DeltaTime) override
Manages custom FCesiumCameras for all ACesium3DTilesets in the world.
Manages credits / atttribution for Cesium data sources.
Controls how global geospatial coordinates are mapped to coordinates in the Unreal Engine level.
Defines a Cesium ion Server.
A camera description that ACesium3DTilesets can use to decide what tiles need to be loaded to suffici...
Options for adjusting how point clouds are rendered using 3D Tiles.