28 virtual void BeginPlay()
override;
29 virtual void Tick(
float DeltaTime)
override;
33 UFUNCTION(BlueprintCallable)
34 void SetPlayers(ACharacter* Player1, ACharacter* Player2);
38 FORCEINLINE USpringArmComponent*
GetCameraBoom()
const {
return CameraBoom; }
39 FORCEINLINE UCameraComponent* GetFollowCamera()
const {
return FollowCamera; }
43 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category =
"Parameters|Debug")
44 bool DebugLocation = false;
45 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Parameters|Debug")
46 bool DebugVariables = false;
50 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Parameters|Translation")
51 bool EnableVerticalMovement = true;
52 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Parameters|Translation")
53 float VerticalOffset = 0.f;
57 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Parameters|Distance", meta = (UIMin = 0.f))
58 float MinimumArmLength = 4000.f;
59 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Parameters|Distance", meta = (UIMin = 0.f))
60 float MaximumArmLength = 16000.f;
61 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Parameters|Distance", meta = (UIMin = 0.f))
62 float DepthBuffer = 400.f;
63 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Parameters|Distance", meta = (UIMin = 0.f))
64 float HorizontalBuffer = 200.f;
68 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Parameters|Angle")
69 bool UseAngleChange = true;
70 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Parameters|Angle", meta = (UIMin = 0.f))
71 float MinAngleReachedAtArmLength = 4000.f;
72 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Parameters|Angle", meta = (UIMin = 0.f))
73 float MaxAngleReachedAtArmLength = 20000.f;
74 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Parameters|Angle", meta = (UIMin = 0.f, UIMax = 90.f))
75 float MinArmAngle = 10.f;
76 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Parameters|Angle", meta = (UIMin = 0.f, UIMax = 90.f))
77 float MaxArmAngle = 20.f;
78 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Parameters|Angle")
79 float EasingAngleExp = 1.f;
80 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Parameters|Tilt shift")
81 float MinFStop = 0.2f;
85 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Parameters|Tilt shift")
87 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Parameters|Tilt shift")
88 float MaxBlurAtDistance = 100.f;
89 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Parameters|Tilt shift")
90 float MinBlurAtDistance = 1500;
91 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Parameters|Tilt shift")
92 float BlurMultiplier = 1.f;
96 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Parameters|Fog")
97 float FogDistanceToPlayer = 1000.f;
103 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Camera, meta = (AllowPrivateAccess = "true"))
104 USceneComponent* DefaultRootComponent;
105 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Camera, meta = (AllowPrivateAccess = "true"))
106 USpringArmComponent* CameraBoom;
107 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Camera, meta = (AllowPrivateAccess = "true"))
108 UCineCameraComponent* FollowCamera;
109 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Camera, meta = (AllowPrivateAccess = "true"))
110 USphereComponent* DebugSphere;
114 TArray<ACharacter*> Players;
118 float MaxPlayerHorizontalDistance = MAX_FLT;
119 float MaxPlayerDepthDistance = MAX_FLT;
123 UExponentialHeightFogComponent* FogComp =
nullptr;
128 void UpdatePosition();
129 void UpdateArmLenght();
130 void UpdateArmAngle();
131 void UpdateFog(
float DepthPlayerDistance);
132 void UpdateBlur(
float DepthPlayerDistance);
133 void ConstrainPlayerPositions();
137 FVector2D Get2DVect(FVector vect3d);
138 float GetAlpha(
float value,
float min,
float max);
139 float GetValue(
float alpha,
float min,
float max);
Dynamic cooperative camera system for two-player gameplay.
Definition MainCamera.h:21
FORCEINLINE USpringArmComponent * GetCameraBoom() const
Definition MainCamera.h:38