RaanCharacter.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. // Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
  2. #pragma once
  3. #include "CoreMinimal.h"
  4. #include "GameFramework/Character.h"
  5. #include "RaanCharacter.generated.h"
  6. UCLASS(config=Game)
  7. class ARaanCharacter : public ACharacter
  8. {
  9. GENERATED_BODY()
  10. /** Camera boom positioning the camera behind the character */
  11. UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Camera, meta = (AllowPrivateAccess = "true"))
  12. class USpringArmComponent* CameraBoom;
  13. /** Follow camera */
  14. UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Camera, meta = (AllowPrivateAccess = "true"))
  15. class UCameraComponent* FollowCamera;
  16. /** Target volume */
  17. UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Character, meta = (AllowPrivateAccess = "true"))
  18. class UCapsuleComponent* TargetVolume;
  19. public:
  20. ARaanCharacter();
  21. /** Base turn rate, in deg/sec. Other scaling may affect final turn rate. */
  22. UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=Camera)
  23. float BaseTurnRate;
  24. /** Base look up/down rate, in deg/sec. Other scaling may affect final rate. */
  25. UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=Camera)
  26. float BaseLookUpRate;
  27. protected:
  28. /** Resets HMD orientation in VR. */
  29. void OnResetVR();
  30. /** Called for forwards/backward input */
  31. void MoveForward(float Value);
  32. /** Called for side to side input */
  33. void MoveRight(float Value);
  34. /**
  35. * Called via input to turn at a given rate.
  36. * @param Rate This is a normalized rate, i.e. 1.0 means 100% of desired turn rate
  37. */
  38. void TurnAtRate(float Rate);
  39. /**
  40. * Called via input to turn look up/down at a given rate.
  41. * @param Rate This is a normalized rate, i.e. 1.0 means 100% of desired turn rate
  42. */
  43. void LookUpAtRate(float Rate);
  44. /** Handler for when a touch input begins. */
  45. void TouchStarted(ETouchIndex::Type FingerIndex, FVector Location);
  46. /** Handler for when a touch input stops. */
  47. void TouchStopped(ETouchIndex::Type FingerIndex, FVector Location);
  48. void ToggleTarget();
  49. void Interact();
  50. protected:
  51. // APawn interface
  52. virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
  53. // End of APawn interface
  54. public:
  55. /** Returns CameraBoom subobject **/
  56. FORCEINLINE class USpringArmComponent* GetCameraBoom() const { return CameraBoom; }
  57. /** Returns FollowCamera subobject **/
  58. FORCEINLINE class UCameraComponent* GetFollowCamera() const { return FollowCamera; }
  59. /** Returns FollowCamera subobject **/
  60. FORCEINLINE class UCapsuleComponent* GetTargetVolume() const { return TargetVolume; }
  61. };