What else do i need to have in my collision Classes to perform
collision response between all collision geometries? Do I need more info other than >return if two objects collide (true/false) ?
A collision test that only returns true/false is usually called an overlap test. This is due to the fact that this is the only info that it returns.
For more appropriate collision response you might also need:
- The intersection point between the two objects.
- and also the penetration depth.
- you might need the normal vector of the surface.
- And sometimes the time (t) of the collision especially when you are implementing dynamic collision detection, but I doubt that you need it for your simple game.
But determining what info you need depends on how you are going to implement your collision response and what info you need. For example if your collision response calculates the torque then you should calculate the intersection point to be able to determine where the force is going to be applied.
- τ is the torque vector and τ is the magnitude of the torque.
- r is the displacement vector (a vector from the point from which
![torque is measured to the point where force is applied).
- F is the force vector.
The reason I am showing the torque equation is that you need the collision point in order to calculate it (calculate r).
You usually need the normal vector, which can looked up once you the know face that collided, so you can implement any kind of reflection or knocking back. But this is also not strictly needed since you can get a way with a simpler approximation.
Should I go writing this myself or stop playing around and use some
open/free physics engine for a simple game like this?
You can do it either way, but in the end it's a personal preference especially if you are learning and not delivering a commercial product.
A physics engine will give you more options for your collision response. But it doesn't mean that it will be "better". A collision response might be as simple as knocking back an object.
Integrating a physics engine also means more work than what you might need. So you are the only one that can determine what is needed, and it's especially hard for us to judge without an appropriate context.