Cesium for Unreal 2.12.0
Loading...
Searching...
No Matches
CesiumFlyToComponent.h
Go to the documentation of this file.
1// Copyright 2020-2024 CesiumGS, Inc. and Contributors
2
3#pragma once
4
5#include "CesiumGeospatial/SimplePlanarEllipsoidCurve.h"
7#include "CesiumFlyToComponent.generated.h"
8
9class UCurveFloat;
11
15DECLARE_DYNAMIC_MULTICAST_DELEGATE(FCesiumFlightCompleted);
16
20DECLARE_DYNAMIC_MULTICAST_DELEGATE(FCesiumFlightInterrupted);
21
25UENUM(BlueprintType)
59
64UCLASS(ClassGroup = "Cesium", Meta = (BlueprintSpawnableComponent))
65class CESIUMRUNTIME_API UCesiumFlyToComponent
67 GENERATED_BODY()
68
69public:
71
79 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cesium")
80 UCurveFloat* ProgressCurve;
81
92 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cesium")
93 UCurveFloat* HeightPercentageCurve;
94
106 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cesium")
107 UCurveFloat* MaximumHeightByDistanceCurve;
108
112 UPROPERTY(
113 EditAnywhere,
114 BlueprintReadWrite,
115 Category = "Cesium",
116 meta = (ClampMin = 0.0))
117 float Duration = 5.0f;
118
122 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cesium")
124
129 UPROPERTY(BlueprintAssignable, Category = "Cesium");
130 FCesiumFlightCompleted OnFlightComplete;
131
136 UPROPERTY(BlueprintAssignable, Category = "Cesium");
137 FCesiumFlightInterrupted OnFlightInterrupted;
138
149 UFUNCTION(BlueprintCallable, Category = "Cesium")
150 void FlyToLocationEarthCenteredEarthFixed(
151 const FVector& EarthCenteredEarthFixedDestination,
152 double YawAtDestination,
153 double PitchAtDestination,
154 bool CanInterruptByMoving);
155
170 UFUNCTION(BlueprintCallable, Category = "Cesium")
171 void FlyToLocationLongitudeLatitudeHeight(
172 const FVector& LongitudeLatitudeHeightDestination,
173 double YawAtDestination,
174 double PitchAtDestination,
175 bool CanInterruptByMoving);
176
187 UFUNCTION(BlueprintCallable, Category = "Cesium")
188 void FlyToLocationUnreal(
189 const FVector& UnrealDestination,
190 double YawAtDestination,
191 double PitchAtDestination,
192 bool CanInterruptByMoving);
193
198 UFUNCTION(BlueprintCallable, Category = "Cesium")
199 void InterruptFlight();
200
201protected:
202 virtual void TickComponent(
203 float DeltaTime,
204 ELevelTick TickType,
205 FActorComponentTickFunction* ThisTickFunction) override;
206
207private:
208 FQuat GetCurrentRotationEastSouthUp();
209 void SetCurrentRotationEastSouthUp(const FQuat& EastSouthUpRotation);
210
211 bool _flightInProgress = false;
212 bool _canInterruptByMoving;
213 float _currentFlyTime;
214 double _maxHeight;
215 FVector _destinationEcef;
216 FQuat _sourceRotation;
217 FQuat _destinationRotation;
218 FVector _previousPositionEcef;
219 TUniquePtr<CesiumGeospatial::SimplePlanarEllipsoidCurve> _currentCurve;
220 double _length;
221};
ECesiumFlyToRotation
Indicates which rotation to use for orienting the object during flights.
@ Actor
Uses the relative rotation of the root component of the Actor to which the CesiumFlyToComponent is at...
@ ControlRotationInEastSouthUp
Uses the ControlRotation of the Controller of the Pawn to which the CesiumFlyToComponent is attached.
@ ControlRotationInUnreal
Uses the ControlRotation of the Controller of the Pawn to which the CesiumFlyToComponent is attached.
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FCesiumFlightCompleted)
The delegate for when the Actor finishes flying.
Smoothly animates the Actor to which it is attached on a flight to a new location on the globe.
This component can be added to a movable actor to anchor it to the globe and maintain precise placeme...