Skip to content

Commit 3322536

Browse files
committed
Update: Change 'CollectFromKdtree' function name to represent a collection method
1 parent 77b5e29 commit 3322536

File tree

8 files changed

+24
-20
lines changed

8 files changed

+24
-20
lines changed

Kdtree/Config/DefaultKdtree.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[CoreRedirects]
2+
+FunctionRedirects=(OldName="/Script/Kdtree.AsyncKdtreeBPLibrary.CollectFromKdtreeAsync",NewName="/Script/Kdtree.AsyncKdtreeBPLibrary.CollectFromKdtreeSphereAsync")
3+
+FunctionRedirects=(OldName="/Script/Kdtree.KdtreeBPLibrary.CollectFromKdtree",NewName="/Script/Kdtree.KdtreeBPLibrary.CollectFromKdtreeSphere")

Kdtree/Source/Kdtree/Private/AsyncKdtreeBPLibrary.cpp

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ void UAsyncKdtreeBPLibrary::BuildKdtreeAsync(
8282
}
8383
}
8484

85-
struct FCollectFromKdtreeTaskParams
85+
struct FCollectFromKdtreeSphereTaskParams
8686
{
8787
const FKdtree* Tree;
8888
FVector Center;
@@ -91,10 +91,10 @@ struct FCollectFromKdtreeTaskParams
9191
TArray<FVector>* Data;
9292
};
9393

94-
class FCollectFromKdtreeTask : public FNonAbandonableTask
94+
class FCollectFromKdtreeSphereTask : public FNonAbandonableTask
9595
{
9696
public:
97-
FCollectFromKdtreeTask(const FCollectFromKdtreeTaskParams& InParams) : Params(InParams)
97+
FCollectFromKdtreeSphereTask(const FCollectFromKdtreeSphereTaskParams& InParams) : Params(InParams)
9898
{
9999
}
100100

@@ -109,30 +109,30 @@ class FCollectFromKdtreeTask : public FNonAbandonableTask
109109

110110
FORCEINLINE TStatId GetStatId() const
111111
{
112-
RETURN_QUICK_DECLARE_CYCLE_STAT(FCollectFromKdtreeTask, STATGROUP_ThreadPoolAsyncTasks);
112+
RETURN_QUICK_DECLARE_CYCLE_STAT(FCollectFromKdtreeSphereTask, STATGROUP_ThreadPoolAsyncTasks);
113113
}
114114

115115
private:
116-
FCollectFromKdtreeTaskParams Params;
116+
FCollectFromKdtreeSphereTaskParams Params;
117117
};
118118

119-
class FCollectFromKdtreeAction : public FPendingLatentAction
119+
class FCollectFromKdtreeSphereAction : public FPendingLatentAction
120120
{
121121
public:
122122
FLatentActionInfo LatentInfo;
123-
FAsyncTask<FCollectFromKdtreeTask>* Task;
123+
FAsyncTask<FCollectFromKdtreeSphereTask>* Task;
124124

125-
FCollectFromKdtreeAction(const FLatentActionInfo& InLatentInfo, const FKdtree* Tree, const FVector Center, float Radius,
125+
FCollectFromKdtreeSphereAction(const FLatentActionInfo& InLatentInfo, const FKdtree* Tree, const FVector Center, float Radius,
126126
TArray<int>* Indices, TArray<FVector>* Data)
127127
: LatentInfo(InLatentInfo), Task(nullptr)
128128
{
129-
FCollectFromKdtreeTaskParams Params;
129+
FCollectFromKdtreeSphereTaskParams Params;
130130
Params.Tree = Tree;
131131
Params.Center = Center;
132132
Params.Radius = Radius;
133133
Params.Indices = Indices;
134134
Params.Data = Data;
135-
Task = new FAsyncTask<FCollectFromKdtreeTask>(Params);
135+
Task = new FAsyncTask<FCollectFromKdtreeSphereTask>(Params);
136136
Task->StartBackgroundTask();
137137
}
138138

@@ -142,15 +142,16 @@ class FCollectFromKdtreeAction : public FPendingLatentAction
142142
}
143143
};
144144

