Created
January 31, 2022 17:50
-
-
Save FAUSheppy/32063d46d1188a6dc20df74470a26251 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "CoreMinimal.h" | |
| #include "GameFramework/PawnMovementComponent.h" | |
| #include "GameFramework/Pawn.h" | |
| #include "Camera/CameraComponent.h" | |
| #include "Components/StaticMeshComponent.h" | |
| #include "Components/SceneComponent.h" | |
| #include "CustomPawnMovementComponent.generated.h" | |
| /** | |
| * | |
| */ | |
| UCLASS(ClassGroup = Movement, editinlinenew, meta = (BlueprintSpawnableComponent)) | |
| class FLIGHT_TEST_API UCustomPawnMovementComponent : public UPawnMovementComponent | |
| { | |
| GENERATED_BODY() | |
| private: | |
| public: | |
| APawn* controlledPawn; | |
| APlayerController* playerController; | |
| UStaticMeshComponent* ship; | |
| UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Category = "Movement") | |
| FVector lastMovement; | |
| UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Category = "Movement") | |
| FVector lastMovementDecayed; | |
| UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Category = "Movement") | |
| FRotator lastTurnDirection; | |
| UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Category = "Movement") | |
| FVector previousPosition; | |
| UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Category = "Movement") | |
| FRotator trueGlobalRotation; | |
| UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Category = "Movement") | |
| float rollSpeed = 120.0; | |
| UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Category = "Movement") | |
| float fakeShipRoll = 0.0; | |
| UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Category = "Movement") | |
| float fakeShipPitch = 0.0; | |
| UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Category = "Movement") | |
| bool boostOn = false; | |
| float fakeShipRollMax = 45.0; //degrees | |
| float fakeShipPitchMax = 10.0; | |
| float defaultAcceleration = 1.0; | |
| float defaultAccelerationSideward = 0.5; | |
| UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Category = "Movement") | |
| float maxForwardSpeed = 30.0; | |
| UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Category = "Movement") | |
| float maxSidewardSpeed = 10.0; | |
| /* speed at which to reduce movement speed when trust is removed */ | |
| UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Category = "Movement") | |
| float movementDecaySpeed = 0.75; | |
| /* applied as multiple to slow down rotation */ | |
| UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Category = "Movement") | |
| float rotationSpeedFix = 000.2; | |
| UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Category = "Movement") | |
| float engineThrottleRight; | |
| UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Category = "Movement") | |
| float engineThrottleForward; | |
| UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Category = "Movement") | |
| float engineThrottleUp; | |
| UCustomPawnMovementComponent(const FObjectInitializer& ObjectInitializer); | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment