|
|
|
|
| #pragma once
|
|
|
| #include "GameFramework/CharacterMovementComponent.h"
|
| #include "NativeGameplayTags.h"
|
|
|
| #include "LyraCharacterMovementComponent.generated.h"
|
|
|
| #define UE_API LYRAGAME_API
|
|
|
| class UObject;
|
| struct FFrame;
|
|
|
| LYRAGAME_API UE_DECLARE_GAMEPLAY_TAG_EXTERN(TAG_Gameplay_MovementStopped);
|
|
|
| |
| |
| |
| |
|
|
| USTRUCT(BlueprintType)
|
| struct FLyraCharacterGroundInfo
|
| {
|
| GENERATED_BODY()
|
|
|
| FLyraCharacterGroundInfo()
|
| : LastUpdateFrame(0)
|
| , GroundDistance(0.0f)
|
| {}
|
|
|
| uint64 LastUpdateFrame;
|
|
|
| UPROPERTY(BlueprintReadOnly)
|
| FHitResult GroundHitResult;
|
|
|
| UPROPERTY(BlueprintReadOnly)
|
| float GroundDistance;
|
| };
|
|
|
|
|
| |
| |
| |
| |
|
|
| UCLASS(MinimalAPI, Config = Game)
|
| class ULyraCharacterMovementComponent : public UCharacterMovementComponent
|
| {
|
| GENERATED_BODY()
|
|
|
| public:
|
|
|
| UE_API ULyraCharacterMovementComponent(const FObjectInitializer& ObjectInitializer);
|
|
|
| UE_API virtual void SimulateMovement(float DeltaTime) override;
|
|
|
| UE_API virtual bool CanAttemptJump() const override;
|
|
|
|
|
| UFUNCTION(BlueprintCallable, Category = "Lyra|CharacterMovement")
|
| UE_API const FLyraCharacterGroundInfo& GetGroundInfo();
|
|
|
| UE_API void SetReplicatedAcceleration(const FVector& InAcceleration);
|
|
|
|
|
| UE_API virtual FRotator GetDeltaRotation(float DeltaTime) const override;
|
| UE_API virtual float GetMaxSpeed() const override;
|
|
|
|
|
| protected:
|
|
|
| UE_API virtual void InitializeComponent() override;
|
|
|
| protected:
|
|
|
|
|
| FLyraCharacterGroundInfo CachedGroundInfo;
|
|
|
| UPROPERTY(Transient)
|
| bool bHasReplicatedAcceleration = false;
|
| };
|
|
|
| #undef UE_API
|
|
|