Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.34 KB | None | 0 0
  1. // Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
  2. #pragma once
  3. #include "GameFramework/Character.h"
  4. #include "TestCharacter.generated.h"
  5.  
  6. UCLASS(config = Game)
  7. class ATestCharacter : 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.     ATestCharacter();
  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.  
  30.     UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Camera)
  31.         float ZoomAmount;
  32.  
  33.     UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Camera)
  34.         float MinBoomLength;
  35.  
  36.     UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Camera)
  37.         float MaxBoomLength;
  38.  
  39. protected:
  40.  
  41.     /** Called for forwards/backward input */
  42.     void MoveForward(float Value);
  43.  
  44.     /** Called for side to side input */
  45.     void Rotate(float Value);
  46.  
  47.     /**
  48.     * Called via input to turn at a given rate.
  49.     * @param Rate   This is a normalized rate, i.e. 1.0 means 100% of desired turn rate
  50.     */
  51.     void TurnAtRate(float Rate);
  52.  
  53.     /**
  54.     * Called via input to turn look up/down at a given rate.
  55.     * @param Rate   This is a normalized rate, i.e. 1.0 means 100% of desired turn rate
  56.     */
  57.     void LookUpAtRate(float Rate);
  58.  
  59.     void RightMouseReleased();
  60.     void RightMousePressed();
  61.  
  62.     void MouseWheelDown();
  63.     void MouseWheelUp();
  64.  
  65.     void StrafeRight(float Rate);
  66.  
  67.     bool bRightMouseDown;
  68.  
  69. protected:
  70.     // APawn interface
  71.     virtual void SetupPlayerInputComponent(class UInputComponent* InputComponent) override;
  72.     // End of APawn interface
  73.  
  74. public:
  75.     /** Returns CameraBoom subobject **/
  76.     FORCEINLINE class USpringArmComponent* GetCameraBoom() const { return CameraBoom; }
  77.     /** Returns FollowCamera subobject **/
  78.     FORCEINLINE class UCameraComponent* GetFollowCamera() const { return FollowCamera; }
  79. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement