Advertisement
Dieton

MyPawn.h

Nov 8th, 2023
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.14 KB | Gaming | 0 0
  1. // Fill out your copyright notice in the Description page of Project Settings.
  2.  
  3. #pragma once
  4.  
  5. #include "CoreMinimal.h"
  6. #include "GameFramework/Pawn.h"
  7.  
  8. #include "InputActionValue.h"//Struct header file
  9.  
  10. #include "MyPawn.generated.h"//This alwase needs to be last
  11.  
  12. //Pointers foward declare
  13. class UCapsuleComponent;
  14. class USkeletalMeshComponent;
  15. class UInputMappingContext;
  16. class UInputAction;
  17.  
  18. UCLASS()
  19. class THIRDPERSONBLUE_API AMyPawn : public APawn
  20. {
  21.     GENERATED_BODY()
  22.  
  23. public:
  24.     // Sets default values for this pawn's properties
  25.     AMyPawn();
  26.    
  27.     // Called every frame
  28.     virtual void Tick(float DeltaTime) override;
  29.  
  30.     // Called to bind functionality to input
  31.     virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
  32.  
  33. protected:
  34.     // Called when the game starts or when spawned
  35.     virtual void BeginPlay() override;
  36.    
  37.     /*These are all variables
  38.     UPROPERTY(EditerVisStates) or,
  39.     UPROPERTY(EditerVisStates, BlueprintVisStates) or,
  40.     UPROPERTY(BlueprintVisStates)
  41.  
  42.     EditerVisStates:
  43.     VisibleAnywhere -internal and external view but not editable
  44.     VisibleInstanceOnly
  45.     VisibleDefaultsOnly
  46.  
  47.     EditDefaultsOnly -internal blueprint view editable
  48.     EditInstanceOnly -My Perferd Visability editable
  49.     EditAnywhere - editable from anywhere
  50.  
  51.     BlueprintVisStates:
  52.     BlueprintReadWrite
  53.     BlueprintReadOnly
  54.     BlueprintWriteOnly
  55.     */
  56.     /*These are functions
  57.     UFUNCTION(BlueprintCallable)//input exicution panel
  58.     UFUNCTION(BlueprintPure)//Pure function
  59.  
  60.  
  61.     */
  62.  
  63.     // Called when the game starts or when spawned
  64.     virtual void BeginPlay() override;
  65.  
  66.     //UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "Cat")
  67.     //float catSpeed = 1.f;
  68.  
  69.     UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Sine Parameters")
  70.     float Amplitude = 0.25f;
  71.  
  72.     UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Sine Parameters")
  73.     float TimeConstant = 5.f;
  74.  
  75.     UFUNCTION(BlueprintPure)
  76.     float TransformedSin();
  77.  
  78.     UFUNCTION(BlueprintPure)
  79.     float TransformCos();
  80.  
  81.     template<typename T>
  82.     T Avg(T First, T Second);
  83.  
  84. };
  85.  
  86. template<typename T>
  87. inline T AItem::Avg(T First, T Second)
  88. {
  89.     return (First + Second) / 2;
  90. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement