# Wrong intersection: Bounding Sphere and Ray

I've got a huge problem with BoundingSpheres and Rays in XNA and I really don't know how to solve it.

The problem:

foreach (BoundingSphere s1 in GetCollisionHullBoundingSpheres())
if (ray.Intersects(s1) != null)
{
System.Console.WriteLine("Ray: " + ray.Position + " Direction: " + ray.Direction);
System.Console.WriteLine("Ray: " + ray.Intersects(s1).Value + "\n");
return true;
}


The collision hull bounding spheres are the spheres from the mesh and the ray is calculated by using the playerposition and the vector (0,-5,0) as the direction.

Here is the output:

Sphere: {X:-16,52211 Y:-3,34731 Z:-15,66445} Radius: 5,077909
Ray: {X:75,29767 Y:29,15445 Z:-45,73476} Direction: {X:0 Y:-5 Z:0}
Ray: 35,84612


I can't understand how that ray can intersect with the sphere.

Xna's Ray.Intersect() tests that utilize the Ray's direction assumes that the direction vector is unit length.
If you normalize ray.Direction before running the test you will find it will not intersect.