void UEnvQueryGenerator_PathingGrid::FindNodeRefsInPathDistance(const class ARecastNavMesh* NavMesh, const FVector& ContextLocation, float InMaxPathDistance, bool bPathFromContext, TArray<NavNodeRef>& NodeRefs, FBox& NodeRefsBounds) const { FBox MyBounds(0); #if ENVQUERY_CLUSTER_SEARCH const bool bUseBacktracking = !bPathFromContext; NavMesh->GetClustersWithinPathingDistance(ContextLocation, InMaxPathDistance, NodeRefs, bUseBacktracking); for (int32 RefIndex = 0; RefIndex < NodeRefs.Num(); RefIndex++) { FBox ClusterBounds; const bool bSuccess = NavMesh->GetClusterBounds(NodeRefs[RefIndex], ClusterBounds); if (bSuccess) { MyBounds += ClusterBounds; } } #else TSharedPtr<FNavigationQueryFilter> NavFilterInstance = NavigationFilter != NULL ? UNavigationQueryFilter::GetQueryFilter(NavMesh, NavigationFilter)->GetCopy() : NavMesh->GetDefaultQueryFilter()->GetCopy(); NavFilterInstance->SetBacktrackingEnabled(!bPathFromContext); NavMesh->GetPolysWithinPathingDistance(ContextLocation, InMaxPathDistance, NodeRefs, NavFilterInstance); TArray<FVector> PolyVerts; for (int32 RefIndex = 0; RefIndex < NodeRefs.Num(); RefIndex++) { PolyVerts.Reset(); const bool bSuccess = NavMesh->GetPolyVerts(NodeRefs[RefIndex], PolyVerts); if (bSuccess) { MyBounds += FBox(PolyVerts); } } #endif NodeRefsBounds = MyBounds; }
FBoxSphereBounds UGameplayDebuggerDrawComponent::CalcBounds(const FTransform& LocalToWorld) const { //we know nothing about FBox MyBounds(FVector(-HALF_WORLD_MAX1, -HALF_WORLD_MAX1, -HALF_WORLD_MAX1), FVector(HALF_WORLD_MAX1, HALF_WORLD_MAX1, HALF_WORLD_MAX1)); return MyBounds; }