From e4c38ccc4c922f08a6717611597267dcd3a2bd46 Mon Sep 17 00:00:00 2001 From: Recep Aslantas Date: Fri, 22 Mar 2024 23:49:05 +0300 Subject: [PATCH] docs: update ray sphere intersection brief --- include/cglm/struct/ray.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/cglm/struct/ray.h b/include/cglm/struct/ray.h index ca0e03738..1341fe97a 100644 --- a/include/cglm/struct/ray.h +++ b/include/cglm/struct/ray.h @@ -40,6 +40,13 @@ glms_ray_(triangle)(vec3s origin, /*! * @brief ray sphere intersection * + * - t1 > 0, t2 > 0: ray intersects the sphere at t1 and t2 both ahead of the origin + * - t1 < 0, t2 > 0: ray starts inside the sphere, exits at t2 + * - t1 < 0, t2 < 0: no intersection ahead of the ray + * - the caller can check if the intersection points (t1 and t2) fall within a + * specific range (for example, tmin < t1, t2 < tmax) to determine if the + * intersections are within a desired segment of the ray + * * @param[in] origin ray origin * @param[out] dir normalized ray direction * @param[in] s sphere [center.x, center.y, center.z, radii]