Skip to content

Commit

Permalink
Add ufunction to return vector path
Browse files Browse the repository at this point in the history
  • Loading branch information
midgen committed May 8, 2020
1 parent 772536f commit 419f12a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Source/UESVON/Private/SVONNavigationComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,18 @@ bool USVONNavigationComponent::FindPathImmediate(const FVector& aStartPosition,
return false;
}

void USVONNavigationComponent::FindPathImmediate(const FVector& aStartPosition, const FVector& aTargetPosition, TArray<FVector>& OutPathPoints)
{
FindPathImmediate(aStartPosition, aTargetPosition, &mySVONPath);

OutPathPoints.Empty();

for (const FSVONPathPoint& PathPoint : mySVONPath->GetPathPoints())
{
OutPathPoints.Emplace(PathPoint.myPosition);
}
}

void USVONNavigationComponent::DebugLocalPosition(FVector& aPosition)
{

Expand Down
3 changes: 3 additions & 0 deletions Source/UESVON/Public/SVONNavigationComponent.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ class UESVON_API USVONNavigationComponent : public UActorComponent
bool FindPathAsync(const FVector& aStartPosition, const FVector& aTargetPosition, FThreadSafeBool& aCompleteFlag, FSVONNavPathSharedPtr* oNavPath);
bool FindPathImmediate(const FVector& aStartPosition, const FVector& aTargetPosition, FSVONNavPathSharedPtr* oNavPath);

UFUNCTION(BlueprintCallable, Category = UESVON)
void FindPathImmediate(const FVector &aStartPosition, const FVector &aTargetPosition, TArray<FVector>& OutPathPoints);

FSVONNavPathSharedPtr& GetPath() { return mySVONPath; }

protected:
Expand Down

0 comments on commit 419f12a

Please sign in to comment.