An AABB, or Axis Aligned Bounding Box, is a non-rotating rectangular prism with given length, width, and height. This detects if a sphere, with given size and position, touches an AABB with given sizes and position.
All by me So what I do is take the center of the sphere, and find the closest point in or on the edge of the cube to the sphere's center. If the distance between the points is less than or equal to the radius of the sphere, they are touching. Wouldn't be too hard to adapt this idea to a non AABB object.