I am trying to implement 3D ball to ball collisions. Although I know the math to do so, I do not how to use my already defined functions to accomplish this deed. For example, I need to compute the plane that is tangent to both balls at the point of collision. Then I need to take reflections from this plane. I am using a simple vec3f structure to represent position and direction of balls. Any help appreciated.
check if overlapped
(dist from centre to centre < sum of two radii)
relocate spheres so they’re just touching
(you can probably do this by forcing positions of centres to be radii sum, knowing linear equation from two centres)
if You have the time and computing power.You could determine the point of contact and apply the impulse along the vector(s) pointing to the centre of each sphere from the contact. This will give you a more realistic collision.