Guest User

TWGameCharacter.h

a guest
Dec 2nd, 2015
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.41 KB | None | 0 0
  1. // Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
  2. #pragma once
  3. #include "GameFramework/Character.h"
  4. #include "TWGameCharacter.generated.h"
  5.  
  6. UCLASS(config=Game)
  7. class ATWGameCharacter : public ACharacter
  8. {
  9.     GENERATED_BODY()
  10.  
  11.     /** Camera boom positioning the camera behind the character */
  12.     UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Camera, meta = (AllowPrivateAccess = "true"))
  13.     class USpringArmComponent* CameraBoom;
  14.  
  15.     /** Follow camera */
  16.     UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Camera, meta = (AllowPrivateAccess = "true"))
  17.     class UCameraComponent* FollowCamera;
  18. public:
  19.     ATWGameCharacter();
  20.  
  21.     /** Base turn rate, in deg/sec. Other scaling may affect final turn rate. */
  22.     UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=Camera)
  23.     float BaseTurnRate;
  24.  
  25.     /** Base look up/down rate, in deg/sec. Other scaling may affect final rate. */
  26.     UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=Camera)
  27.     float BaseLookUpRate;
  28.  
  29.     /** Free view Camera */
  30.     UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Camera, meta = (AllowPrivateAccess = "true"))
  31.         bool bIsInFreeView;
  32.  
  33.     virtual void BeginPlay();
  34.     virtual void Tick(float DeltaTime);
  35.     void FreeViewStarted();
  36.     void FreeViewStopped();
  37.  
  38. protected:
  39.  
  40.     /** Called for forwards/backward input */
  41.     void MoveForward(float Value);
  42.  
  43.     /** Called for side to side input */
  44.     void MoveRight(float Value);
  45.  
  46.     /**
  47.      * Called via input to turn at a given rate.
  48.      * @param Rate  This is a normalized rate, i.e. 1.0 means 100% of desired turn rate
  49.      */
  50.     void TurnAtRate(float Rate);
  51.  
  52.     /**
  53.      * Called via input to turn look up/down at a given rate.
  54.      * @param Rate  This is a normalized rate, i.e. 1.0 means 100% of desired turn rate
  55.      */
  56.     void LookUpAtRate(float Rate);
  57.  
  58.     /** Handler for when a touch input begins. */
  59.     void TouchStarted(ETouchIndex::Type FingerIndex, FVector Location);
  60.  
  61.     /** Handler for when a touch input stops. */
  62.     void TouchStopped(ETouchIndex::Type FingerIndex, FVector Location);
  63.  
  64. protected:
  65.     // APawn interface
  66.     virtual void SetupPlayerInputComponent(class UInputComponent* InputComponent) override;
  67.     // End of APawn interface
  68.  
  69. public:
  70.     /** Returns CameraBoom subobject **/
  71.     FORCEINLINE class USpringArmComponent* GetCameraBoom() const { return CameraBoom; }
  72.     /** Returns FollowCamera subobject **/
  73.     FORCEINLINE class UCameraComponent* GetFollowCamera() const { return FollowCamera; }
  74. };
Advertisement
Add Comment
Please, Sign In to add comment