NewtonWorldForEachBodyInAABBDo needs a userdata parameter which is sent back in NewtonBodyIterator.
Let me give an example:
My game has joints, which automaticly attach, such as a semi trailer joint, all you do is get the truck close enough to trailer and game sees that and connects it.
I take trailer and use the NewtonWorldForEachBodyInAABBDo to look for truck cab bodies that come close to the attachment point, if they are close enough they are automaticly attached.
So, i call NewtonWorldForEachBodyInAABBDo which looks for correct bodies and discards the rest, but there in callback i have no idea for which trailer the callback is called, so i need a global variable to workaround this so the iterator callback knows which trailer it's looking for. Such code can not run properly multi-threadable.