Monitor if object is intersected by any other object

I have a couple of cubes in my scene that move around randomly and I want to check if any of them is intersected by any other object in the scene. The function intersectsBox() just seems to work if I actually provide the object I want to validate against but in my case that could be any object at random.

Any ideas what to do here best?

Have a look at the //collision detection in the animation loop of this example, this is using the method .intersectsOBB from the obb class but would be a very similar function in an .intersectsBox scenario

I was thinking about something like that but then you have the “issue” that in objects you have [A, B, C] and then A checks against B and C. Afterwards B checks against A and C although the check B->A is not necessary as A has already covered that in the first iteration.
So now you would need an extra check to see if B was already validated against A. :confused: