Cesium for Unreal 2.24.1
Loading...
Searching...
No Matches
CesiumCameraManager.h
Go to the documentation of this file.
1// Copyright 2020-2024 CesiumGS, Inc. and Contributors
2
3#pragma once
4
5#include "Camera/CameraComponent.h"
6#include "CesiumCamera.h"
7#include "Containers/Map.h"
8#include "Engine/SceneCapture2D.h"
9#include "GameFramework/Actor.h"
10
11#include "CesiumCameraManager.generated.h"
12
13/**
14 * @brief Manages custom {@link FCesiumCamera}s for all
15 * {@link ACesium3DTileset}s in the world.
16 */
17UCLASS()
18class CESIUMRUNTIME_API ACesiumCameraManager : public AActor {
19 GENERATED_BODY()
20
21public:
22 /**
23 * @brief Determines whether the cameras attached to PlayerControllers should
24 * be used for Cesium3DTileset culling and level-of-detail.
25 */
26 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cesium")
27 bool UsePlayerCameras = true;
28 /**
29 * @brief Determines whether the camera associated with the Editor's active
30 * scene view should be used for Cesium3DTileset culling and level-of-detail.
31 * In a game, this property has no effect.
32 */
33 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cesium")
34 bool UseEditorCameras = true;
35
36 /**
37 * @brief Whether to find and use all scene captures within the level for
38 * Cesium3DTileset culling and level-of-detail.
39 */
40 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cesium")
42
43 /**
44 * @brief Array of explicit scene capture actors.
45 */
46 UPROPERTY(
47 EditAnywhere,
48 BlueprintReadWrite,
49 Category = "Cesium",
50 Meta = (EditCondition = "!UseSceneCapturesInLevel"))
51 TArray<TObjectPtr<ASceneCapture2D>> SceneCaptures;
52
53 /**
54 * @brief Array of additional cameras.
55 */
56 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cesium")
58
59 /**
60 * @brief Get the camera manager for this world.
61 */
62 UFUNCTION(
63 BlueprintCallable,
64 Category = "CesiumCameraManager",
65 meta = (WorldContext = "WorldContextObject"))
67 GetDefaultCameraManager(const UObject* WorldContextObject);
68
70
71 /**
72 * @brief DEPRECATED
73 * @deprecated The AdditionalCameras array should be used for directly storing
74 * and accessing cameras.
75 */
76 UFUNCTION(
77 BlueprintCallable,
78 Category = "Cesium",
79 Meta =
80 (DeprecatedFunction,
81 DeprecationMessage = "Use the AdditionalCameras array instead."))
82 int32 AddCamera(UPARAM(ref) const FCesiumCamera& Camera);
83
84 /**
85 * @brief DEPRECATED
86 * @deprecated The AdditionalCameras array should be used for directly storing
87 * and accessing cameras.
88 */
89 UFUNCTION(
90 BlueprintCallable,
91 Category = "Cesium",
92 Meta =
93 (DeprecatedFunction,
94 DeprecationMessage = "Use the AdditionalCameras array instead."))
95 bool RemoveCamera(int32 CameraId);
96
97 /**
98 * @brief DEPRECATED
99 * @deprecated The AdditionalCameras array should be used for directly storing
100 * and accessing cameras.
101 */
102 UFUNCTION(
103 BlueprintCallable,
104 Category = "Cesium",
105 Meta =
106 (DeprecatedFunction,
107 DeprecationMessage = "Use the AdditionalCameras array instead."))
108 bool UpdateCamera(int32 CameraId, UPARAM(ref) const FCesiumCamera& Camera);
109
110 /**
111 * @brief DEPRECATED
112 * @deprecated The AdditionalCameras array should be used for directly storing
113 * and accessing cameras.
114 */
115 UFUNCTION(
116 BlueprintCallable,
117 Category = "Cesium",
118 Meta =
119 (DeprecatedFunction,
120 DeprecationMessage = "Use the AdditionalCameras array instead."))
121 const TMap<int32, FCesiumCamera>& GetCameras() const;
122
123 virtual bool ShouldTickIfViewportsOnly() const override;
124
125 virtual void Tick(float DeltaTime) override;
126
127 /**
128 * @brief Return a list of all cameras handled by the manager.
129 */
131
132private:
133 /**
134 * Support for deprecated camera interface.
135 */
136 int32 _currentCameraId = 0;
137 TMap<int32, FCesiumCamera> _cameras;
138
139 static FName DEFAULT_CAMERAMANAGER_TAG;
140};
bool UseSceneCapturesInLevel
Whether to find and use all scene captures within the level for Cesium3DTileset culling and level-of-...
bool RemoveCamera(int32 CameraId)
DEPRECATED.
TArray< TObjectPtr< ASceneCapture2D > > SceneCaptures
Array of explicit scene capture actors.
TArray< FCesiumCamera > AdditionalCameras
Array of additional cameras.
virtual bool ShouldTickIfViewportsOnly() const override
int32 AddCamera(UPARAM(ref) const FCesiumCamera &Camera)
DEPRECATED.
std::vector< FCesiumCamera > GetAllCameras() const
Return a list of all cameras handled by the manager.
const TMap< int32, FCesiumCamera > & GetCameras() const
DEPRECATED.
bool UseEditorCameras
Determines whether the camera associated with the Editor's active scene view should be used for Cesiu...
virtual void Tick(float DeltaTime) override
static ACesiumCameraManager * GetDefaultCameraManager(const UObject *WorldContextObject)
Get the camera manager for this world.
bool UsePlayerCameras
Determines whether the cameras attached to PlayerControllers should be used for Cesium3DTileset culli...
bool UpdateCamera(int32 CameraId, UPARAM(ref) const FCesiumCamera &Camera)
DEPRECATED.
STL namespace.
A camera description that ACesium3DTilesets can use to decide what tiles need to be loaded to suffici...