Cesium for Unreal 2.24.1
Loading...
Searching...
No Matches
CesiumGlobeAnchorComponent.h
Go to the documentation of this file.
1// Copyright 2020-2024 CesiumGS, Inc. and Contributors
2
3#pragma once
4
5#include "CesiumGeospatial/GlobeAnchor.h"
6#include "Components/ActorComponent.h"
7#include "Delegates/IDelegateInstance.h"
8#include "CesiumGlobeAnchorComponent.generated.h"
9
11
12/**
13 * This component can be added to a movable actor to anchor it to the globe
14 * and maintain precise placement. When the owning actor is transformed through
15 * normal Unreal Engine mechanisms, the internal geospatial coordinates will be
16 * automatically updated. The actor position can also be set in terms of
17 * Earth-Centered, Earth-Fixed coordinates (ECEF) or Longitude, Latitude, and
18 * Height relative to the ellipsoid.
19 */
20UCLASS(ClassGroup = Cesium, Meta = (BlueprintSpawnableComponent))
21class CESIUMRUNTIME_API UCesiumGlobeAnchorComponent : public UActorComponent {
22 GENERATED_BODY()
23
24#pragma region Properties
25private:
26 /**
27 * The designated georeference actor controlling how the owning actor's
28 * coordinate system relates to the coordinate system in this Unreal Engine
29 * level.
30 *
31 * If this is null, the Component will find and use the first Georeference
32 * Actor in the level, or create one if necessary. To get the active/effective
33 * Georeference from Blueprints or C++, use ResolvedGeoreference instead.
34 *
35 * If setting this property changes the CesiumGeoreference, the globe position
36 * will be maintained and the Actor's transform will be updated according to
37 * the new CesiumGeoreference.
38 */
39 UPROPERTY(
40 EditAnywhere,
41 BlueprintReadWrite,
42 BlueprintGetter = GetGeoreference,
43 BlueprintSetter = SetGeoreference,
44 Category = "Cesium",
45 Meta = (AllowPrivateAccess))
46 TSoftObjectPtr<ACesiumGeoreference> Georeference = nullptr;
47
48 /**
49 * The resolved georeference used by this component. This is not serialized
50 * because it may point to a Georeference in the PersistentLevel while this
51 * component is in a sub-level. If the Georeference property is specified,
52 * however then this property will have the same value.
53 *
54 * This property will be null before ResolveGeoreference is called, which
55 * happens automatically when the component is registered.
56 */
57 UPROPERTY(
58 Transient,
59 VisibleAnywhere,
60 BlueprintReadOnly,
61 BlueprintGetter = GetResolvedGeoreference,
62 Category = "Cesium",
63 Meta = (AllowPrivateAccess))
64 ACesiumGeoreference* ResolvedGeoreference = nullptr;
65
66 /**
67 * Whether to adjust the Actor's orientation based on globe curvature as the
68 * Actor moves.
69 *
70 * The Earth is not flat, so as we move across its surface, the direction of
71 * "up" changes. If we ignore this fact and leave an object's orientation
72 * unchanged as it moves over the globe surface, the object will become
73 * increasingly tilted and eventually be completely upside-down when we arrive
74 * at the opposite side of the globe.
75 *
76 * When this setting is enabled, this Component will automatically apply a
77 * rotation to the Actor to account for globe curvature any time the Actor's
78 * position on the globe changes.
79 *
80 * This property should usually be enabled, but it may be useful to disable it
81 * when your application already accounts for globe curvature itself when it
82 * updates an Actor's position and orientation, because in that case the Actor
83 * would be over-rotated.
84 */
85 UPROPERTY(
86 EditAnywhere,
87 BlueprintReadWrite,
90 Category = "Cesium",
91 Meta = (AllowPrivateAccess))
92 bool AdjustOrientationForGlobeWhenMoving = true;
93
94 /**
95 * Whether to automatically detect changes in the Actor's root transform and
96 * update the precise globe coordinates accordingly.
97 *
98 * When this is property is false, the precise coordinates may become out of
99 * sync with the Actor's root transform. However, you can still directly set
100 * the precise coordinates, and its transform will update accordingly. You can
101 * also call Sync after changing the Actor's transform to manually update the
102 * precise coordinates.
103 */
104 UPROPERTY(
105 EditAnywhere,
106 BlueprintReadWrite,
107 BlueprintGetter = GetDetectTransformChanges,
108 BlueprintSetter = SetDetectTransformChanges,
109 Category = "Cesium",
110 Meta = (AllowPrivateAccess))
111 bool DetectTransformChanges = true;
112
113 /**
114 * Using the teleport flag will move objects to the updated transform
115 * immediately and without affecting their velocity. This is useful when
116 * working with physics actors that maintain an internal velocity which we do
117 * not want to change when updating location.
118 */
119 UPROPERTY(
120 EditAnywhere,
121 BlueprintReadWrite,
122 BlueprintGetter = GetTeleportWhenUpdatingTransform,
123 BlueprintSetter = SetTeleportWhenUpdatingTransform,
124 Category = "Cesium",
125 Meta = (AllowPrivateAccess))
126 bool TeleportWhenUpdatingTransform = true;
127
128 /**
129 * The 4x4 transformation matrix from the Actor's local coordinate system to
130 * the Earth-Centered, Earth-Fixed (ECEF) coordinate system.
131 *
132 * The ECEF coordinate system is a right-handed system located at the center
133 * of the Earth. The +X axis points to the intersection of the Equator and
134 * Prime Meridian (zero degrees longitude). The +Y axis points to the
135 * intersection of the Equator and +90 degrees longitude. The +Z axis points
136 * up through the North Pole.
137 *
138 * If `AdjustOrientationForGlobeWhenMoving` is enabled and this property is
139 * set, the Actor's orientation will also be adjusted to account for globe
140 * curvature.
141 */
142 UPROPERTY(
143 BlueprintReadWrite,
146 Category = "Cesium",
147 Meta = (AllowPrivateAccess))
148 FMatrix ActorToEarthCenteredEarthFixedMatrix;
149
150#pragma endregion
151
152#pragma region Property Accessors
153public:
154 /**
155 * Gets the designated georeference actor controlling how the owning actor's
156 * coordinate system relates to the coordinate system in this Unreal Engine
157 * level.
158 *
159 * If this is null, the Component will find and use the first Georeference
160 * Actor in the level, or create one if necessary. To get the active/effective
161 * Georeference from Blueprints or C++, use ResolvedGeoreference instead.
162 */
163 UFUNCTION(BlueprintGetter)
164 TSoftObjectPtr<ACesiumGeoreference> GetGeoreference() const;
165
166 /**
167 * Sets the designated georeference actor controlling how the owning actor's
168 * coordinate system relates to the coordinate system in this Unreal Engine
169 * level.
170 *
171 * If this is null, the Component will find and use the first Georeference
172 * Actor in the level, or create one if necessary. To get the active/effective
173 * Georeference from Blueprints or C++, use ResolvedGeoreference instead.
174 */
175 UFUNCTION(BlueprintSetter)
176 void SetGeoreference(TSoftObjectPtr<ACesiumGeoreference> NewGeoreference);
177
178 /**
179 * Gets the resolved georeference used by this component. This is not
180 * serialized because it may point to a Georeference in the PersistentLevel
181 * while this component is in a sub-level. If the Georeference property is
182 * manually specified, however, then this property will have the same value.
183 *
184 * This property will be null before ResolveGeoreference is called, which
185 * happens automatically when the component is registered.
186 */
187 UFUNCTION(BlueprintGetter)
189
190 /**
191 * Resolves the Cesium Georeference to use with this Component. Returns
192 * the value of the Georeference property if it is set. Otherwise, finds a
193 * Georeference in the World and returns it, creating it if necessary. The
194 * resolved Georeference is cached so subsequent calls to this function will
195 * return the same instance, unless ForceReresolve is true.
196 */
197 UFUNCTION(BlueprintCallable, Category = "Cesium")
198 ACesiumGeoreference* ResolveGeoreference(bool bForceReresolve = false);
199
200 /**
201 * Obtains the {@link UCesiumEllipsoid} set on the georeference used by this
202 * component.
203 */
204 UFUNCTION(BlueprintGetter, Category = "Cesium")
206
207 /**
208 * Gets the 4x4 transformation matrix from the Actor's local coordinate
209 * system to the Earth-Centered, Earth-Fixed (ECEF) coordinate system.
210 *
211 * The ECEF coordinate system is a right-handed system located at the center
212 * of the Earth. The +X axis points to the intersection of the Equator and
213 * Prime Meridian (zero degrees longitude). The +Y axis points to the
214 * intersection of the Equator and +90 degrees longitude. The +Z axis points
215 * up through the North Pole.
216 */
217 UFUNCTION(BlueprintGetter, Category = "Cesium")
219
220 /**
221 * Sets the 4x4 transformation matrix from the Actor's local coordinate
222 * system to the Earth-Centered, Earth-Fixed (ECEF) coordinate system.
223 *
224 * The ECEF coordinate system is a right-handed system located at the center
225 * of the Earth. The +X axis points to the intersection of the Equator and
226 * Prime Meridian (zero degrees longitude). The +Y axis points to the
227 * intersection of the Equator and +90 degrees longitude. The +Z axis points
228 * up through the North Pole.
229 *
230 * If `AdjustOrientationForGlobeWhenMoving` is enabled, the Actor's
231 * orientation will also be adjusted to account for globe curvature.
232 */
233 UFUNCTION(BlueprintSetter, Category = "Cesium")
234 void SetActorToEarthCenteredEarthFixedMatrix(const FMatrix& Value);
235
236 /**
237 * Gets a flag indicating whether to move objects to the updated transform
238 * immediately and without affecting their velocity. This is useful when
239 * working with physics actors that maintain an internal velocity which we do
240 * not want to change when updating location.
241 */
242 UFUNCTION(BlueprintGetter, Category = "Cesium")
244
245 /**
246 * Sets a flag indicating whether to move objects to the updated transform
247 * immediately and without affecting their velocity. This is useful when
248 * working with physics actors that maintain an internal velocity which we do
249 * not want to change when updating location.
250 */
251 UFUNCTION(BlueprintSetter, Category = "Cesium")
253
254 /**
255 * Gets a flag indicating whether to adjust the Actor's orientation based on
256 * globe curvature as the Actor moves.
257 *
258 * The Earth is not flat, so as we move across its surface, the direction of
259 * "up" changes. If we ignore this fact and leave an object's orientation
260 * unchanged as it moves over the globe surface, the object will become
261 * increasingly tilted and eventually be completely upside-down when we arrive
262 * at the opposite side of the globe.
263 *
264 * When this setting is enabled, this Component will automatically apply a
265 * rotation to the Actor to account for globe curvature any time the Actor's
266 * position on the globe changes.
267 *
268 * This property should usually be enabled, but it may be useful to disable it
269 * when your application already accounts for globe curvature itself when it
270 * updates an Actor's position and orientation, because in that case the Actor
271 * would be over-rotated.
272 */
273 UFUNCTION(BlueprintGetter, Category = "Cesium")
275
276 /**
277 * Sets a flag indicating whether to adjust the Actor's orientation based on
278 * globe curvature as the Actor moves.
279 *
280 * The Earth is not flat, so as we move across its surface, the direction of
281 * "up" changes. If we ignore this fact and leave an object's orientation
282 * unchanged as it moves over the globe surface, the object will become
283 * increasingly tilted and eventually be completely upside-down when we arrive
284 * at the opposite side of the globe.
285 *
286 * When this setting is enabled, this Component will automatically apply a
287 * rotation to the Actor to account for globe curvature any time the Actor's
288 * position on the globe changes.
289 *
290 * This property should usually be enabled, but it may be useful to disable it
291 * when your application already accounts for globe curvature itself when it
292 * updates an Actor's position and orientation, because in that case the Actor
293 * would be over-rotated.
294 */
295 UFUNCTION(BlueprintSetter, Category = "Cesium")
297
298 /**
299 * Gets a flag indicating whether to update the globe anchor when the Actor's
300 * transform changes.
301 *
302 * This property should usually be enabled, but it may be useful to disable it
303 * for performance reasons.
304 */
305 UFUNCTION(BlueprintGetter, Category = "Cesium")
307
308 /**
309 * Sets a flag indicating whether to update the globe anchor when the Actor's
310 * transform changes.
311 *
312 * This property should usually be enabled, but it may be useful to disable it
313 * for performance reasons.
314 */
315
316 UFUNCTION(BlueprintSetter, Category = "Cesium")
318
319#pragma endregion
320
321#pragma region Public Methods
322
323public:
324 /**
325 * Gets the longitude in degrees (X), latitude in degrees (Y),
326 * and height in meters above the ellipsoid (Z) of the actor.
327 *
328 * Do not confuse the ellipsoid height with a geoid height or height above
329 * mean sea level, which can be tens of meters higher or lower depending on
330 * where in the world the object is located.
331 */
332 UFUNCTION(
333 BlueprintPure,
334 Category = "Cesium",
335 Meta = (ReturnDisplayName = "LongitudeLatitudeHeight"))
337
338 /**
339 * Gets the longitude in degrees.
340 */
341 UFUNCTION(
342 BlueprintPure,
343 Category = "Cesium",
344 Meta = (ReturnDisplayName = "Longitude"))
345 double GetLongitude() const { return this->GetLongitudeLatitudeHeight().X; }
346
347 /**
348 * Gets the latitude in degrees.
349 */
350 UFUNCTION(
351 BlueprintPure,
352 Category = "Cesium",
353 Meta = (ReturnDisplayName = "Latitude"))
354 double GetLatitude() const { return this->GetLongitudeLatitudeHeight().Y; }
355
356 /**
357 * Gets the height in meters above the ellipsoid.
358 *
359 * Do not confuse the ellipsoid height with a geoid height or height above
360 * mean sea level, which can be tens of meters higher or lower depending on
361 * where in the world the object is located.
362 */
363 UFUNCTION(
364 BlueprintPure,
365 Category = "Cesium",
366 Meta = (ReturnDisplayName = "Height"))
367 double GetHeight() const { return this->GetLongitudeLatitudeHeight().Z; }
368
369 /**
370 * Moves the Actor to which this component is attached to a given longitude in
371 * degrees (X), latitude in degrees (Y), and height in meters (Z).
372 *
373 * The Height (Z) is measured in meters above the ellipsoid. Do not
374 * confused an ellipsoidal height with a geoid height or height above mean sea
375 * level, which can be tens of meters higher or lower depending on where in
376 * the world the object is located.
377 *
378 * If `AdjustOrientationForGlobeWhenMoving` is enabled, the Actor's
379 * orientation will also be adjusted to account for globe curvature.
380 */
381 UFUNCTION(BlueprintCallable, Category = "Cesium")
382 void MoveToLongitudeLatitudeHeight(const FVector& LongitudeLatitudeHeight);
383
384 /**
385 * Gets the Earth-Centered, Earth-Fixed (ECEF) coordinates of the Actor in
386 * meters.
387 */
388 UFUNCTION(
389 BlueprintPure,
390 Category = "Cesium",
391 meta = (ReturnDisplayName = "EarthCenteredEarthFixedPosition"))
393
394 /**
395 * Moves the Actor to which this component is attached to a given globe
396 * position in Earth-Centered, Earth-Fixed coordinates in meters.
397 *
398 * If AdjustOrientationForGlobeWhenMoving is enabled, this method will
399 * also update the orientation based on the globe curvature.
400 *
401 * @param EarthCenteredEarthFixedPosition The new position.
402 */
403 UFUNCTION(BlueprintCallable, Category = "Cesium")
405 const FVector& EarthCenteredEarthFixedPosition);
406
407 /**
408 * Gets the rotation of the Actor relative to a local coordinate system
409 * centered on this object where the +X points in the local East direction,
410 * the +Y axis points in the local South direction, and the +Z axis points in
411 * the local Up direction.
412 */
413 UFUNCTION(
414 BlueprintPure,
415 Category = "Cesium",
416 meta = (ReturnDisplayName = "EastSouthUpRotation"))
418
419 /**
420 * Sets the rotation of the Actor relative to a local coordinate system
421 * centered on this object where the +X points in the local East direction,
422 * the +Y axis points in the local South direction, and the +Z axis points in
423 * the local Up direction.
424 *
425 * When the rotation is set via this method, it is internally converted to
426 * and stored in the ActorToEarthCenteredEarthFixedMatrix property. As a
427 * result, getting this property will not necessarily return the exact value
428 * that was set.
429 */
430 UFUNCTION(BlueprintCallable, Category = "Cesium")
431 void SetEastSouthUpRotation(const FQuat& EastSouthUpRotation);
432
433 /**
434 * Gets the rotation of the Actor relative to the Earth-Centered, Earth-Fixed
435 * (ECEF) coordinate system.
436 *
437 * The ECEF coordinate system is a right-handed system located at the center
438 * of the Earth. The +X axis points from there to the intersection of the
439 * Equator and Prime Meridian (zero degrees longitude). The +Y axis points to
440 * the intersection of the Equator and +90 degrees longitude. The +Z axis
441 * points up through the North Pole.
442 */
443 UFUNCTION(
444 BlueprintPure,
445 Category = "Cesium",
446 meta = (ReturnDisplayName = "EarthCenteredEarthFixedRotation"))
448
449 /**
450 * Sets the rotation of the Actor relative to the Earth-Centered, Earth-Fixed
451 * (ECEF) coordinate system.
452 *
453 * The ECEF coordinate system is a right-handed system located at the center
454 * of the Earth. The +X axis points from there to the intersection of the
455 * Equator and Prime Meridian (zero degrees longitude). The +Y axis points to
456 * the intersection of the Equator and +90 degrees longitude. The +Z axis
457 * points up through the North Pole.
458 */
459 UFUNCTION(BlueprintCallable, Category = "Cesium")
461 const FQuat& EarthCenteredEarthFixedRotation);
462
463 /**
464 * Rotates the Actor so that its local +Z axis is aligned with the ellipsoid
465 * surface normal at its current location.
466 */
467 UFUNCTION(BlueprintCallable, Category = "Cesium")
469
470 /**
471 * Rotates the Actor so that its +X axis points in the local East direction,
472 * its +Y axis points in the local South direction, and its +Z axis points in
473 * the local Up direction.
474 */
475 UFUNCTION(BlueprintCallable, Category = "Cesium")
477
478 /**
479 * Synchronizes the properties of this globe anchor.
480 *
481 * It is usually not necessary to call this method because it is called
482 * automatically when needed.
483 *
484 * This method performs the following actions:
485 *
486 * - If the ActorToEarthCenteredEarthFixedMatrix has not yet been
487 * determined, it is computed from the Actor's current root transform.
488 * - If the Actor's root transform has changed since the last time this
489 * component was registered, this method updates the
490 * ActorToEarthCenteredEarthFixedMatrix from the current transform.
491 * - If the origin of the CesiumGeoreference has changed, the Actor's root
492 * transform is updated based on the ActorToEarthCenteredEarthFixedMatrix and
493 * the new georeference origin.
494 * - This synchronization works even if DetectTransformChanges is false.
495 */
496 UFUNCTION(BlueprintCallable, Category = "Cesium")
497 void Sync();
498
499#pragma endregion
500
501#pragma region Obsolete
502public:
503 /**
504 * @brief DEPRECATED
505 * @deprecated The resolved georeference can no longer be explicitly
506 * invalidated. To change the georeference, call SetGeoreference or
507 * ReregisterComponent.
508 */
509 UE_DEPRECATED(
510 "Cesium For Unreal v2.0",
511 "The resolved georeference can no longer be explicitly invalidated. To change the georeference, call SetGeoreference or ReregisterComponent.")
512 UFUNCTION(
513 BlueprintCallable,
514 Category = "Cesium",
515 Meta =
516 (DeprecatedFunction,
517 DeprecationMessage =
518 "The resolved georeference can no longer be explicitly invalidated. To change the georeference, call SetGeoreference or ReregisterComponent."))
520#pragma endregion
521
522#pragma region Unreal Lifecycle
523protected:
524 /**
525 * Handles reading, writing, and reference collecting using FArchive.
526 * This implementation handles all FProperty serialization, but can be
527 * overridden for native variables.
528 *
529 * This class overrides this method to ensure internal variables are
530 * immediately synchronized with newly-loaded values.
531 */
532 virtual void Serialize(FArchive& Ar) override;
533
534 /**
535 * Called when a component is created (not loaded). This can happen in the
536 * editor or during gameplay.
537 *
538 * This method is invoked after this component is pasted and just prior to
539 * registration. We mark the globe transform invalid here because we can't
540 * assume the globe transform is still valid when the component is pasted into
541 * another Actor, or even if the Actor was changed since the Component was
542 * copied.
543 */
544 virtual void OnComponentCreated() override;
545
546#if WITH_EDITOR
547 virtual void
548 PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
549#endif
550
551 /**
552 * Called when a component is registered. This can be viewed as "enabling"
553 * this Component on the Actor to which it is attached.
554 *
555 * In the Editor, this is called in a many different situations, such as on
556 * changes to properties.
557 */
558 virtual void OnRegister() override;
559
560 /**
561 * Called when a component is unregistered. This can be viewed as
562 * "disabling" this Component on the Actor to which it is attached.
563 *
564 * In the Editor, this is called in a many different situations, such as on
565 * changes to properties.
566 */
567 virtual void OnUnregister() override;
568#pragma endregion
569
570#pragma region Implementation Details
571private:
572 CesiumGeospatial::GlobeAnchor _createNativeGlobeAnchor() const;
573
574 USceneComponent* _getRootComponent(bool warnIfNull) const;
575
576 FTransform _getCurrentRelativeTransform() const;
577
578 void _setCurrentRelativeTransform(const FTransform& relativeTransform);
579
581 _createOrUpdateNativeGlobeAnchorFromRelativeTransform(
582 const FTransform& newRelativeTransform);
583
585 _createOrUpdateNativeGlobeAnchorFromECEF(const FMatrix& newActorToECEFMatrix);
586
587 void _updateFromNativeGlobeAnchor(
588 const CesiumGeospatial::GlobeAnchor& nativeAnchor);
589
590 void _setNewActorToECEFFromRelativeTransform();
591
592#if WITH_EDITORONLY_DATA
593 // This is used only to preserve the transformation saved by old versions of
594 // Cesium for Unreal. See the Serialize method.
595 UPROPERTY(Meta = (DeprecatedProperty))
596 double _actorToECEF_Array_DEPRECATED[16];
597#endif
598
599 /**
600 * True if the globe transform is a valid and correct representation of the
601 * position and orientation of this Actor. False if the globe transform has
602 * not yet been computed and so the Actor transform is the only valid
603 * representation of the Actor's position and orientation.
604 */
605 UPROPERTY()
606 bool _actorToECEFIsValid = false;
607
608 /**
609 * Whether an update of the actor transform is currently in progress,
610 * and further calls that are received by _onActorTransformChanged
611 * should be ignored
612 */
613 bool _updatingActorTransform = false;
614
615 bool _lastRelativeTransformIsValid = false;
616 FTransform _lastRelativeTransform{};
617
618 /**
619 * Called when the root transform of the Actor to which this Component is
620 * attached has changed. So:
621 * * The globe (ECEF) position and orientation are computed from the new
622 * transform.
623 * * When `AdjustOrientationForGlobeWhenMoving` is enabled, the orientation
624 * will also be adjusted for globe curvature.
625 */
626 void _onActorTransformChanged(
627 USceneComponent* InRootComponent,
628 EUpdateTransformFlags UpdateTransformFlags,
629 ETeleportType Teleport);
630
631 /**
632 * Called when the Component switches to a new Georeference Actor or the
633 * existing Georeference is given a new origin Longitude, Latitude, or
634 * Height. The Actor's position and orientation are recomputed from the
635 * Component's globe (ECEF) position and orientation.
636 */
637 UFUNCTION(CallInEditor)
638 void _onGeoreferenceChanged();
639
641#pragma endregion
642};
Controls how global geospatial coordinates are mapped to coordinates in the Unreal Engine level.
This component can be added to a movable actor to anchor it to the globe and maintain precise placeme...
void MoveToLongitudeLatitudeHeight(const FVector &LongitudeLatitudeHeight)
Moves the Actor to which this component is attached to a given longitude in degrees (X),...
FVector GetLongitudeLatitudeHeight() const
Gets the longitude in degrees (X), latitude in degrees (Y), and height in meters above the ellipsoid ...
FQuat GetEastSouthUpRotation() const
Gets the rotation of the Actor relative to a local coordinate system centered on this object where th...
FVector GetEarthCenteredEarthFixedPosition() const
Gets the Earth-Centered, Earth-Fixed (ECEF) coordinates of the Actor in meters.
void SetEastSouthUpRotation(const FQuat &EastSouthUpRotation)
Sets the rotation of the Actor relative to a local coordinate system centered on this object where th...
virtual void OnUnregister() override
Called when a component is unregistered.
double GetHeight() const
Gets the height in meters above the ellipsoid.
virtual void OnComponentCreated() override
Called when a component is created (not loaded).
void SetGeoreference(TSoftObjectPtr< ACesiumGeoreference > NewGeoreference)
Sets the designated georeference actor controlling how the owning actor's coordinate system relates t...
void SetDetectTransformChanges(bool Value)
Sets a flag indicating whether to update the globe anchor when the Actor's transform changes.
void MoveToEarthCenteredEarthFixedPosition(const FVector &EarthCenteredEarthFixedPosition)
Moves the Actor to which this component is attached to a given globe position in Earth-Centered,...
FMatrix GetActorToEarthCenteredEarthFixedMatrix() const
Gets the 4x4 transformation matrix from the Actor's local coordinate system to the Earth-Centered,...
virtual void Serialize(FArchive &Ar) override
Handles reading, writing, and reference collecting using FArchive.
void SetAdjustOrientationForGlobeWhenMoving(bool Value)
Sets a flag indicating whether to adjust the Actor's orientation based on globe curvature as the Acto...
bool GetTeleportWhenUpdatingTransform() const
Gets a flag indicating whether to move objects to the updated transform immediately and without affec...
void Sync()
Synchronizes the properties of this globe anchor.
void SnapLocalUpToEllipsoidNormal()
Rotates the Actor so that its local +Z axis is aligned with the ellipsoid surface normal at its curre...
void SetActorToEarthCenteredEarthFixedMatrix(const FMatrix &Value)
Sets the 4x4 transformation matrix from the Actor's local coordinate system to the Earth-Centered,...
virtual void OnRegister() override
Called when a component is registered.
TSoftObjectPtr< ACesiumGeoreference > GetGeoreference() const
Gets the designated georeference actor controlling how the owning actor's coordinate system relates t...
void SetTeleportWhenUpdatingTransform(bool Value)
Sets a flag indicating whether to move objects to the updated transform immediately and without affec...
void SetEarthCenteredEarthFixedRotation(const FQuat &EarthCenteredEarthFixedRotation)
Sets the rotation of the Actor relative to the Earth-Centered, Earth-Fixed (ECEF) coordinate system.
void InvalidateResolvedGeoreference()
DEPRECATED.
bool GetDetectTransformChanges() const
Gets a flag indicating whether to update the globe anchor when the Actor's transform changes.
void SnapToEastSouthUp()
Rotates the Actor so that its +X axis points in the local East direction, its +Y axis points in the l...
bool GetAdjustOrientationForGlobeWhenMoving() const
Gets a flag indicating whether to adjust the Actor's orientation based on globe curvature as the Acto...
UCesiumEllipsoid * GetEllipsoid() const
Obtains the UCesiumEllipsoid set on the georeference used by this component.
ACesiumGeoreference * GetResolvedGeoreference() const
Gets the resolved georeference used by this component.
FQuat GetEarthCenteredEarthFixedRotation() const
Gets the rotation of the Actor relative to the Earth-Centered, Earth-Fixed (ECEF) coordinate system.
ACesiumGeoreference * ResolveGeoreference(bool bForceReresolve=false)
Resolves the Cesium Georeference to use with this Component.
double GetLatitude() const
Gets the latitude in degrees.
double GetLongitude() const
Gets the longitude in degrees.