Compare commits
3 Commits
7eb63171ce
...
04d489f5ab
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
04d489f5ab | ||
|
|
766a193885 | ||
|
|
07afc8a00b |
@@ -27,7 +27,10 @@ void ACameraPawn::CameraMove(const FInputActionValue& Value)
|
|||||||
auto r = GetActorRightVector();
|
auto r = GetActorRightVector();
|
||||||
auto f = r.Cross(FVector::UpVector);
|
auto f = r.Cross(FVector::UpVector);
|
||||||
f.Normalize();
|
f.Normalize();
|
||||||
SetActorLocation(GetActorLocation() + f * f2d.X * MoveSpeed + r * f2d.Y * MoveSpeed);
|
auto l = GetRootComponent()->GetRelativeLocation() + f * f2d.X * MoveSpeed + r * f2d.Y * MoveSpeed;
|
||||||
|
l.X = FMath::Clamp(l.X, -CameraMoveClamp, CameraMoveClamp);
|
||||||
|
l.Y = FMath::Clamp(l.Y, -CameraMoveClamp, CameraMoveClamp);
|
||||||
|
SetActorRelativeLocation(l);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ACameraPawn::CameraReset(const FInputActionValue& Value)
|
void ACameraPawn::CameraReset(const FInputActionValue& Value)
|
||||||
|
|||||||
@@ -33,6 +33,8 @@ public:
|
|||||||
float MaxArmLength = 3000.0f;
|
float MaxArmLength = 3000.0f;
|
||||||
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Config")
|
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Config")
|
||||||
float MinArmLength = 300.0f;
|
float MinArmLength = 300.0f;
|
||||||
|
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Config")
|
||||||
|
double CameraMoveClamp = 800.0;
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable, Category = "Camera")
|
UFUNCTION(BlueprintCallable, Category = "Camera")
|
||||||
void CameraZoom(const FInputActionValue& Value);
|
void CameraZoom(const FInputActionValue& Value);
|
||||||
|
|||||||
Reference in New Issue
Block a user