super-duper-spoon/Source/Shooter/ShooterCharacter.h

73 lines
2.1 KiB
C++

// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Character.h"
#include "ShooterCharacter.generated.h"
class USpringArmComponent;
class UCameraComponent;
UCLASS()
class SHOOTER_API AShooterCharacter : public ACharacter
{
GENERATED_BODY()
public:
// Sets default values for this character's properties
AShooterCharacter();
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
/* Called for forwards/backwards input */
void MoveForward(float Value);
/* Called for side to side input */
void MoveRight(float Value);
/**
* Called via input to turn at a given rate.
* @param Rate This is a normalized rate, i.e. 1.0 means 100% of desired rate
*/
void TurnAtRate(float Rate);
/**
* Called via input to look up/down at a given rate.
* @param Rate This is a normalized rate, i.e. 1.0 means 100% of desired rate
*/
void LookUpAtRate(float Rate);
public:
// Called every frame
virtual void Tick(float DeltaTime) override;
// Called to bind functionality to input
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
private:
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Camera, meta = (AllowPrivateAccess = true))
USpringArmComponent* CameraBoom;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Camera, meta = (AllowPrivateAccess = true))
UCameraComponent* FollowCamera;
/* Base turn rate, in deg/sec. Other scaling may affect final rate */
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Camera, meta = (AllowPrivateAccess = true))
float BaseTurnRate;
/* Base look up/down rate, in deg/sec. Other scaling may affect final rate */
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Camera, meta = (AllowPrivateAccess = true))
float BaseLookUpRate;
public:
/* Returns CameraBoom SubObject */
FORCEINLINE USpringArmComponent* GetCameraBoom() const { return CameraBoom; }
/* Returns FollowCamera SubObject */
FORCEINLINE UCameraComponent* GetFollowCamera() const { return FollowCamera; }
};