Cesium for Unreal 2.13.2
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
47/**
48 * The delegate for OnCesium3DTilesetLoadFailure, which is triggered when
49 * the tileset encounters a load error.
50 */
52 FCesium3DTilesetLoadFailure,
54
56 FCesiumSampleHeightMostDetailedCallback,
58 const TArray<FCesiumSampleHeightResult>&,
59 const TArray<FString>&);
60
61/**
62 * The delegate for the Acesium3DTileset::OnTilesetLoaded,
63 * which is triggered from UpdateLoadStatus
64 */
66
67CESIUMRUNTIME_API extern FCesium3DTilesetLoadFailure
69
70UENUM(BlueprintType)
71enum class ETilesetSource : uint8 {
72 /**
73 * The tileset will be loaded from Cesium Ion using the provided IonAssetID
74 * and IonAccessToken.
75 */
76 FromCesiumIon UMETA(DisplayName = "From Cesium Ion"),
77
78 /**
79 * The tileset will be loaded from the specified Url.
80 */
81 FromUrl UMETA(DisplayName = "From Url"),
82
83 /**
84 * The tileset will be loaded from the georeference ellipsoid.
85 */
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
120 /**
121 * @brief Initiates an asynchronous query for the height of this tileset at a
122 * list of cartographic positions, where the Longitude (X) and Latitude (Y)
123 * are given in degrees. The most detailed available tiles are used to
124 * determine each height.
125 *
126 * The height of the input positions is ignored, unless height sampling fails
127 * at that location. The output height is expressed in meters above the
128 * ellipsoid (usually WGS84), which should not be confused with a height above
129 * mean sea level.
130 *
131 * @param LongitudeLatitudeHeightArray The cartographic positions for which to
132 * sample heights. The Longitude (X) and Latitude (Y) are expressed in
133 * degrees, while Height (Z) is given in meters.
134 * @param OnHeightsSampled A callback that is invoked in the game thread when
135 * heights have been sampled for all positions.
136 */
137 void SampleHeightMostDetailed(
138 const TArray<FVector>& LongitudeLatitudeHeightArray,
139 FCesiumSampleHeightMostDetailedCallback OnHeightsSampled);
140
141private:
142 /**
143 * The designated georeference actor controlling how the actor's
144 * coordinate system relates to the coordinate system in this Unreal Engine
145 * level.
146 *
147 * If this is null, the Tileset will find and use the first Georeference
148 * Actor in the level, or create one if necessary. To get the active/effective
149 * Georeference from Blueprints or C++, use ResolvedGeoreference instead.
150 */
151 UPROPERTY(
152 EditAnywhere,
153 BlueprintReadWrite,
154 BlueprintGetter = GetGeoreference,
155 BlueprintSetter = SetGeoreference,
156 Category = "Cesium",
157 Meta = (AllowPrivateAccess))
158 TSoftObjectPtr<ACesiumGeoreference> Georeference;
159
160 /**
161 * The resolved georeference used by this Tileset. This is not serialized
162 * because it may point to a Georeference in the PersistentLevel while this
163 * tileset is in a sublevel. If the Georeference property is specified,
164 * however then this property will have the same value.
165 *
166 * This property will be null before ResolveGeoreference is called.
167 */
168 UPROPERTY(
169 Transient,
170 VisibleAnywhere,
171 BlueprintReadOnly,
172 Category = "Cesium",
173 Meta = (AllowPrivateAccess))
174 ACesiumGeoreference* ResolvedGeoreference = nullptr;
175
176public:
177 /** @copydoc ACesium3DTileset::Georeference */
178 UFUNCTION(BlueprintCallable, Category = "Cesium")
179 TSoftObjectPtr<ACesiumGeoreference> GetGeoreference() const;
180
181 /** @copydoc ACesium3DTileset::Georeference */
182 UFUNCTION(BlueprintCallable, Category = "Cesium")
183 void SetGeoreference(TSoftObjectPtr<ACesiumGeoreference> NewGeoreference);
184
185 /**
186 * Resolves the Cesium Georeference to use with this Actor. Returns
187 * the value of the Georeference property if it is set. Otherwise, finds a
188 * Georeference in the World and returns it, creating it if necessary. The
189 * resolved Georeference is cached so subsequent calls to this function will
190 * return the same instance.
191 */
192 UFUNCTION(BlueprintCallable, Category = "Cesium")
193 ACesiumGeoreference* ResolveGeoreference();
194
195 /**
196 * Invalidates the cached resolved georeference, unsubscribing from it and
197 * setting it to null. The next time ResolveGeoreference is called, the
198 * Georeference will be re-resolved and re-subscribed.
199 */
200 UFUNCTION(BlueprintCallable, Category = "Cesium")
201 void InvalidateResolvedGeoreference();
202
203private:
204 /**
205 * The actor managing this tileset's content attributions.
206 *
207 * If this is null, the Tileset will find and use the first Credit System
208 * Actor in the level, or create one if necessary. To get the active/effective
209 * Credit System from Blueprints or C++, use ResolvedCreditSystem instead.
210 */
211 UPROPERTY(
212 EditAnywhere,
213 BlueprintReadWrite,
214 BlueprintGetter = GetCreditSystem,
215 BlueprintSetter = SetCreditSystem,
216 Category = "Cesium",
217 Meta = (AllowPrivateAccess))
218 TSoftObjectPtr<ACesiumCreditSystem> CreditSystem;
219
220 /**
221 * The resolved Credit System used by this Tileset. This is not serialized
222 * because it may point to a Credit System in the PersistentLevel while this
223 * tileset is in a sublevel. If the CreditSystem property is specified,
224 * however then this property will have the same value.
225 *
226 * This property will be null before ResolveCreditSystem is called.
227 */
228 UPROPERTY(
229 Transient,
230 BlueprintReadOnly,
231 Category = "Cesium",
232 Meta = (AllowPrivateAccess))
233 ACesiumCreditSystem* ResolvedCreditSystem = nullptr;
234
235 /**
236 * The actor providing custom cameras for use with this Tileset.
237 *
238 * If this is null, the Tileset will find and use the first
239 * CesiumCameraManager Actor in the level, or create one if necessary. To get
240 * the active/effective Camera Manager from Blueprints or C++, use
241 * ResolvedCameraManager instead.
242 */
243 UPROPERTY(
244 EditAnywhere,
245 BlueprintReadWrite,
246 BlueprintGetter = GetCameraManager,
247 BlueprintSetter = SetCameraManager,
248 Category = "Cesium",
249 Meta = (AllowPrivateAccess))
250 TSoftObjectPtr<ACesiumCameraManager> CameraManager;
251
252 /**
253 * The resolved Camera Manager used by this Tileset. This is not serialized
254 * because it may point to a Camera Manager in the PersistentLevel while this
255 * tileset is in a sublevel. If the CameraManager property is specified,
256 * however then this property will have the same value.
257 *
258 * This property will be null before ResolveCameraManager is called.
259 */
260 UPROPERTY(
261 Transient,
262 BlueprintReadOnly,
263 Category = "Cesium",
264 Meta = (AllowPrivateAccess))
265 ACesiumCameraManager* ResolvedCameraManager = nullptr;
266
267 /**
268 * The bounding volume pool component that manages occlusion bounding volume
269 * proxies.
270 */
271 UPROPERTY(
272 Transient,
273 BlueprintReadOnly,
274 Category = "Cesium",
275 Meta = (AllowPrivateAccess))
276 UCesiumBoundingVolumePoolComponent* BoundingVolumePoolComponent = nullptr;
277
278 /**
279 * The custom view extension this tileset uses to pull renderer view
280 * information.
281 */
282 TSharedPtr<CesiumViewExtension, ESPMode::ThreadSafe> _cesiumViewExtension =
283 nullptr;
284
285public:
286 /** @copydoc ACesium3DTileset::CreditSystem */
287 UFUNCTION(BlueprintCallable, Category = "Cesium")
288 TSoftObjectPtr<ACesiumCreditSystem> GetCreditSystem() const;
289
290 /** @copydoc ACesium3DTileset::CreditSystem */
291 UFUNCTION(BlueprintCallable, Category = "Cesium")
292 void SetCreditSystem(TSoftObjectPtr<ACesiumCreditSystem> NewCreditSystem);
293
294 /**
295 * Resolves the Cesium Credit System to use with this Actor. Returns
296 * the value of the CreditSystem property if it is set. Otherwise, finds a
297 * Credit System in the World and returns it, creating it if necessary. The
298 * resolved Credit System is cached so subsequent calls to this function will
299 * return the same instance.
300 */
301 UFUNCTION(BlueprintCallable, Category = "Cesium")
302 ACesiumCreditSystem* ResolveCreditSystem();
303
304 /**
305 * Invalidates the cached resolved Credit System, setting it to null. The next
306 * time ResolveCreditSystem is called, the Credit System will be re-resolved.
307 */
308 UFUNCTION(BlueprintCallable, Category = "Cesium")
309 void InvalidateResolvedCreditSystem();
310
311 /**
312 * Whether or not to show this tileset's credits on screen.
313 */
314 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cesium")
315 bool ShowCreditsOnScreen = false;
316
317 /** @copydoc ACesium3DTileset::CameraManager */
318 UFUNCTION(BlueprintGetter, Category = "Cesium")
319 TSoftObjectPtr<ACesiumCameraManager> GetCameraManager() const;
320
321 /** @copydoc ACesium3DTileset::CameraManager */
322 UFUNCTION(BlueprintSetter, Category = "Cesium")
323 void SetCameraManager(TSoftObjectPtr<ACesiumCameraManager> NewCameraManager);
324
325 /**
326 * Resolves the Cesium Camera Manager to use with this Actor. Returns
327 * the value of the CameraManager property if it is set. Otherwise, finds a
328 * Camera Manager in the World and returns it, creating it if necessary. The
329 * resolved Camera Manager is cached so subsequent calls to this function will
330 * return the same instance.
331 */
332 UFUNCTION(BlueprintCallable, Category = "Cesium")
333 ACesiumCameraManager* ResolveCameraManager();
334
335 /**
336 * Invalidates the cached resolved Camera Manager, setting it to null. The
337 * next time ResolveCameraManager is called, the Camera Manager will be
338 * re-resolved.
339 */
340 UFUNCTION(BlueprintCallable, Category = "Cesium")
341 void InvalidateResolvedCameraManager();
342
343 /**
344 * The maximum number of pixels of error when rendering this tileset.
345 *
346 * This is used to select an appropriate level-of-detail: A low value
347 * will cause many tiles with a high level of detail to be loaded,
348 * causing a finer visual representation of the tiles, but with a
349 * higher performance cost for loading and rendering. A higher value will
350 * cause a coarser visual representation, with lower performance
351 * requirements.
352 *
353 * When a tileset uses the older layer.json / quantized-mesh format rather
354 * than 3D Tiles, this value is effectively divided by 8.0. So the default
355 * value of 16.0 corresponds to the standard value for quantized-mesh terrain
356 * of 2.0.
357 */
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
366 /**
367 * Scale Level-of-Detail by Display DPI. This increases the performance for
368 * mobile devices and high DPI screens.
369 */
370 UPROPERTY(
371 EditAnywhere,
372 BlueprintReadWrite,
373 Category = "Cesium|Level of Detail")
375
376 /**
377 * Whether to preload ancestor tiles.
378 *
379 * Setting this to true optimizes the zoom-out experience and provides more
380 * detail in newly-exposed areas when panning. The down side is that it
381 * requires loading more tiles.
382 */
383 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cesium|Tile Loading")
384 bool PreloadAncestors = true;
385
386 /**
387 * Whether to preload sibling tiles.
388 *
389 * Setting this to true causes tiles with the same parent as a rendered tile
390 * to be loaded, even if they are culled. Setting this to true may provide a
391 * better panning experience at the cost of loading more tiles.
392 */
393 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cesium|Tile Loading")
394 bool PreloadSiblings = true;
395
396 /**
397 * Whether to unrefine back to a parent tile when a child isn't done loading.
398 *
399 * When this is set to true, the tileset will guarantee that the tileset will
400 * never be rendered with holes in place of tiles that are not yet loaded,
401 * even though the tile that is rendered instead may have low resolution. When
402 * false, overall loading will be faster, but newly-visible parts of the
403 * tileset may initially be blank.
404 */
405 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cesium|Tile Loading")
406 bool ForbidHoles = false;
407
408 /**
409 * The maximum number of tiles that may be loaded at once.
410 *
411 * When new parts of the tileset become visible, the tasks to load the
412 * corresponding tiles are put into a queue. This value determines how
413 * many of these tasks are processed at the same time. A higher value
414 * may cause the tiles to be loaded and rendered more quickly, at the
415 * cost of a higher network- and processing load.
416 */
417 UPROPERTY(
418 EditAnywhere,
419 BlueprintReadWrite,
420 Category = "Cesium|Tile Loading",
421 meta = (ClampMin = 0))
422 int32 MaximumSimultaneousTileLoads = 20;
423
424 /**
425 * @brief The maximum number of bytes that may be cached.
426 *
427 * Note that this value, even if 0, will never
428 * cause tiles that are needed for rendering to be unloaded. However, if the
429 * total number of loaded bytes is greater than this value, tiles will be
430 * unloaded until the total is under this number or until only required tiles
431 * remain, whichever comes first.
432 */
433 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cesium|Tile Loading")
434 int64 MaximumCachedBytes = 256 * 1024 * 1024;
435
436 /**
437 * The number of loading descendents a tile should allow before deciding to
438 * render itself instead of waiting.
439 *
440 * Setting this to 0 will cause each level of detail to be loaded
441 * successively. This will increase the overall loading time, but cause
442 * additional detail to appear more gradually. Setting this to a high value
443 * like 1000 will decrease the overall time until the desired level of detail
444 * is achieved, but this high-detail representation will appear at once, as
445 * soon as it is loaded completely.
446 */
447 UPROPERTY(
448 EditAnywhere,
449 BlueprintReadWrite,
450 Category = "Cesium|Tile Loading",
451 meta = (ClampMin = 0))
452 int32 LoadingDescendantLimit = 20;
453
454 /**
455 * Whether to cull tiles that are outside the frustum.
456 *
457 * By default this is true, meaning that tiles that are not visible with the
458 * current camera configuration will be ignored. It can be set to false, so
459 * that these tiles are still considered for loading, refinement and
460 * rendering.
461 *
462 * This will cause more tiles to be loaded, but helps to avoid holes and
463 * provides a more consistent mesh, which may be helpful for physics.
464 *
465 * Note that this will always be disabled if UseLodTransitions is set to true.
466 */
467 UPROPERTY(
468 EditAnywhere,
469 BlueprintReadWrite,
470 Category = "Cesium|Tile Culling",
471 Meta = (EditCondition = "!UseLodTransitions", EditConditionHides))
472 bool EnableFrustumCulling = true;
473
474 /**
475 * Whether to cull tiles that are occluded by fog.
476 *
477 * This does not refer to the atmospheric fog of the Unreal Engine,
478 * but to an internal representation of fog: Depending on the height
479 * of the camera above the ground, tiles that are far away (close to
480 * the horizon) will be culled when this flag is enabled.
481 *
482 * Note that this will always be disabled if UseLodTransitions is set to true.
483 */
484 UPROPERTY(
485 EditAnywhere,
486 BlueprintReadWrite,
487 Category = "Cesium|Tile Culling",
488 Meta = (EditCondition = "!UseLodTransitions", EditConditionHides))
489 bool EnableFogCulling = true;
490
491 /**
492 * Whether a specified screen-space error should be enforced for tiles that
493 * are outside the frustum or hidden in fog.
494 *
495 * When "Enable Frustum Culling" and "Enable Fog Culling" are both true, tiles
496 * outside the view frustum or hidden in fog are effectively ignored, and so
497 * their level-of-detail doesn't matter. And in this scenario, this property
498 * is ignored.
499 *
500 * However, when either of those flags are false, these "would-be-culled"
501 * tiles continue to be processed, and the question arises of how to handle
502 * their level-of-detail. When this property is false, refinement terminates
503 * at these tiles, no matter what their current screen-space error. The tiles
504 * are available for physics, shadows, etc., but their level-of-detail may
505 * be very low.
506 *
507 * When set to true, these tiles are refined until they achieve the specified
508 * "Culled Screen Space Error". This allows control over the minimum quality
509 * of these would-be-culled tiles.
510 */
511 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cesium|Tile Culling")
512 bool EnforceCulledScreenSpaceError = false;
513
514 /**
515 * The screen-space error to be enforced for tiles that are outside the view
516 * frustum or hidden in fog.
517 *
518 * When "Enable Frustum Culling" and "Enable Fog Culling" are both true, tiles
519 * outside the view frustum or hidden in fog are effectively ignored, and so
520 * their level-of-detail doesn't matter. And in this scenario, this property
521 * is ignored.
522 *
523 * However, when either of those flags are false, these "would-be-culled"
524 * tiles continue to be processed, and the question arises of how to handle
525 * their level-of-detail. When "Enforce Culled Screen Space Error" is false,
526 * this property is ignored and refinement terminates at these tiles, no
527 * matter what their current screen-space error. The tiles are available for
528 * physics, shadows, etc., but their level-of-detail may be very low.
529 *
530 * When set to true, these tiles are refined until they achieve the
531 * screen-space error specified by this property.
532 */
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
546 /**
547 * Whether to cull tiles that are occluded.
548 *
549 * If this option is disabled, check that "Enable Experimental Occlusion
550 * Culling Feature" is enabled in the Plugins -> Cesium section of the Project
551 * Settings.
552 *
553 * When enabled, this feature will use Unreal's occlusion system to determine
554 * if tiles are actually visible on the screen. For tiles found to be
555 * occluded, the tile will not refine to show descendants, but it will still
556 * be rendered to avoid holes. This results in less tile loads and less GPU
557 * resource usage for dense, high-occlusion scenes like ground-level views in
558 * cities.
559 *
560 * This will not work for tilesets with poorly fit bounding volumes and cause
561 * more draw calls with very few extra culled tiles. When there is minimal
562 * occlusion in a scene, such as with terrain tilesets and applications
563 * focused on top-down views, this feature will yield minimal benefit and
564 * potentially cause needless overhead.
565 */
566 UPROPERTY(
567 EditAnywhere,
568 BlueprintGetter = GetEnableOcclusionCulling,
569 BlueprintSetter = SetEnableOcclusionCulling,
570 Category = "Cesium|Tile Occlusion",
571 meta = (EditCondition = "CanEnableOcclusionCulling"))
572 bool EnableOcclusionCulling = true;
573
574 /**
575 * The number of CesiumBoundingVolumeComponents to use for querying the
576 * occlusion state of traversed tiles.
577 *
578 * Only applicable when EnableOcclusionCulling is enabled.
579 */
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
592 /**
593 * Whether to wait for valid occlusion results before refining tiles.
594 *
595 * Only applicable when EnableOcclusionCulling is enabled. When this option
596 * is enabled, there may be small delays before tiles are refined, but there
597 * may be an overall performance advantage by avoiding loads of descendants
598 * that will be found to be occluded.
599 */
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
610 /**
611 * Refreshes this tileset, ensuring that all materials and other settings are
612 * applied. It is not usually necessary to invoke this, but when
613 * behind-the-scenes changes are made and not reflected in the tileset, this
614 * function can help.
615 */
616 UFUNCTION(CallInEditor, BlueprintCallable, Category = "Cesium")
617 void RefreshTileset();
618
619 /**
620 * Pauses level-of-detail and culling updates of this tileset.
621 */
622 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cesium|Debug")
623 bool SuspendUpdate;
624
625 /**
626 * If true, this tileset is ticked/updated in the editor. If false, is only
627 * ticked while playing (including Play-in-Editor).
628 */
629 UPROPERTY(EditAnywhere, Category = "Cesium|Debug")
630 bool UpdateInEditor = true;
631
632 /**
633 * If true, stats about tile selection are printed to the Output Log.
634 */
635 UPROPERTY(EditAnywhere, Category = "Cesium|Debug")
636 bool LogSelectionStats = false;
637
638 /**
639 * If true, logs stats on the assets in this tileset's shared asset system to
640 * the Output Log.
641 */
642 UPROPERTY(EditAnywhere, Category = "Cesium|Debug")
643 bool LogSharedAssetStats = false;
644
645 /**
646 * If true, draws debug text above each tile being rendered with information
647 * about that tile.
648 */
649 UPROPERTY(EditAnywhere, Category = "Cesium|Debug")
650 bool DrawTileInfo = false;
651
652 /**
653 * Define the collision profile for all the 3D tiles created inside this
654 * actor.
655 */
656 UPROPERTY(
657 EditAnywhere,
658 BlueprintReadOnly,
659 Category = "Collision",
660 meta = (ShowOnlyInnerProperties, SkipUCSModifiedProperties))
661 FBodyInstance BodyInstance;
662
663 /**
664 * A delegate that will be called whenever the tileset is fully loaded.
665 */
666 UPROPERTY(BlueprintAssignable, Category = "Cesium");
667 FCompletedLoadTrigger OnTilesetLoaded;
668
669 /**
670 * Use a dithering effect when transitioning between tiles of different LODs.
671 *
672 * When this is set to true, Frustrum Culling and Fog Culling are always
673 * disabled.
674 */
675 UPROPERTY(
676 EditAnywhere,
677 BlueprintGetter = GetUseLodTransitions,
678 BlueprintSetter = SetUseLodTransitions,
679 Category = "Cesium|Rendering")
680 bool UseLodTransitions = false;
681
682 /**
683 * How long dithered LOD transitions between different tiles should take, in
684 * seconds.
685 *
686 * Only relevant if UseLodTransitions is true.
687 */
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
699 /**
700 * The type of source from which to load this tileset.
701 */
702 UPROPERTY(
703 EditAnywhere,
704 BlueprintGetter = GetTilesetSource,
705 BlueprintSetter = SetTilesetSource,
706 Category = "Cesium",
707 meta = (DisplayName = "Source"))
708 ETilesetSource TilesetSource = ETilesetSource::FromCesiumIon;
709
710 /**
711 * The URL of this tileset's "tileset.json" file.
712 *
713 * If this property is specified, the ion asset ID and token are ignored.
714 */
715 UPROPERTY(
716 EditAnywhere,
717 BlueprintGetter = GetUrl,
718 BlueprintSetter = SetUrl,
719 Category = "Cesium",
720 meta = (EditCondition = "TilesetSource==ETilesetSource::FromUrl"))
721 FString Url = "";
722
723 /**
724 * The ID of the Cesium ion asset to use.
725 *
726 * This property is ignored if the Url is specified.
727 */
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
738 /**
739 * The access token to use to access the Cesium ion resource.
740 */
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
755 /**
756 * The Cesium ion Server from which this tileset is loaded.
757 */
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
767 /**
768 * Headers to be attached to each request made for this tileset.
769 */
770 UPROPERTY(
771 EditAnywhere,
772 BlueprintGetter = GetRequestHeaders,
773 BlueprintSetter = SetRequestHeaders,
774 Category = "Cesium")
775 TMap<FString, FString> RequestHeaders;
776
777 /**
778 * Check if the Cesium ion token used to access this tileset is working
779 * correctly, and fix it if necessary.
780 */
781 UFUNCTION(CallInEditor, Category = "Cesium")
782 void TroubleshootToken();
783
784 /**
785 * Whether to generate physics meshes for this tileset.
786 *
787 * Disabling this option will improve the performance of tile loading, but it
788 * will no longer be possible to collide with the tileset since the physics
789 * meshes will not be created.
790 *
791 * Physics meshes cannot be generated for primitives containing points.
792 */
793 UPROPERTY(
794 EditAnywhere,
795 BlueprintGetter = GetCreatePhysicsMeshes,
796 BlueprintSetter = SetCreatePhysicsMeshes,
797 Category = "Cesium|Physics")
798 bool CreatePhysicsMeshes = true;
799
800 /**
801 * Whether to generate navigation collisions for this tileset.
802 *
803 * Enabling this option creates collisions for navigation when a 3D Tiles
804 * tileset is loaded. It is recommended to set "Runtime Generation" to
805 * "Static" in the navigation mesh settings in the project settings, as
806 * collision calculations become very slow.
807 */
808 UPROPERTY(
809 EditAnywhere,
810 BlueprintGetter = GetCreateNavCollision,
811 BlueprintSetter = SetCreateNavCollision,
812 Category = "Cesium|Navigation")
813 bool CreateNavCollision = false;
814
815 /**
816 * Whether to always generate a correct tangent space basis for tiles that
817 * don't have them.
818 *
819 * Normally, a per-vertex tangent space basis is only required for glTF models
820 * with a normal map. However, a custom, user-supplied material may need a
821 * tangent space basis for other purposes. When this property is set to true,
822 * tiles lacking an explicit tangent vector will have one computed
823 * automatically using the MikkTSpace algorithm. When this property is false,
824 * load time will be improved by skipping the generation of the tangent
825 * vector, but the tangent space basis will be unreliable.
826 *
827 * Note that a tileset with "Enable Water Mask" set will include tangents
828 * for tiles containing water, regardless of the value of this property.
829 */
830 UPROPERTY(
831 EditAnywhere,
832 BlueprintGetter = GetAlwaysIncludeTangents,
833 BlueprintSetter = SetAlwaysIncludeTangents,
834 Category = "Cesium|Rendering")
835 bool AlwaysIncludeTangents = false;
836
837 /**
838 * Whether to generate smooth normals when normals are missing in the glTF.
839 *
840 * According to the Gltf spec: "When normals are not specified, client
841 * implementations should calculate flat normals." However, calculating flat
842 * normals requires duplicating vertices. This option allows the gltfs to be
843 * sent with explicit smooth normals when the original gltf was missing
844 * normals.
845 */
846 UPROPERTY(
847 EditAnywhere,
848 BlueprintGetter = GetGenerateSmoothNormals,
849 BlueprintSetter = SetGenerateSmoothNormals,
850 Category = "Cesium|Rendering")
851 bool GenerateSmoothNormals = false;
852
853 /**
854 * Whether to request and render the water mask.
855 *
856 * Currently only applicable for quantized-mesh tilesets that support the
857 * water mask extension.
858 */
859 UPROPERTY(
860 EditAnywhere,
861 BlueprintGetter = GetEnableWaterMask,
862 BlueprintSetter = SetEnableWaterMask,
863 Category = "Cesium|Rendering")
864 bool EnableWaterMask = false;
865
866 /**
867 * Whether to ignore the KHR_materials_unlit extension on the glTF tiles in
868 * this tileset, if it exists, and instead render with standard lighting and
869 * shadows. This property will have no effect if the tileset does not have any
870 * tiles that use this extension.
871 *
872 * The KHR_materials_unlit extension is often applied to photogrammetry
873 * tilesets because lighting and shadows are already baked into their
874 * textures.
875 */
876 UPROPERTY(
877 EditAnywhere,
878 BlueprintGetter = GetIgnoreKhrMaterialsUnlit,
879 BlueprintSetter = SetIgnoreKhrMaterialsUnlit,
880 Category = "Cesium|Rendering",
881 meta = (DisplayName = "Ignore KHR_materials_unlit"))
882 bool IgnoreKhrMaterialsUnlit = false;
883
884 /**
885 * A custom Material to use to render opaque elements in this tileset, in
886 * order to implement custom visual effects.
887 *
888 * The custom material should generally be created by copying the Material
889 * Instance "MI_CesiumThreeOverlaysAndClipping" and customizing the copy as
890 * desired.
891 */
892 UPROPERTY(
893 EditAnywhere,
894 BlueprintGetter = GetMaterial,
895 BlueprintSetter = SetMaterial,
896 Category = "Cesium|Rendering")
897 UMaterialInterface* Material = nullptr;
898
899 /**
900 * A custom Material to use to render translucent elements of the tileset, in
901 * order to implement custom visual effects.
902 *
903 * The custom material should generally be created by copying the Material
904 * Instance "MI_CesiumThreeOverlaysAndClippingTranslucent" and customizing the
905 * copy as desired. Make sure that its Material Property Overrides -> Blend
906 * Mode is set to "Translucent".
907 */
908 UPROPERTY(
909 EditAnywhere,
910 BlueprintGetter = GetTranslucentMaterial,
911 BlueprintSetter = SetTranslucentMaterial,
912 Category = "Cesium|Rendering")
913 UMaterialInterface* TranslucentMaterial = nullptr;
914
915 /**
916 * A custom Material to use to render this tileset in areas where the
917 * watermask is, in order to implement custom visual effects.
918 * Currently only applicable for quantized-mesh tilesets that support the
919 * water mask extension.
920 *
921 * The custom material should generally be created by copying the Material
922 * Instance "MI_CesiumThreeOverlaysAndClippingAndWater" and customizing the
923 * copy as desired.
924 */
925 UPROPERTY(
926 EditAnywhere,
927 BlueprintGetter = GetWaterMaterial,
928 BlueprintSetter = SetWaterMaterial,
929 Category = "Cesium|Rendering")
930 UMaterialInterface* WaterMaterial = nullptr;
931
932 UPROPERTY(
933 EditAnywhere,
934 BlueprintGetter = GetCustomDepthParameters,
935 BlueprintSetter = SetCustomDepthParameters,
936 Category = "Rendering",
937 meta = (ShowOnlyInnerProperties))
938 FCustomDepthParameters CustomDepthParameters;
939
940 /**
941 * If this tileset contains points, their appearance can be configured with
942 * these point cloud shading parameters.
943 *
944 * These settings are not supported on mobile platforms.
945 */
946 UPROPERTY(
947 EditAnywhere,
948 BlueprintGetter = GetPointCloudShading,
949 BlueprintSetter = SetPointCloudShading,
950 Category = "Cesium|Rendering")
951 FCesiumPointCloudShading PointCloudShading;
952
953protected:
954 UPROPERTY()
955 FString PlatformName;
956
957public:
958 UFUNCTION(BlueprintGetter, Category = "Cesium")
959 float GetLoadProgress() const { return LoadProgress; }
960
961 UFUNCTION(BlueprintGetter, Category = "Cesium")
962 bool GetUseLodTransitions() const { return UseLodTransitions; }
963
964 UFUNCTION(BlueprintSetter, Category = "Cesium")
965 void SetUseLodTransitions(bool InUseLodTransitions);
966
967 UFUNCTION(BlueprintGetter, Category = "Cesium")
968 ETilesetSource GetTilesetSource() const { return TilesetSource; }
969
970 UFUNCTION(BlueprintSetter, Category = "Cesium")
971 void SetTilesetSource(ETilesetSource InSource);
972
973 UFUNCTION(BlueprintGetter, Category = "Cesium")
974 FString GetUrl() const { return Url; }
975
976 UFUNCTION(BlueprintSetter, Category = "Cesium")
977 void SetUrl(const FString& InUrl);
978
979 UFUNCTION(BlueprintGetter, Category = "Cesium")
980 TMap<FString, FString> GetRequestHeaders() const { return RequestHeaders; }
981
982 UFUNCTION(BlueprintSetter, Category = "Cesium")
983 void SetRequestHeaders(const TMap<FString, FString>& InRequestHeaders);
984
985 UFUNCTION(BlueprintGetter, Category = "Cesium")
986 int64 GetIonAssetID() const { return IonAssetID; }
987
988 UFUNCTION(BlueprintSetter, Category = "Cesium")
989 void SetIonAssetID(int64 InAssetID);
990
991 UFUNCTION(BlueprintGetter, Category = "Cesium")
992 FString GetIonAccessToken() const { return IonAccessToken; }
993
994 UFUNCTION(BlueprintSetter, Category = "Cesium")
995 void SetIonAccessToken(const FString& InAccessToken);
996
997 UFUNCTION(BlueprintGetter, Category = "Cesium")
998 UCesiumIonServer* GetCesiumIonServer() const { return CesiumIonServer; }
999
1000 UFUNCTION(BlueprintSetter, Category = "Cesium")
1001 void SetCesiumIonServer(UCesiumIonServer* Server);
1002
1003 UFUNCTION(BlueprintGetter, Category = "Cesium")
1004 double GetMaximumScreenSpaceError() { return MaximumScreenSpaceError; }
1005
1006 UFUNCTION(BlueprintSetter, Category = "Cesium")
1007 void SetMaximumScreenSpaceError(double InMaximumScreenSpaceError);
1008
1009 UFUNCTION(BlueprintGetter, Category = "Cesium|Tile Culling|Experimental")
1010 bool GetEnableOcclusionCulling() const;
1011
1012 UFUNCTION(BlueprintSetter, Category = "Cesium|Tile Culling|Experimental")
1013 void SetEnableOcclusionCulling(bool bEnableOcclusionCulling);
1014
1015 UFUNCTION(BlueprintGetter, Category = "Cesium|Tile Culling|Experimental")
1016 int32 GetOcclusionPoolSize() const { return OcclusionPoolSize; }
1017
1018 UFUNCTION(BlueprintSetter, Category = "Cesium|Tile Culling|Experimental")
1019 void SetOcclusionPoolSize(int32 newOcclusionPoolSize);
1020
1021 UFUNCTION(BlueprintGetter, Category = "Cesium|Tile Culling|Experimental")
1022 bool GetDelayRefinementForOcclusion() const {
1023 return DelayRefinementForOcclusion;
1024 }
1025
1026 UFUNCTION(BlueprintSetter, Category = "Cesium|Tile Culling|Experimental")
1027 void SetDelayRefinementForOcclusion(bool bDelayRefinementForOcclusion);
1028
1029 UFUNCTION(BlueprintGetter, Category = "Cesium|Physics")
1030 bool GetCreatePhysicsMeshes() const { return CreatePhysicsMeshes; }
1031
1032 UFUNCTION(BlueprintSetter, Category = "Cesium|Physics")
1033 void SetCreatePhysicsMeshes(bool bCreatePhysicsMeshes);
1034
1035 UFUNCTION(BlueprintGetter, Category = "Cesium|Navigation")
1036 bool GetCreateNavCollision() const { return CreateNavCollision; }
1037
1038 UFUNCTION(BlueprintSetter, Category = "Cesium|Navigation")
1039 void SetCreateNavCollision(bool bCreateNavCollision);
1040
1041 UFUNCTION(BlueprintGetter, Category = "Cesium|Rendering")
1042 bool GetAlwaysIncludeTangents() const { return AlwaysIncludeTangents; }
1043
1044 UFUNCTION(BlueprintSetter, Category = "Cesium|Rendering")
1045 void SetAlwaysIncludeTangents(bool bAlwaysIncludeTangents);
1046
1047 UFUNCTION(BlueprintGetter, Category = "Cesium|Rendering")
1048 bool GetGenerateSmoothNormals() const { return GenerateSmoothNormals; }
1049
1050 UFUNCTION(BlueprintSetter, Category = "Cesium|Rendering")
1051 void SetGenerateSmoothNormals(bool bGenerateSmoothNormals);
1052
1053 UFUNCTION(BlueprintGetter, Category = "Cesium|Rendering")
1054 bool GetEnableWaterMask() const { return EnableWaterMask; }
1055
1056 UFUNCTION(BlueprintSetter, Category = "Cesium|Rendering")
1057 void SetEnableWaterMask(bool bEnableMask);
1058
1059 UFUNCTION(BlueprintGetter, Category = "Cesium|Rendering")
1060 bool GetIgnoreKhrMaterialsUnlit() const { return IgnoreKhrMaterialsUnlit; }
1061 UFUNCTION(BlueprintSetter, Category = "Cesium|Rendering")
1062 void SetIgnoreKhrMaterialsUnlit(bool bIgnoreKhrMaterialsUnlit);
1063
1064 UFUNCTION(BlueprintGetter, Category = "Cesium|Rendering")
1065 UMaterialInterface* GetMaterial() const { return Material; }
1066
1067 UFUNCTION(BlueprintSetter, Category = "Cesium|Rendering")
1068 void SetMaterial(UMaterialInterface* InMaterial);
1069
1070 UFUNCTION(BlueprintGetter, Category = "Cesium|Rendering")
1071 UMaterialInterface* GetTranslucentMaterial() const {
1072 return TranslucentMaterial;
1073 }
1074
1075 UFUNCTION(BlueprintSetter, Category = "Cesium|Rendering")
1076 void SetTranslucentMaterial(UMaterialInterface* InMaterial);
1077
1078 UFUNCTION(BlueprintGetter, Category = "Cesium|Rendering")
1079 UMaterialInterface* GetWaterMaterial() const { return WaterMaterial; }
1080
1081 UFUNCTION(BlueprintSetter, Category = "Cesium|Rendering")
1082 void SetWaterMaterial(UMaterialInterface* InMaterial);
1083
1084 UFUNCTION(BlueprintGetter, Category = "Rendering")
1085 FCustomDepthParameters GetCustomDepthParameters() const {
1086 return CustomDepthParameters;
1087 }
1088
1089 UFUNCTION(BlueprintSetter, Category = "Rendering")
1090 void SetCustomDepthParameters(FCustomDepthParameters InCustomDepthParameters);
1091
1092 UFUNCTION(BlueprintGetter, Category = "Cesium|Rendering")
1093 FCesiumPointCloudShading GetPointCloudShading() const {
1094 return PointCloudShading;
1095 }
1096
1097 UFUNCTION(BlueprintSetter, Category = "Cesium|Rendering")
1098 void SetPointCloudShading(FCesiumPointCloudShading InPointCloudShading);
1099
1100 UFUNCTION(BlueprintCallable, Category = "Cesium|Rendering")
1101 void PlayMovieSequencer();
1102
1103 UFUNCTION(BlueprintCallable, Category = "Cesium|Rendering")
1104 void StopMovieSequencer();
1105
1106 UFUNCTION(BlueprintCallable, Category = "Cesium|Rendering")
1107 void PauseMovieSequencer();
1108
1109 /**
1110 * This method is not supposed to be called by clients. It is currently
1111 * only required by the UnrealPrepareRendererResources.
1112 *
1113 * @internal
1114 * See {@link
1115 * UCesium3DTilesetRoot::GetCesiumTilesetToUnrealRelativeWorldTransform}.
1116 * @endinternal
1117 */
1118 const glm::dmat4& GetCesiumTilesetToUnrealRelativeWorldTransform() const;
1119
1120 Cesium3DTilesSelection::Tileset* GetTileset() {
1121 return this->_pTileset.Get();
1122 }
1124 return this->_pTileset.Get();
1125 }
1126
1127 const std::optional<FCesiumFeaturesMetadataDescription>&
1129 return this->_featuresMetadataDescription;
1130 }
1131
1132 // AActor overrides (some or most of them should be protected)
1133 virtual bool ShouldTickIfViewportsOnly() const override;
1134 virtual void Tick(float DeltaTime) override;
1135 virtual void BeginDestroy() override;
1136 virtual bool IsReadyForFinishDestroy() override;
1137 virtual void Destroyed() override;
1138 virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
1139 virtual void PostLoad() override;
1140 virtual void Serialize(FArchive& Ar) override;
1141
1143
1144 // UObject overrides
1145#if WITH_EDITOR
1146 virtual void
1147 PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
1148 virtual void PostEditChangeChainProperty(
1149 FPropertyChangedChainEvent& PropertyChangedChainEvent) override;
1150 virtual void PostEditUndo() override;
1151 virtual void PostEditImport() override;
1152 virtual bool CanEditChange(const FProperty* InProperty) const override;
1153#endif
1154
1155protected:
1156 // Called when the game starts or when spawned
1157 virtual void BeginPlay() override;
1158 virtual void OnConstruction(const FTransform& Transform) override;
1159
1160 /**
1161 * Called after the C++ constructor and after the properties have
1162 * been initialized, including those loaded from config.
1163 */
1164 void PostInitProperties() override;
1165
1166 virtual void NotifyHit(
1167 class UPrimitiveComponent* MyComp,
1168 AActor* Other,
1169 class UPrimitiveComponent* OtherComp,
1170 bool bSelfMoved,
1171 FVector HitLocation,
1172 FVector HitNormal,
1173 FVector NormalImpulse,
1174 const FHitResult& Hit) override;
1175
1176private:
1177 void LoadTileset();
1178 void DestroyTileset();
1179
1180 static Cesium3DTilesSelection::ViewState CreateViewStateFromViewParameters(
1181 const FCesiumCamera& camera,
1182 const glm::dmat4& unrealWorldToTileset,
1183 UCesiumEllipsoid* ellipsoid);
1184
1185 std::vector<FCesiumCamera> GetCameras() const;
1186 std::vector<FCesiumCamera> GetPlayerCameras() const;
1187 std::vector<FCesiumCamera> GetSceneCaptures() const;
1188
1189public:
1190 /**
1191 * Update the transforms of the glTF components based on the
1192 * the transform of the root component.
1193 *
1194 * This is supposed to be called during Tick, if the transform of
1195 * the root component has changed since the previous Tick.
1196 */
1198
1199private:
1200 /**
1201 * The event handler for ACesiumGeoreference::OnEllipsoidChanged.
1202 */
1203 UFUNCTION(CallInEditor)
1204 void HandleOnGeoreferenceEllipsoidChanged(
1205 UCesiumEllipsoid* OldEllipsoid,
1206 UCesiumEllipsoid* NewEllpisoid);
1207
1208 /**
1209 * Writes the values of all properties of this actor into the
1210 * TilesetOptions, to take them into account during the next
1211 * traversal.
1212 */
1213 void updateTilesetOptionsFromProperties();
1214
1215 /**
1216 * Update all the "_last..." fields of this instance based
1217 * on the given ViewUpdateResult, printing a log message
1218 * if any value changed.
1219 *
1220 * @param result The ViewUpdateREsult
1221 */
1222 void updateLastViewUpdateResultState(
1224
1225 /**
1226 * Creates the visual representations of the given tiles to
1227 * be rendered in the current frame.
1228 *
1229 * @param tiles The tiles
1230 */
1231 void
1232 showTilesToRender(const std::vector<Cesium3DTilesSelection::Tile*>& tiles);
1233
1234 /**
1235 * Will be called after the tileset is loaded or spawned, to register
1236 * a delegate that calls OnFocusEditorViewportOnThis when this
1237 * tileset is double-clicked
1238 */
1239 void AddFocusViewportDelegate();
1240
1241#if WITH_EDITOR
1242 std::vector<FCesiumCamera> GetEditorCameras() const;
1243
1244 /**
1245 * Will focus all viewports on this tileset.
1246 *
1247 * This is called when double-clicking the tileset in the World Outliner.
1248 * It will move the tileset into the center of the view, *even if* the
1249 * tileset was not visible before, and no geometry has been created yet
1250 * for the tileset: It solely operates on the tile bounding volume that
1251 * was given in the root tile.
1252 */
1253 void OnFocusEditorViewportOnThis();
1254
1255 void RuntimeSettingsChanged(
1256 UObject* pObject,
1257 struct FPropertyChangedEvent& changed);
1258#endif
1259
1260private:
1261 TUniquePtr<Cesium3DTilesSelection::Tileset> _pTileset;
1262
1263#ifdef CESIUM_DEBUG_TILE_STATES
1264 TUniquePtr<Cesium3DTilesSelection::DebugTileStateDatabase> _pStateDebug;
1265#endif
1266
1267 std::optional<FCesiumFeaturesMetadataDescription>
1268 _featuresMetadataDescription;
1269
1270 PRAGMA_DISABLE_DEPRECATION_WARNINGS
1271 std::optional<FMetadataDescription> _metadataDescription_DEPRECATED;
1272 PRAGMA_ENABLE_DEPRECATION_WARNINGS
1273
1274 // For debug output
1275 uint32_t _lastTilesRendered;
1276 uint32_t _lastWorkerThreadTileLoadQueueLength;
1277 uint32_t _lastMainThreadTileLoadQueueLength;
1278
1279 uint32_t _lastTilesVisited;
1280 uint32_t _lastCulledTilesVisited;
1281 uint32_t _lastTilesCulled;
1282 uint32_t _lastTilesOccluded;
1283 uint32_t _lastTilesWaitingForOcclusionResults;
1284 uint32_t _lastMaxDepthVisited;
1285
1286 std::chrono::high_resolution_clock::time_point _startTime;
1287
1288 bool _captureMovieMode;
1289 bool _beforeMoviePreloadAncestors;
1290 bool _beforeMoviePreloadSiblings;
1291 int32_t _beforeMovieLoadingDescendantLimit;
1292 bool _beforeMovieUseLodTransitions;
1293
1294 bool _scaleUsingDPI;
1295
1296 // This is used as a workaround for cesium-native#186
1297 //
1298 // The tiles that are no longer supposed to be rendered in the current
1299 // frame, according to ViewUpdateResult::tilesToHideThisFrame,
1300 // are kept in this list, and hidden in the NEXT frame, because some
1301 // internal occlusion culling information from Unreal might prevent
1302 // the tiles that are supposed to be rendered instead from appearing
1303 // immediately.
1304 //
1305 // If we find a way to clear the wrong occlusion information in the
1306 // Unreal Engine, then this field may be removed, and the
1307 // tilesToHideThisFrame may be hidden immediately.
1308 std::vector<Cesium3DTilesSelection::Tile*> _tilesToHideNextFrame;
1309
1310 int32 _tilesetsBeingDestroyed;
1311
1312 friend class UnrealPrepareRendererResources;
1313 friend class UCesiumGltfPointsComponent;
1314};
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.