title: Advice on class structure in a collision detection system
body: <p>C++ is the first language I've used at all extensively that uses object-orientation, so I'm still a bit new to the idea. I'm trying to port a game library I was working on from Go (which uses interfaces instead of a true OOP system) to C++.</p>
  
  <p>I have a collision system that uses four types: A point, a bounding, a line, and a polygon. What I'd like to do is have all of these be abstract-able into a "Collider" class and have a function that is able to take two Collider objects and test for a collision. It would look something like this:</p>
  
  <pre><code>bool Collides(Collider obj1, Collider obj2);
  </code></pre>
  
  <p>Originally I was thinking I could have methods for each collision type that would test for a collision given another type (i.e. methods OnPoint, OnBounding, OnLine, and OnPolygon) and then have "Collider" be a virtual class that requires all these methods, but then I realized that would be impossible in C++ because it would make classes depend on each other for compilation (right?).</p>
  
  <p>I'm a little bit at a loss about what else I can do. Is my design idea a pipe dream?</p>