Hard limit on overlapping actors?

Hey,

Is there a limit on the number of actors that can be returned by GetOverlappingActors?

I seem to only ever get 992…

Here’s an image, all I’m doing is making all the cubes overlapping the box-collider white:

And here’s the relevant code I’m using to get the actors:

AWhiteBoxVolume* cVolume = *ItActor;

		TArray<AActor*> OverlappingActors;

		cVolume->CollisionBox->SetCollisionResponseToAllChannels(ECR_Overlap);
		cVolume->CollisionBox->SetCollisionEnabled(ECollisionEnabled::QueryAndPhysics);

		cVolume->CollisionBox->GetOverlappingActors(OverlappingActors, AStaticMeshActor::StaticClass());
		WhiteBoxMaterial = cVolume->WhiteBoxMaterial;
		if (cVolume->WhiteBoxOutsideActors)
		{
			ActorsToNotWhiteBox.Append(OverlappingActors);
		}
		else
		{
			ActorsToWhiteBox.Append(OverlappingActors);
		}

Yep there is hardcoded limit of overlapping actors, if you want to tweak it go to:

PhysxCollision.h

and tune, then recompile whole engine;) :

#define OVERLAP_BUFFER_SIZE						1024
#define OVERLAP_BUFFER_SIZE_MAX_SYNC_QUERIES	992

There is also limit for tracing/sweeping in the same file:

#define HIT_BUFFER_SIZE							512		// Hit buffer size for traces and sweeps. This is the total size allowed for sync + async tests.
#define HIT_BUFFER_MAX_SYNC_QUERIES				496		// Maximum number of queries to fill in the hit buffer for synchronous traces and sweeps. Async sweeps get the difference (HIT_BUFFER_SIZE - NumberOfHitsInSyncTest).

If you want to know how these limit works take a look at PhysxCollision.cpp → GeomOverlapMultiImp_PhysX function.

Regards

Pierdek

Alright, I guess that answers it. Makes some sense, but it’s quite annoying and a very arbitrary-seeming number. I’ll just have to automatically subdivide until I have enough boxes I guess.