39 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category =
"Camera|Behavior", meta = (ClampMin =
"0.0"))
40 FVector LocationLagSeconds = FVector(0.067f, 0.067f, 0.067f);
42 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Camera|Behavior", meta = (ClampMin = "0.0"))
43 FVector RotationLagSeconds = FVector(0.05f, 0.05f, 0.05f);
45 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Camera|Behavior")
46 float PlayerRotationLagSeconds = 0.15f;
59 virtual void BeginPlay()
override;
60 virtual void UpdateCameraBehavior(
AGameCameraManager* CameraManager,
float DeltaTime)
override;
64 FRotator CalculateFinalCameraRotation(
const AGameCameraManager* CameraManager,
float DeltaTime,
const FVector& TargetRotationLagSeconds,
const FRotator& BaseCameraRotation)
const;
66 APawn* GetCameraOwnerPawn()
const;
67 AActor* GetCameraSubjectActor()
const;
71 UFUNCTION(BlueprintPure, Category =
"Camera|Behavior")
72 FVector GetLocalOffset()
const;
74 UFUNCTION(Blueprintable)
75 void ResetCameraCorrection();
78 UFUNCTION(BlueprintPure, Category =
"Camera|Behavior")
79 FORCEINLINE
bool ShouldApplyCameraCorrection()
const
81 return bUseCameraCorrection && GetCameraSubjectActor() !=
nullptr;
85 UFUNCTION(BlueprintPure, Category =
"Camera|Behavior")
86 FORCEINLINE FVector GetGlobalOffset()
const
88 return CameraGlobalOffset;
92 UFUNCTION(BlueprintPure, Category =
"Camera|Behavior")
93 FORCEINLINE FVector GetPivotLagSeconds()
const
95 return CameraBehavior.LocationLagSeconds;
99 UFUNCTION(BlueprintPure, Category =
"Camera|Behavior")
100 FORCEINLINE FVector GetRotationLagSeconds()
const
102 return CameraBehavior.RotationLagSeconds;
106 UFUNCTION(BlueprintPure, Category =
"Camera|Behavior")
107 FORCEINLINE FRotator GetSmoothPlayerRotation()
const
109 return PlayerSmoothedRotation;
113 UFUNCTION(BlueprintPure, Category =
"Camera|Behavior")
114 FORCEINLINE FVector2D GetMouseSensitivity()
const
123 CurrentTrackingSpeedMultiplier = FMath::Max(NewSpeedMultiplier, 0.0f);
129 return CurrentTrackingSpeedMultiplier;
133 bool HasSubjectGameplayTag(FGameplayTag Tag)
const;
136 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category =
"Camera|Behavior")
137 bool bUseCameraCorrection = true;
140 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Camera|Behavior")
141 FVector CameraGlobalOffset = FVector(0.0f, 0.0f, 60.0f);
143 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Camera|Behavior")
144 FVector CameraLocalOffset = FVector::ZeroVector;
146 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Camera|Behavior")
147 float CameraMinFOV = 60.0f;
149 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Camera|Behavior")
150 float CameraMaxFOV = 110.0f;
153 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Camera|Behavior", meta = (ClampMin = "0.0", ClampMax = "60.0", Units = "deg"))
154 float RunFOVOffset = 5.0f;
157 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Camera|Behavior", meta = (ClampMin = "0.0", Units = "s"))
158 float RunFOVBlendSeconds = 0.2f;
160 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Camera|Behavior")
164 bool bHasCameraCorrection = false;
165 bool bMovementStopped = false;
166 bool bRotationStopped = false;
168 FVector FrozenPivotLocation = FVector::ZeroVector;
169 FVector LastEffectivePivotLocation = FVector::ZeroVector;
170 FRotator FrozenCameraRotation = FRotator::ZeroRotator;
171 FRotator LastFinalCameraRotation = FRotator::ZeroRotator;
173 FRotator PlayerSmoothedRotation = FRotator::ZeroRotator;
174 FRotator CamSmoothedRotation = FRotator::ZeroRotator;
175 FVector CamSmoothedPivotLocation = FVector::ZeroVector;
177 float CurrentTrackingSpeedMultiplier = 1.0f;
178 float CurrentRunFOVOffset = 0.0f;