63 lines
2.1 KiB
C++
63 lines
2.1 KiB
C++
// Fill out your copyright notice in the Description page of Project Settings.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "GameFramework/Pawn.h"
|
|
#include "CameraPawn.generated.h"
|
|
|
|
UCLASS()
|
|
class LONESE_API ACameraPawn : public APawn
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Camera")
|
|
class USpringArmComponent* SpringArmComponent;
|
|
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Camera")
|
|
class UCameraComponent* CameraComponent;
|
|
UPROPERTY(VisibleInstanceOnly, BlueprintReadOnly, Category = "Camera")
|
|
APawn* FollowTarget;
|
|
|
|
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Config")
|
|
FRotator InitialRotation = FRotator(-60.0f, 0.0f, 0.0f);
|
|
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Config")
|
|
float InitialArmLength = 1200.0f;
|
|
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Config")
|
|
float RotateSpeed = 2.0f;
|
|
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Config")
|
|
float ZoomSpeed =10.0f;
|
|
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Config")
|
|
float MoveSpeed = 10.0f;
|
|
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Config")
|
|
float MaxArmLength = 3000.0f;
|
|
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Config")
|
|
float MinArmLength = 300.0f;
|
|
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Config")
|
|
double CameraMoveClamp = 800.0;
|
|
|
|
UFUNCTION(BlueprintCallable, Category = "Camera")
|
|
void CameraZoom(const FInputActionValue& Value);
|
|
UFUNCTION(BlueprintCallable, Category = "Camera")
|
|
void CameraRotate(const FInputActionValue& Value);
|
|
UFUNCTION(BlueprintCallable, Category = "Camera")
|
|
void CameraMove(const FInputActionValue& Value);
|
|
UFUNCTION(BlueprintCallable, Category = "Camera")
|
|
void CameraReset(const FInputActionValue& Value);
|
|
|
|
// Sets default values for this pawn's properties
|
|
ACameraPawn();
|
|
// Called every frame
|
|
virtual void Tick(float DeltaTime) override;
|
|
|
|
// Called to bind functionality to input
|
|
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
|
|
|
|
protected:
|
|
// Called when the game starts or when spawned
|
|
virtual void BeginPlay() override;
|
|
|
|
private:
|
|
|
|
};
|