   Swept sphere - sphere collision detection
  HelloI'm trying to do a swept sphere - sphere collision detection system. I'm doing this in 3d and in C#.What is the algorithm?is there any sample code i could look at (C# or C++)?Any tutorials?I have the direction vector and the length i want it to be and the radius but that's about it.Thanks for all the help.web_scripter   
  There was a recent discussion on swept circle-circle tests here; the algorithm is the same for spheres. All the info you need should be there in the thread in one form or another, but ask if you need clarification.   ;  That test boils down to a line-sphere test, which is real simple.To do this you make one of the sphere's static (making the velocity of the other sphere relative to this one).Furthermore you make the non-static sphere a point, this is done by adding the radius to the other sphere.I.eo0 = Origin of sphere 0o1 = Origin of sphere 1v0 = Velocity of sphere 0v1 = Velocity of sphere 1r0 = Radius of sphere 0r1 = Radius of spshere 1Sphere:o = o0r = r0 + r1Point:o = o1v = v1 - v0Now you solve the collision time for the line o with the direction v against the sphere.Edit:Velocity is the same as a direction vector.   ;  Check out this  article at gamasutra (free registration required).   