Cesium for Unreal 2.12.0
Loading...
Searching...
No Matches
GlobeAwareDefaultPawn.h
Go to the documentation of this file.
1// Copyright 2020-2024 CesiumGS, Inc. and Contributors
2
3#pragma once
4
5#include "CesiumGeospatial/Ellipsoid.h"
6#include "CoreMinimal.h"
7#include "GameFramework/DefaultPawn.h"
8#include <glm/mat3x3.hpp>
9#include <glm/vec3.hpp>
10#include <vector>
11#include "GlobeAwareDefaultPawn.generated.h"
12
15class UCurveFloat;
17
23
29
35UCLASS()
36class CESIUMRUNTIME_API AGlobeAwareDefaultPawn : public ADefaultPawn {
37 GENERATED_BODY()
38
39public:
41
49 virtual void MoveForward(float Val) override;
50
56 virtual void MoveRight(float Val) override;
57
64 virtual void MoveUp_World(float Val) override;
65
69 virtual FRotator GetViewRotation() const override;
70
75 virtual FRotator GetBaseAimRotation() const override;
76
77 UPROPERTY(
78 meta =
79 (DeprecatedProperty,
80 DeprecationMessage =
81 "FlyToGranularityDegrees has been deprecated. This property no longer needs to be set."))
82 float FlyToGranularityDegrees_DEPRECATED = 0.01f;
83
84 UPROPERTY(
85 BlueprintAssignable,
86 meta =
87 (DeprecatedProperty,
88 DeprecationMessage =
89 "Use OnFlightComplete on CesiumFlyToComponent instead."))
90 FCompletedFlight OnFlightComplete_DEPRECATED;
91
92 UPROPERTY(
93 BlueprintAssignable,
94 meta =
95 (DeprecatedProperty,
96 DeprecationMessage =
97 "Use OnFlightInterrupted on CesiumFlyToComponent instead."))
98 FInterruptedFlight OnFlightInterrupt_DEPRECATED;
99
106 UFUNCTION(BlueprintPure, Category = "Cesium")
107 const FTransform& GetGlobeToUnrealWorldTransform() const;
108
116 UFUNCTION(
117 BlueprintCallable,
118 meta =
119 (DeprecatedFunction,
120 DeprecationMessage =
121 "Use FlyToEarthCenteredEarthFixed on CesiumFlyToComponent instead."))
122 void FlyToLocationECEF(
123 const FVector& ECEFDestination,
124 double YawAtDestination,
125 double PitchAtDestination,
126 bool CanInterruptByMoving);
127
136 UFUNCTION(
137 BlueprintCallable,
138 meta =
139 (DeprecatedFunction,
140 DeprecationMessage =
141 "Use FlyToLocationLongitudeLatitudeHeight on CesiumFlyToComponent instead."))
143 const FVector& LongitudeLatitudeHeightDestination,
144 double YawAtDestination,
145 double PitchAtDestination,
146 bool CanInterruptByMoving);
147
148protected:
149 virtual void Serialize(FArchive& Ar) override;
150 virtual void PostLoad() override;
151
157 UPROPERTY(
158 Category = "Cesium",
159 BlueprintReadOnly,
160 BlueprintGetter = GetGeoreference,
161 Meta =
162 (DeprecatedProperty,
163 DeprecationMessage =
164 "Get the Georeference instance from the Globe Anchor Component instead."))
165 ACesiumGeoreference* Georeference_DEPRECATED;
166
171 UFUNCTION(BlueprintGetter, Category = "Cesium")
172 ACesiumGeoreference* GetGeoreference() const;
173
177 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Cesium")
179
180private:
181 UPROPERTY(
182 Category = "Cesium",
183 BlueprintGetter = GetFlyToProgressCurve_DEPRECATED,
184 BlueprintSetter = SetFlyToProgressCurve_DEPRECATED,
185 meta =
186 (AllowPrivateAccess,
187 DeprecatedProperty,
188 DeprecationMessage =
189 "Use ProgressCurve on CesiumFlyToComponent instead."))
190 UCurveFloat* FlyToProgressCurve_DEPRECATED;
191 UFUNCTION(BlueprintGetter)
192 UCurveFloat* GetFlyToProgressCurve_DEPRECATED() const;
193 UFUNCTION(BlueprintSetter)
194 void SetFlyToProgressCurve_DEPRECATED(UCurveFloat* NewValue);
195
196 UPROPERTY(
197 Category = "Cesium",
198 BlueprintGetter = GetFlyToAltitudeProfileCurve_DEPRECATED,
199 BlueprintSetter = SetFlyToAltitudeProfileCurve_DEPRECATED,
200 meta =
201 (AllowPrivateAccess,
202 DeprecatedProperty,
203 DeprecationMessage =
204 "Use HeightPercentageCurve on CesiumFlyToComponent instead."))
205 UCurveFloat* FlyToAltitudeProfileCurve_DEPRECATED;
206 UFUNCTION(BlueprintGetter)
207 UCurveFloat* GetFlyToAltitudeProfileCurve_DEPRECATED() const;
208 UFUNCTION(BlueprintSetter)
209 void SetFlyToAltitudeProfileCurve_DEPRECATED(UCurveFloat* NewValue);
210
211 UPROPERTY(
212 Category = "Cesium",
213 BlueprintGetter = GetFlyToMaximumAltitudeCurve_DEPRECATED,
214 BlueprintSetter = SetFlyToMaximumAltitudeCurve_DEPRECATED,
215 meta =
216 (AllowPrivateAccess,
217 DeprecatedProperty,
218 DeprecationMessage =
219 "Use MaximumHeightByDistanceCurve on CesiumFlyToComponent instead."))
220 UCurveFloat* FlyToMaximumAltitudeCurve_DEPRECATED;
221 UFUNCTION(BlueprintGetter)
222 UCurveFloat* GetFlyToMaximumAltitudeCurve_DEPRECATED() const;
223 UFUNCTION(BlueprintSetter)
224 void SetFlyToMaximumAltitudeCurve_DEPRECATED(UCurveFloat* NewValue);
225
226 UPROPERTY(
227 Category = "Cesium",
228 BlueprintGetter = GetFlyToDuration_DEPRECATED,
229 BlueprintSetter = SetFlyToDuration_DEPRECATED,
230 meta =
231 (AllowPrivateAccess,
232 DeprecatedProperty,
233 DeprecationMessage =
234 "Use Duration on CesiumFlyToComponent instead."))
235 float FlyToDuration_DEPRECATED = 5.0f;
236 UFUNCTION(BlueprintGetter)
237 float GetFlyToDuration_DEPRECATED() const;
238 UFUNCTION(BlueprintSetter)
239 void SetFlyToDuration_DEPRECATED(float NewValue);
240
241 void _moveAlongViewAxis(EAxis::Type axis, double Val);
242 void _moveAlongVector(const FVector& axis, double Val);
243
244 UFUNCTION()
245 void _onFlightComplete();
246
247 UFUNCTION()
248 void _onFlightInterrupted();
249};
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FCompletedFlight)
The delegate for when the pawn finishes flying which is triggered from _handleFlightStep.
Controls how global geospatial coordinates are mapped to coordinates in the Unreal Engine level.
This pawn can be used to easily move around the globe while maintaining a sensible orientation.
virtual FRotator GetBaseAimRotation() const override
Gets the rotation of the aim direction, which is the same as the View Rotation.
virtual FRotator GetViewRotation() const override
Gets the absolute rotation of the camera view from the Unreal world.
virtual void MoveForward(float Val) override
Input callback to move forward in local space (or backward if Val is negative).
virtual void MoveUp_World(float Val) override
Input callback to move up in world space (or down if Val is negative).
virtual void MoveRight(float Val) override
Input callback to strafe right in local space (or left if Val is negative).
Smoothly animates the Actor to which it is attached on a flight to a new location on the globe.
FCesiumFlightCompleted OnFlightComplete
A delegate that will be called when the Actor finishes flying.
UCurveFloat * ProgressCurve
A curve that is used to determine the flight progress percentage for all the other curves.
float Duration
The length in seconds that the flight should last.
UCurveFloat * MaximumHeightByDistanceCurve
A curve that controls the maximum height that will be achieved during the flight as a function of the...
void FlyToLocationLongitudeLatitudeHeight(const FVector &LongitudeLatitudeHeightDestination, double YawAtDestination, double PitchAtDestination, bool CanInterruptByMoving)
Begin a smooth camera flight to the given WGS84 longitude in degrees (x), latitude in degrees (y),...
FCesiumFlightInterrupted OnFlightInterrupted
A delegate that will be called when the Actor's flight is interrupted.
UCurveFloat * HeightPercentageCurve
A curve that controls what percentage of the maximum height the Actor should take at a given time on ...
This component can be added to a movable actor to anchor it to the globe and maintain precise placeme...