What code are you using that this is a usefull function. (just curious)
And: if Vector3(...).length() calculates the distance, you''d better just do this:
#define kwad(a) ((a)*(a))//Sphere1 is predefinableSphere2.Center=Triangle.Center;Sphere2.Radius=Triangle.Vertex[0]-Triangle.Center;float Dist=Vector3(Sphere2.Center-Sphere1.Center).lengthNOSQRT();float rads=kwad(Sphere1.Radius+Sphere2.Radius);if (Dist<rads) {//we collided->Test succesufull}
lengthNOSQRT() would return the distance variable before running the square root operation on it.
This way you won''t need the square root which is very expensive.
As you won''t need the exact distance (only if it''s more/less then the total radius) the result should be the same (even more precise).