Add wildlife navigation support
This commit is contained in:
@@ -66,6 +66,18 @@ public:
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Agrarian|Wildlife|Movement", meta = (ClampMin = "0.1"))
|
||||
float DecisionIntervalSeconds = 2.0f;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Agrarian|Wildlife|Movement")
|
||||
bool bUseNavigationMovement = true;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Agrarian|Wildlife|Movement", meta = (ClampMin = "1"))
|
||||
float NavigationAcceptanceRadius = 85.0f;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Agrarian|Wildlife|Movement", meta = (ClampMin = "1"))
|
||||
float NavigationRepathDistance = 175.0f;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Agrarian|Wildlife|Movement")
|
||||
FVector NavigationProjectionExtent = FVector(500.0f, 500.0f, 900.0f);
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Agrarian|Wildlife|Harvest")
|
||||
TArray<FAgrarianItemStack> HarvestYields;
|
||||
|
||||
@@ -97,6 +109,11 @@ protected:
|
||||
void ServerThink(float DeltaSeconds);
|
||||
void ChooseWanderTarget();
|
||||
void MoveTowardTarget();
|
||||
bool ChooseReachableWanderTarget(FVector& OutTarget) const;
|
||||
bool ProjectPointToNavigation(const FVector& CandidateLocation, FVector& OutProjectedLocation) const;
|
||||
bool RequestNavigationMove(const FVector& TargetLocation);
|
||||
void ClearNavigationMove();
|
||||
void DirectMoveTowardLocation(const FVector& TargetLocation, float MovementSpeed);
|
||||
void EnterDeadState();
|
||||
AAgrarianGameCharacter* FindNearestPlayer(float Radius) const;
|
||||
bool Harvest(AAgrarianGameCharacter* Interactor);
|
||||
@@ -112,5 +129,9 @@ protected:
|
||||
UPROPERTY()
|
||||
TObjectPtr<AActor> FocusActor;
|
||||
|
||||
UPROPERTY()
|
||||
FVector LastNavigationMoveTarget = FVector::ZeroVector;
|
||||
|
||||
bool bHasNavigationMoveTarget = false;
|
||||
float DecisionTimer = 0.0f;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user