145-
void UAsyncKdtreeBPLibrary::CollectFromKdtreeAsync(const UObject* WorldContextObject, const FKdtree& Tree, const FVector Center,
146-
float Radius, TArray<int>& Indices, TArray<FVector>& Data, FLatentActionInfo LatentInfo)
145+
void UAsyncKdtreeBPLibrary::CollectFromKdtreeSphereAsync(const UObject* WorldContextObject, const FKdtree& Tree,
146+
const FVector Center, float Radius, TArray<int>& Indices, TArray<FVector>& Data, FLatentActionInfo LatentInfo)
147147
{
148148
if (UWorld* World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull))
149149
{
150150
FLatentActionManager& LatentManager = World->GetLatentActionManager();
151-
if (LatentManager.FindExistingAction<FCollectFromKdtreeAction>(LatentInfo.CallbackTarget, LatentInfo.UUID) == nullptr)
151+
if (LatentManager.FindExistingAction<FCollectFromKdtreeSphereAction>(LatentInfo.CallbackTarget, LatentInfo.UUID) == nullptr)
152152
{
153-
FCollectFromKdtreeAction* NewAction = new FCollectFromKdtreeAction(LatentInfo, &Tree, Center, Radius, &Indices, &Data);
153+
FCollectFromKdtreeSphereAction* NewAction =
154+
new FCollectFromKdtreeSphereAction(LatentInfo, &Tree, Center, Radius, &Indices, &Data);
154155
LatentManager.AddNewAction(LatentInfo.CallbackTarget, LatentInfo.UUID, NewAction);
155156
}
156157
}
@@ -214,7 +215,7 @@ class FCollectFromKdtreeBoxAction : public FPendingLatentAction
214215
}
215216
};
216217

217-
void UAsyncKdtreeBPLibrary::CollectFromKdtreeAsyncBox(const UObject* WorldContextObject, const FKdtree& Tree, const FBox Box,
218+
void UAsyncKdtreeBPLibrary::CollectFromKdtreeBoxAsync(const UObject* WorldContextObject, const FKdtree& Tree, const FBox Box,
218219
TArray<int>& Indices, TArray<FVector>& Data, FLatentActionInfo LatentInfo)
219220
{
220221
if (UWorld* World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull))

Kdtree/Source/Kdtree/Private/KdtreeBPLibrary.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ void UKdtreeBPLibrary::ClearKdtree(FKdtree& Tree)
2626
KdtreeInternal::ClearKdtree(&Tree.Internal);
2727
}
2828

29-
void UKdtreeBPLibrary::CollectFromKdtree(
29+
void UKdtreeBPLibrary::CollectFromKdtreeSphere(
3030
const FKdtree& Tree, const FVector Center, float Radius, TArray<int>& Indices, TArray<FVector>& Data)
3131
{
3232
KdtreeInternal::CollectFromKdtree(Tree.Internal, Center, Radius, &Indices);

Kdtree/Source/Kdtree/Public/AsyncKdtreeBPLibrary.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ class KDTREE_API UAsyncKdtreeBPLibrary : public UBlueprintFunctionLibrary
3333
meta = (WorldContextObject = "WorldContextObject", Latent, LatentInfo = "LatentInfo", HidePin = "WorldContextObject",
3434
DefaultToSelf = "WorldContextObject"),
3535
Category = "SpacialDataStructure|kd-tree", DisplayName = "Collect From Kdtree Async (Sphere)")
36-
static void CollectFromKdtreeAsync(const UObject* WorldContextObject, const FKdtree& Tree, const FVector Center, float Radius,
37-
TArray<int>& Indices, TArray<FVector>& Data, FLatentActionInfo LatentInfo);
36+
static void CollectFromKdtreeSphereAsync(const UObject* WorldContextObject, const FKdtree& Tree, const FVector Center,
37+
float Radius, TArray<int>& Indices, TArray<FVector>& Data, FLatentActionInfo LatentInfo);
3838

3939
UFUNCTION(BlueprintCallable,
4040
meta = (WorldContextObject = "WorldContextObject", Latent, LatentInfo = "LatentInfo", HidePin = "WorldContextObject",
4141
DefaultToSelf = "WorldContextObject"),
4242
Category = "SpacialDataStructure|kd-tree", DisplayName = "Collect From Kdtree Async (Box)")
43-
static void CollectFromKdtreeAsyncBox(const UObject* WorldContextObject, const FKdtree& Tree, const FBox Box,
43+
static void CollectFromKdtreeBoxAsync(const UObject* WorldContextObject, const FKdtree& Tree, const FBox Box,
4444
TArray<int>& Indices, TArray<FVector>& Data, FLatentActionInfo LatentInfo);
4545
};

Kdtree/Source/Kdtree/Public/KdtreeBPLibrary.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class KDTREE_API UKdtreeBPLibrary : public UBlueprintFunctionLibrary
2929
static void ClearKdtree(UPARAM(ref) FKdtree& Tree);
3030

3131
UFUNCTION(BlueprintCallable, Category = "SpacialDataStructure|kd-tree", DisplayName = "Collect From Kdtree (Sphere)")
32-
static void CollectFromKdtree(
32+
static void CollectFromKdtreeSphere(
3333
const FKdtree& Tree, const FVector Center, float Radius, TArray<int>& Indices, TArray<FVector>& Data);
3434

3535
UFUNCTION(BlueprintCallable, Category = "SpacialDataStructure|kd-tree", DisplayName = "Collect From Kdtree (Box)")
Binary file not shown.
22.8 KB
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)