I'm planning to use a quadtree for optimizing collision detection. But this quadtree can handle only one type of objects (so I used a base class for my objects).
If I use double dispatch after two object pointers are returned by the quadtree in a collision (derived from the same base class that the quadtree can handle) knowing their ID that identifies their type (an int in the base class) , how am I able to use these pointers with their respective type in order to double dispatch?
A LIMITED SOLUTION:
Before double dispatching, I could make a resolver function that combines both IDs as they were flags into a single parameter, and make a switch that decides which type are obj1 and obj2.
However, its still not very elegant. Any solution or better way to do this? thanks.