Thank you for this example, Germanunkol!
Up to now I have used these vector functions only to select edges/lines with the mouse cursor. However it was possible to do some simple obstacle avoidance with them as well. : )
Now I have added initialization functions for spheres and lines/line segments:
vec3d (09AUG07)ll_line3d_set()
ll_sphere_set()
They are overloaded like ll_vec3d_set(), so you can pass LL_VECTOR3D, VECTOR or individual values.
I have modified the while loop from your example and implemented the initialization functions:
while(1)
{
radius += mickey.z*time_step*5;
ll_sphere_set(&sphere, &vec1, (ll_vec3dtype)radius);
ll_line3d_set(&line, &vec2, &vec3);
isIntersecting = ll_vec3d_segSphereIntersect(line, sphere);
wait(1);
}
BTW: In my previous post I mistakenly wrote that "you can omit the &-operator for 'll_sunPos' if this vector is global". What I actually meant was, that you can omit this operator if 'll_sunPos' is a pointer.