Cesium for Unreal 2.12.0
Loading...
Searching...
No Matches
CesiumSubLevelComponent.h
Go to the documentation of this file.
1// Copyright 2020-2024 CesiumGS, Inc. and Contributors
2
3#pragma once
4
5#include "Components/ActorComponent.h"
6#include "UObject/ObjectMacros.h"
7#include "CesiumSubLevelComponent.generated.h"
8
10class ALevelInstance;
12
46UCLASS(ClassGroup = (Cesium), meta = (BlueprintSpawnableComponent))
47class CESIUMRUNTIME_API UCesiumSubLevelComponent : public UActorComponent {
48 GENERATED_BODY()
49
50public:
59 UFUNCTION(BlueprintGetter, Category = "Cesium")
60 bool GetEnabled() const;
61
70 UFUNCTION(BlueprintSetter, Category = "Cesium")
71 void SetEnabled(bool value);
72
78 UFUNCTION(BlueprintGetter, Category = "Cesium")
79 double GetOriginLongitude() const;
80
86 UFUNCTION(BlueprintSetter, Category = "Cesium")
87 void SetOriginLongitude(double value);
88
94 UFUNCTION(BlueprintGetter, Category = "Cesium")
95 double GetOriginLatitude() const;
96
102 UFUNCTION(BlueprintSetter, Category = "Cesium")
103 void SetOriginLatitude(double value);
104
111 UFUNCTION(BlueprintGetter, Category = "Cesium")
112 double GetOriginHeight() const;
113
120 UFUNCTION(BlueprintSetter, Category = "Cesium")
121 void SetOriginHeight(double value);
122
127 UFUNCTION(BlueprintGetter, Category = "Cesium")
128 double GetLoadRadius() const;
129
134 UFUNCTION(BlueprintSetter, Category = "Cesium")
135 void SetLoadRadius(double value);
136
146 UFUNCTION(BlueprintGetter, Category = "Cesium")
147 TSoftObjectPtr<ACesiumGeoreference> GetGeoreference() const;
148
158 UFUNCTION(BlueprintSetter, Category = "Cesium")
159 void SetGeoreference(TSoftObjectPtr<ACesiumGeoreference> NewGeoreference);
160
166 UFUNCTION(BlueprintGetter, Category = "Cesium")
167 ACesiumGeoreference* GetResolvedGeoreference() const;
168
176 UFUNCTION(BlueprintCallable, Category = "Cesium")
177 ACesiumGeoreference* ResolveGeoreference(bool bForceReresolve = false);
178
186 UFUNCTION(BlueprintCallable, Category = "Cesium")
187 void SetOriginLongitudeLatitudeHeight(const FVector& longitudeLatitudeHeight);
188
189#if WITH_EDITOR
205 UFUNCTION(CallInEditor, Category = "Cesium")
206 void PlaceGeoreferenceOriginAtSubLevelOrigin();
207
229 UFUNCTION(CallInEditor, Category = "Cesium")
230 void PlaceGeoreferenceOriginHere();
231#endif
232
237 void UpdateGeoreferenceIfSubLevelIsActive();
238
239 virtual void BeginDestroy() override;
240 virtual void OnComponentCreated() override;
241
242#if WITH_EDITOR
243 virtual void
244 PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
245#endif
246
247protected:
248 virtual void BeginPlay() override;
249
257 virtual void OnRegister() override;
258
266 virtual void OnUnregister() override;
267
268#if WITH_EDITOR
274 virtual bool CanEditChange(const FProperty* InProperty) const override;
275#endif
276
277private:
286 UPROPERTY(
287 EditAnywhere,
288 BlueprintReadWrite,
289 Category = "Cesium",
290 BlueprintGetter = GetEnabled,
291 BlueprintSetter = SetEnabled,
292 meta = (AllowPrivateAccess = true))
293 bool Enabled = true;
294
300 UPROPERTY(
301 EditAnywhere,
302 BlueprintReadWrite,
303 Category = "Cesium",
304 BlueprintGetter = GetOriginLatitude,
305 BlueprintSetter = SetOriginLatitude,
306 meta = (ClampMin = -90.0, ClampMax = 90.0, AllowPrivateAccess = true))
307 double OriginLatitude = 39.736401;
308
314 UPROPERTY(
315 EditAnywhere,
316 BlueprintReadWrite,
317 Category = "Cesium",
318 BlueprintGetter = GetOriginLongitude,
319 BlueprintSetter = SetOriginLongitude,
320 meta = (ClampMin = -180.0, ClampMax = 180.0, AllowPrivateAccess = true))
321 double OriginLongitude = -105.25737;
322
329 UPROPERTY(
330 EditAnywhere,
331 BlueprintReadWrite,
332 Category = "Cesium",
333 BlueprintGetter = GetOriginHeight,
334 BlueprintSetter = SetOriginHeight,
335 meta = (AllowPrivateAccess = true))
336 double OriginHeight = 2250.0;
337
342 UPROPERTY(
343 EditAnywhere,
344 BlueprintReadWrite,
345 Category = "Cesium",
346 BlueprintGetter = GetLoadRadius,
347 BlueprintSetter = SetLoadRadius,
348 meta = (ClampMin = 0.0, AllowPrivateAccess = true))
349 double LoadRadius = 1000.0;
350
360 UPROPERTY(
361 EditAnywhere,
362 BlueprintReadWrite,
363 BlueprintGetter = GetGeoreference,
364 BlueprintSetter = SetGeoreference,
365 Category = "Cesium",
366 Meta = (AllowPrivateAccess))
367 TSoftObjectPtr<ACesiumGeoreference> Georeference;
368
377 UPROPERTY(
378 Transient,
379 VisibleAnywhere,
380 BlueprintReadOnly,
381 BlueprintGetter = GetResolvedGeoreference,
382 Category = "Cesium",
383 Meta = (AllowPrivateAccess))
384 ACesiumGeoreference* ResolvedGeoreference = nullptr;
385
391 UCesiumSubLevelSwitcherComponent* _getSwitcher() noexcept;
392
398 ALevelInstance* _getLevelInstance() const noexcept;
399
405 void _invalidateResolvedGeoreference();
406
407 void PlaceOriginAtEcef(const FVector& NewOriginEcef);
408};
Controls how global geospatial coordinates are mapped to coordinates in the Unreal Engine level.
Manages the asynchronous switching between sub-levels, making sure that a previous sub-level is hidde...