How can i get and use Contexts in custom EQS Generator in C++?

Hi
i have created a custom eqs generator based on my needs and now i want to generate some points based on a custom context created in BP.

here is my .h file:

class MYGAME_API UEQGenerator_Test: public UEnvQueryGenerator_ProjectedPoints
{
	GENERATED_BODY()
	UPROPERTY(EditAnywhere, Category = Generator)
		TSubclassOf<class UEnvQueryContext> Center;

    	UPROPERTY(EditAnywhere, Category = Generator)
    		TSubclassOf<class UEnvQueryContext> MyContext;
	virtual void GenerateItems(FEnvQueryInstance& QueryInstance) const override;
private:
	mutable FEnvQueryInstance* CachedQueryInstanceQuerier;
};

i’ve done this so far for “Center” context that is querier:

void UEQGenerator_Test::GenerateItems(FEnvQueryInstance& QueryInstance) const
{
    	TArray<FVector> CenterPoints;
    	QueryInstance.PrepareContext(Center, CenterPoints);
    	CachedQueryInstanceQuerier = &QueryInstance;
    	check(CachedQueryInstanceQuerier);
    	const FVector QuerierLoc = Cast<AActor>(CachedQueryInstanceQuerier->Owner.Get())->GetActorLocation();
}

and how can i get details of this context(“MyContext”) in code? e.g its location and rotation? what should i do?

ok, i found the answer:

	TArray<AActor*> MyContextActors;
	if (!QueryInstance.PrepareContext(MyContext, MyContextActors))
	{
		return;
	}
	
	for (int32 ContextIndex = 0; ContextIndex < MyContextActors.Num(); ContextIndex++)
	{
		UE_LOG(LogTemp, Warning, TEXT("MyContext Loc is %s"), *MyContextActors[ContextIndex]->GetActorLocation().ToString());
	}

just get the first number of the array in case of using one actor

MyContextActors[0]