That’s semi-correct. While there is no hard-limit on the number of from objects, there is a limit from a performance standpoint.
In the most naive implementation, collision is the ‘handshaking problem;’ once per frame, every object in the scene must ask every other object “Hey, am I colliding with you?” Computer scientists will tell you that this is a somewhat inefficient algorithm; the runtime is O(n^2). O in this context is “big-oh,” it’s a symbol computer scientists use when they talk about how fast an algorithm can run. This is just a fancy way to say that if I have n objects, I have to do at most n*n collision checks. This result gets big even for small values of n; not fun if every wall can be collided against!
Panda offers two optimizations for this. The first is the implicit optimization of sorting the world into a big tree; Panda knows that if it considers a sphere around all the objects in the tree, and your object isn’t colliding with that sphere, then it also can’t be colliding with the objects in the tree. So it can ignore testing many individual objects by instead testing against big spheres calculated at each branch of the render tree. This is a great optimization except for some degenerate cases (like everything being on top of everything else). But it still requires every object to at least try to collide with every single other object in the scene. This is totally unnecessary; two pieces of ground on opposite ends of the map, for example, would never collide with each other—and even if they did, why would you care?
That’s where Panda’s explicit optimization comes in. Panda has you divide the collision problem into ‘from’ objects and ‘into’ objects. Then instead of checking every object against every other object, it only needs to check every from object against every single into object. If your set of from objects is small (like, say, a single player avatar), then this is a big win; the runtime complexity collapses from O(n^2) to O(m*n), where m is my from objects and n is my into objects—for every new from object I add, I need to make n more ‘from-into’ checks, and for every new into object I add, I need to make m more ‘from-into’ checks. The less from and into objects you have, the lower m and n are, and the faster your collision pass runs.
So there’s not a hard upper-limit on from objects; the limit is that if you have too many of them, you defeat the from-into optimization and your collision problem approaches O(n^2) complexity. Usually, it’s best to just use as many from objects and into objects as you think you need, and if the game is running way too slow, come up with a way to get the same result using less from and into objects.
I hope that all helps. Best of luck with your project; can’t wait to see it!
-Mark